| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <?php
- /*------------------------------------------------------*/
- /* taskereasy Heading
- /*------------------------------------------------------*/
- vc_map(array(
- "name" => esc_html__("Timeline", 'taskereasy'),
- "base" => "taskereasy_timeline",
- 'icon' => get_template_directory_uri() . '/assets/images/favicon-icon/shortcode-icon.png',
- "class" => "",
- "description" => esc_html__("Add taskereasy timeline", 'taskereasy'),
- "category" => esc_html__('Taskereasy Shortcodes', 'taskereasy'),
- "params" => array(
- array(
- "type" => "param_group",
- "heading" => esc_html__("Timeline List", 'taskereasy'),
- "param_name" => "timeline_list",
- "params" => array(
- array(
- "type" => "textfield",
- "heading" => esc_html__("Date", 'taskereasy'),
- "param_name" => "date_picker",
- ),
- array(
- "type" => "textfield",
- "heading" => esc_html__("Title", 'taskereasy'),
- "param_name" => "title",
- ),
- array(
- "type" => "textarea_safe",
- "heading" => esc_html__("Subtitle", 'taskereasy'),
- "param_name" => "subtext",
- ),
-
- )
- ),
- array(
- "type" => "textfield",
- "heading" => esc_html__("Class", 'taskereasy'),
- "param_name" => "class",
- ),
- array(
- 'type' => 'css_editor',
- 'heading' => esc_html__( 'CSS', 'taskereasy' ),
- 'param_name' => 'custom_design',
- 'group' => esc_html__( 'Design options', 'taskereasy' ),
- )
- )
- ));
- add_shortcode( 'taskereasy_timeline', function($atts, $content = null) {
- extract(shortcode_atts(array(
- 'date' => '',
- 'title' => '',
- 'subtext' => '',
- //'timeline_align' => 'left',
- 'class' => '',
- 'custom_design' => '',
- ), $atts));
-
- $custom_design = vc_shortcode_custom_css_class( $custom_design, ' ' );
- $time_list = vc_param_group_parse_atts( $atts['timeline_list'] );
- $class = html_entity_decode(vc_value_from_safe($class, true));
- //$time_align = html_entity_decode(vc_value_from_safe($timeline_align, true));
- $output = '';
- $count = 0;
- //$output .= print_r($time_list);
-
- $output .= '<div class="'.$class.'">';
- foreach ($time_list as $timeline) {
- if($count%2 == 0){
- $output .='
- <div class="journey-werp '.$custom_design.'">
- <div class="row">
- <div class="col-md-6">
- <div class="timeline text-right">
- <p><b>'.$time_list[$count]['date_picker'].'</b></p>
- </div>
- </div>
- <div class="col-md-6">
- <div class="journey-overview">
- <h4>'.$time_list[$count]['title'].'</h4>
- <p>'.$time_list[$count]['subtext'].'</p>
- </div>
- </div>
- </div>
- </div>
- ';
- $count++;
- }
-
- else
- {
- $output .='
- <div class="journey-werp '.$custom_design.'">
- <div class="row">
- <div class="col-md-6 order-md-12">
- <div class="timeline ">
- <p><b>'.$time_list[$count]['date_picker'].'</b></p>
- </div>
- </div>
- <div class="col-md-6">
- <div class="journey-overview text-right">
- <h4>'.$time_list[$count]['title'].'</h4>
- <p>'.$time_list[$count]['subtext'].'</p>
- </div>
- </div>
- </div>
- </div>
- ';
- $count++;
- }
- }
- $output .= '</div>';
- return $output;
- });
|