__("Timeline", 'awavc'), "base" => "timeline", "icon" => "awavc_timeline_icon", "as_parent" => array('only' => 'timeline_item, timeline_sep'), "category" =>array( __('Advanced Elements', 'awavc'),__('Content', 'awavc')), "content_element" => true, "show_settings_on_create" => false, "description" => __('Timeline container', 'awavc'), "params" => array( array( "type" => "dropdown", "class" => "", "heading" => __("Line type", 'awavc'), "param_name" => "type", 'save_always' => true, "value" => array( "Solid" => "solid", "Dotted" => "dotted", "Dashed" => "dashed" ), "std" => "solid", "description" => "Select type of timeline axe" ), array( "type" => "colorpicker", "class" => "", "heading" => __("Line color", 'awavc'), "param_name" => "line_color", "description" => "Select color of timeline axe" ), array( "type" => "textfield", "heading" => __("Extra class name", 'awavc'), "param_name" => "el_class", "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'awavc') ) ), "js_view" => 'VcColumnView' ) ); vc_map( array( "name" => __("Timeline Item", 'awavc'), "base" => "timeline_item", "icon" => "awavc_timeline_item", "content_element" => true, "description" => __('Single timeline item', 'awavc'), "as_child" => array('only' => 'timeline'), "params" => array( array( "type" => "dropdown", "class" => "", "heading" => __("Item position", 'awavc'), "param_name" => "position", 'save_always' => true, "value" => array( "Right" => "right", "Left" => "left", ), "std" => "right", "description" => "Select type of timeline axe" ), array( "type" => "colorpicker", "class" => "", "heading" => __("Node color", 'awavc'), "param_name" => "node_color", "description" => "Select color of timeline node" ), array( "type" => "textfield", "heading" => __("Date", 'awavc'), "param_name" => "date" ), array( "type" => "colorpicker", "class" => "", "heading" => __("Date background color", 'awavc'), "param_name" => "date_color", "description" => "Select background color for date" ), array( "type" => "colorpicker", "class" => "", "heading" => __("Date text color", 'awavc'), "param_name" => "date_text_color", "description" => "Select text color for date" ), array( "type" => "textfield", "heading" => __("Title", 'awavc'), "param_name" => "title", "admin_label" => true, ), array( "type" => "textarea_html", "holder" => "div", "heading" => __("Content", 'awavc'), "param_name" => "content", "value" => __("Item content.", 'awavc') ), array( "type" => "textfield", "heading" => __("Extra class name", 'awavc'), "param_name" => "el_class", "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'awavc') ) ) ) ); vc_map( array( "name" => __("Timeline Seprator", 'awavc'), "base" => "timeline_sep", "icon" => "awavc_timeline_separator", "content_element" => true, "description" => __('Timeline item separator', 'awavc'), "as_child" => array('only' => 'timeline'), "params" => array( array( "type" => "textfield", "heading" => __("Separator text", 'awavc'), "param_name" => "sep_text", "admin_label" => true, ), array( "type" => "colorpicker", "class" => "", "heading" => __("Separator background color", 'awavc'), "param_name" => "sep_color", "description" => "Select background color for separator" ), array( "type" => "colorpicker", "class" => "", "heading" => __("Separator text color", 'awavc'), "param_name" => "sep_text_color", "description" => "Select text color for separator" ), array( "type" => "textfield", "heading" => __("Extra class name", 'awavc'), "param_name" => "el_class", "description" => __("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", 'awavc') ) ) ) ); class WPBakeryShortCode_timeline extends WPBakeryShortCodesContainer { } class WPBakeryShortCode_timeline_item extends WPBakeryShortCode { } class WPBakeryShortCode_timeline_sep extends WPBakeryShortCode { } add_shortcode('timeline', 'dp_timeline'); add_shortcode('timeline_item', 'dp_timeline_item'); add_shortcode('timeline_sep', 'dp_timeline_sep'); function dp_timeline( $atts, $content = null ) { extract(shortcode_atts(array( 'type' => '', 'line_color' => '', "el_class"=>"" ), $atts)); //[time_container] $linecolor = ''; if ($line_color != '') $line_color = 'style ="border-color:'.$line_color.'"'; $dp_timeline ='
'; $dp_timeline .='
'; $dp_timeline .= do_shortcode($content); $dp_timeline.='
'; return $dp_timeline; } function dp_timeline_item( $atts, $content = null ) { extract(shortcode_atts(array( 'node_color' => '', 'date_color' =>'', 'position' => 'right', 'date_text_color' => '', 'title' => '', 'date' => '', 'dp_animation' => "", "el_class"=>"" ), $atts)); wp_register_style( 'timeline-css', plugins_url( 'css/timeline.css', __FILE__) ); wp_enqueue_style( 'timeline-css' ); //[time_line_item] $date_style = ''; if ($dp_animation != "") $dp_animation = ' data-animated ="'.$dp_animation.'"'; if ($node_color !='') $node_color = 'style = "border-color:'.$node_color.'"'; if (($date_color !='') || ($date_text_color != '')) { $date_style = 'style="'; if ($date_color !='') $date_style .='background-color:'.$date_color.';'; if ($date_color !='') $date_style .='color:'.$date_text_color.';'; $date_style .= '"'; } $dp_timeline_item ='
'; $dp_timeline_item .='
'; $dp_timeline_item .='
'.$date.'
'; $dp_timeline_item .='
'; if ($title != '') $dp_timeline_item .='

'.$title.'

'; $dp_timeline_item .=wpb_js_remove_wpautop($content, true).'
'; $dp_timeline_item .='
'; return $dp_timeline_item; } function dp_timeline_sep( $atts, $content = null ) { extract(shortcode_atts(array( 'sep_color' => '', 'sep_text_color' => '', 'sep_text' => '', "el_class"=>"" ), $atts)); //[time_line_item] $sep_style = ''; if (($sep_color !='') || ($sep_text_color != '')) { $sep_style = 'style="'; if ($sep_color !='') $sep_style .='background-color:'.$sep_color.';'; if ($sep_color !='') $sep_style .='color:'.$sep_text_color.';'; $sep_style .= '"'; } $dp_timeline_sep = '
'.$sep_text.'
'; return $dp_timeline_sep; }