1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
|
<?php if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); }
class WPBakeryShortCode_mvc_timeline_son extends WPBakeryShortCode {
protected function content( $atts, $content = null ) {
extract( shortcode_atts( array( 'date' => '', 'clr' => '', 'size' => '', 'centerstyle' => 'fonticon', 'bgclr' => '', 'maintitle' => '', 'titlealign' => 'left', 'titlepadding' => '10', 'titlesize' => '', 'titleclr' => '', 'titlebg' => '', 'image_id' => '', 'img_width' => '', 'icon' => '', 'icon_size' => '', 'css' => '', ), $atts ) ); if ($image_id != '') { $image_url = wp_get_attachment_url( $image_id ); } $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), $this->settings['base'], $atts ); $content = wpb_js_remove_wpautop($content, true); ob_start(); ?> <div class="cd-timeline-block"> <?php if ($centerstyle == 'fonticon') { ?> <div class="cd-timeline-img cd-picture" style="background: <?php echo $bgclr; ?>; border-radius: 50%; text-align:center;"> <i class="<?php echo $icon; ?>" aria-hidden="true" style="font-size: <?php echo $icon_size; ?>px; color: #fff;vertical-align: middle;"></i> </div> <?php } ?>
<?php if ($centerstyle == 'dot') { ?> <div class="cd-timeline-img cd-timeline-dot cd-picture" style="background: <?php echo $bgclr; ?>; border-radius: 50%;"> </div> <?php } ?>
<div class="cd-timeline-content <?php echo $css_class; ?>"> <span class="timeline-arrow" style="border-right-color: <?php echo $titlebg; ?>"></span> <span class="timeline-arrow" style="border-left-color: <?php echo $titlebg; ?>"></span> <span class="timeline-arrow" style="border-right: 7px solid <?php echo $titlebg; ?>;"></span>
<h2 style="background: <?php echo $titlebg; ?>; color: <?php echo $titleclr; ?>; font-size: <?php echo $titlesize; ?>px; text-align: <?php echo $titlealign; ?>; padding: <?php echo $titlepadding ?>px 15px;"> <?php echo $maintitle; ?> </h2> <?php if ($image_url != '') { ?> <img src="<?php echo $image_url; ?>" style="max-width: 100%; width: <?php echo $img_width; ?>px"> <?php } ?> <div class="cd-timeline-content-area" style="padding: 0 10px; display: block;"> <?php echo $content; ?> </div> <span class="cd-date" style="color: <?php echo $clr; ?>; font-size: <?php echo $size; ?>px;"> <?php echo $date ?> </span> </div> </div>
<?php return ob_get_clean(); } }
vc_map( array( "name" => __( 'Timeline', 'timeline' ), "base" => "mvc_timeline_son", "as_child" => array('only' => 'mvc_timeline_father'), "content_element" => true, "category" => __('Mega Addons'), "description" => __('Add multiple images and text', ''), "icon" => plugin_dir_url( __FILE__ ).'../icons/timeline.png', 'params' => array( array( "type" => "textfield", "heading" => __( 'Date', 'timeline' ), "param_name" => "date", "description" => __( 'Write timeline date e.g Jan 15 <a target="_blank" href="https://addons.topdigitaltrends.net/timeline/">See Demo</a>', 'timeline' ), "group" => 'General', ),
array( "type" => "colorpicker", "heading" => __( 'Color', 'timeline' ), "param_name" => "clr", "description" => __( 'color of the date', 'timeline' ), "group" => 'General', ),
array( "type" => "vc_number", "heading" => __( 'Font size', 'timeline' ), "param_name" => "size", "description" => __( 'fone size of date in pixel e.g 17', 'timeline' ), "suffix" => 'px', "group" => 'General', ),
array( "type" => "vc_links", "param_name" => "caption_url", "class" => "ult_param_heading", "description" => __( '<span style="Background: #ddd;padding: 10px; display: block; color: #0073aa;font-weight:600;"><a href="https://1.envato.market/02aNL" target="_blank" style="text-decoration: none;">Get the Pro version for more stunning elements and customization options.</a></span>', 'ihover' ), "group" => 'General', ),
array( "type" => "dropdown", "heading" => __( 'Select style', 'timeline' ), "param_name" => "centerstyle", "description" => __( 'style for center', 'timeline' ), "group" => 'Timeline Center', "value" => array( 'Center With Font Icon' => 'fonticon', 'Only Dot' => 'dot', ) ),
array( "type" => "iconpicker", "heading" => __( 'Font Icon', 'timeline' ), "param_name" => "icon", "description" => __( 'choose font awesome or leave blank', 'timeline' ), "dependency" => array('element' => "centerstyle", 'value' => 'fonticon'), "group" => 'Timeline Center', ),
array( "type" => "colorpicker", "heading" => __( 'Background', 'timeline' ), "param_name" => "bgclr", "description" => __( 'Center dot background color', 'timeline' ), "group" => 'Timeline Center', ),
array( "type" => "vc_number", "heading" => __( 'Font size', 'timeline' ), "param_name" => "icon_size", "description" => __( 'Icon font size e.g 17', 'timeline' ), "dependency" => array('element' => "centerstyle", 'value' => 'fonticon'), "suffix" => 'px', "group" => 'Timeline Center', ),
array( "type" => "textfield", "heading" => __( 'Title', 'timeline' ), "param_name" => "maintitle", "value" => "Timeline Title", "group" => 'Content', ),
array( "type" => "dropdown", "heading" => __( 'Title Align', 'timeline' ), "param_name" => "titlealign", "edit_field_class" => "vc_col-sm-4 wdo_items_to_show wdo_margin_bottom", "group" => 'Content', "value" => array( 'Left' => 'left', 'Center' => 'center', 'Right' => 'right', ) ),
array( "type" => "vc_number", "heading" => __( 'Title size', 'timeline' ), "edit_field_class" => "vc_col-sm-4 wdo_items_to_show wdo_margin_bottom", "param_name" => "titlesize", "suffix" => 'px', "group" => 'Content', ),
array( "type" => "vc_number", "heading" => __( 'Padding [Top - Bottom]', 'timeline' ), "edit_field_class" => "vc_col-sm-4 wdo_items_to_show wdo_margin_bottom", "param_name" => "titlepadding", "value" => '10', "suffix" => 'px', "group" => 'Content', ),
array( "type" => "colorpicker", "heading" => __( 'Title Color', 'timeline' ), "edit_field_class" => "vc_col-sm-4 wdo_items_to_show wdo_margin_bottom", "param_name" => "titleclr", "group" => 'Content', ),
array( "type" => "colorpicker", "heading" => __( 'Title Background', 'timeline' ), "edit_field_class" => "vc_col-sm-4 wdo_items_to_show wdo_margin_bottom", "param_name" => "titlebg", "group" => 'Content', ),
array( "type" => "attach_image", "heading" => __( 'Select Image', 'timeline' ), "param_name" => "image_id", "group" => 'Content', ),
array( "type" => "vc_number", "heading" => __( 'Image Width', 'timeline' ), "param_name" => "img_width", "suffix" => 'px', "group" => 'Content', ),
array( "type" => "textarea_html", "heading" => __( 'Content Details', 'timeline' ), "param_name" => "content", "description" => __( 'Add heading, details, pictures or video url', 'timeline' ), "group" => 'Content', ),
array( "type" => "css_editor", "heading" => __( 'Styles', 'timeline' ), "param_name" => "css", "group" => 'Design Option', ), ) ) );
|