PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.8.7
Shortcodes and extra features for Phlox theme v2.8.7
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elementor / widgets / tabs.php
auxin-elements / includes / elementor / widgets Last commit date
theme-elements 4 years ago accordion.php 5 years ago audio.php 6 years ago before-after.php 5 years ago button.php 5 years ago carousel-navigation.php 5 years ago contact-box.php 6 years ago contact-form.php 5 years ago custom-list.php 4 years ago divider.php 6 years ago gallery.php 4 years ago gmap.php 6 years ago heading-modern.php 5 years ago icon.php 5 years ago image.php 4 years ago mailchimp.php 5 years ago modern-button.php 5 years ago quote.php 5 years ago recent-comments.php 5 years ago recent-posts-grid-carousel.php 4 years ago recent-posts-land-style.php 5 years ago recent-posts-masonry.php 5 years ago recent-posts-tiles-carousel.php 5 years ago recent-posts-tiles.php 5 years ago recent-posts-timeline.php 5 years ago recent-products.php 5 years ago responsive-table.php 5 years ago search.php 6 years ago staff.php 5 years ago svg.php 6 years ago tabs.php 5 years ago testimonial.php 4 years ago text.php 5 years ago touch-slider.php 5 years ago video.php 6 years ago
tabs.php
630 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor\Elements;
3
4 use Elementor\Plugin;
5 use Elementor\Widget_Base;
6 use Elementor\Controls_Manager;
7 use Elementor\Group_Control_Typography;
8 use Elementor\Core\Schemes\Typography;
9 use Elementor\Group_Control_Border;
10 use Elementor\Group_Control_Box_Shadow;
11 use Elementor\Group_Control_Background;
12
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit; // Exit if accessed directly.
16 }
17
18 /**
19 * Elementor 'Tabs' widget.
20 *
21 * Elementor widget that displays an 'Tabs' with lightbox.
22 *
23 * @since 1.0.0
24 */
25 class Tabs extends Widget_Base {
26
27 /**
28 * Get widget name.
29 *
30 * Retrieve 'Tabs' widget name.
31 *
32 * @since 1.0.0
33 * @access public
34 *
35 * @return string Widget name.
36 */
37 public function get_name() {
38 return 'aux_tabs';
39 }
40
41 /**
42 * Get widget title.
43 *
44 * Retrieve 'Tabs' widget title.
45 *
46 * @since 1.0.0
47 * @access public
48 *
49 * @return string Widget title.
50 */
51 public function get_title() {
52 return __('Tabs', 'auxin-elements' );
53 }
54
55 /**
56 * Get widget icon.
57 *
58 * Retrieve 'Tabs' widget icon.
59 *
60 * @since 1.0.0
61 * @access public
62 *
63 * @return string Widget icon.
64 */
65 public function get_icon() {
66 return 'eicon-tabs auxin-badge';
67 }
68
69 /**
70 * Get widget categories.
71 *
72 * Retrieve 'Tabs' widget icon.
73 *
74 * @since 1.0.0
75 * @access public
76 *
77 * @return string Widget icon.
78 */
79 public function get_categories() {
80 return array( 'auxin-core' );
81 }
82
83 /**
84 * Register 'Tabs' widget controls.
85 *
86 * Adds different input fields to allow the user to change and customize the widget settings.
87 *
88 * @since 1.0.0
89 * @access protected
90 */
91 protected function _register_controls() {
92
93 /*-----------------------------------------------------------------------------------*/
94 /* Content TAB
95 /*-----------------------------------------------------------------------------------*/
96
97 $this->start_controls_section(
98 'tab_items_section',
99 array(
100 'label' => __('Content', 'auxin-elements' ),
101 )
102 );
103
104 $this->add_control(
105 'tab_items',
106 array(
107 'label' => __( 'Tab Items', 'auxin-elements' ),
108 'type' => Controls_Manager::REPEATER,
109 'default' => array(
110 array(
111 'tab_label' => __( 'Tab #1', 'auxin-elements' ),
112 'content' => __( 'Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'auxin-elements' )
113 ),
114 array(
115 'tab_label' => __( 'Tab #2', 'auxin-elements' ),
116 'content' => __( 'Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'auxin-elements' )
117 ),
118 array(
119 'tab_label' => __( 'Tab #3', 'auxin-elements' ),
120 'content' => __( 'Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'auxin-elements' )
121 )
122 ),
123 'fields' => array(
124 array(
125 'name' => 'tab_label',
126 'label' => __( 'Title & Content', 'auxin-elements' ),
127 'type' => Controls_Manager::TEXT,
128 'default' => __( 'Tab Title' , 'auxin-elements' ),
129 'dynamic' => array(
130 'active' => true
131 ),
132 'label_block' => true
133 ),
134 array(
135 'name' => 'content',
136 'label' => __( 'Content', 'auxin-elements' ),
137 'type' => Controls_Manager::WYSIWYG,
138 'default' => __( 'Tab Content', 'auxin-elements' ),
139 'show_label' => false,
140 )
141 ),
142 'title_field' => '{{{ tab_label }}}'
143 )
144 );
145
146 $this->add_control(
147 'skin',
148 array(
149 'label' => __('Skin','auxin-elements' ),
150 'type' => Controls_Manager::SELECT, //'aux-visual-select',
151 'options' => array(
152 'bordered' => __('Bordered', 'auxin-elements' ),
153 'aux-stripe' => __('No border', 'auxin-elements')
154 ),
155 'default' => 'bordered'
156 )
157 );
158
159 /*$this->add_control(
160 'type',
161 array(
162 'label' => __('Type','auxin-elements' ),
163 'type' => Controls_Manager::SELECT, //'aux-visual-select',
164 'options' => array(
165 'horizontal' => __('Horizontal', 'auxin-elements' ),
166 'vertical' => __('Vertical' , 'auxin-elements')
167 ),
168 'default' => 'horizontal'
169 )
170 );*/
171
172 $this->end_controls_section();
173
174 /*-----------------------------------------------------------------------------------*/
175 /* Style TAB
176 /*-----------------------------------------------------------------------------------*/
177
178 /* Tabs Section
179 /*-------------------------------------*/
180
181 $this->start_controls_section(
182 'tab_section',
183 array(
184 'label' => __( 'Tabs', 'auxin-elements' ),
185 'tab' => Controls_Manager::TAB_STYLE
186 )
187 );
188
189 $this->add_control(
190 'tab_cursor',
191 array(
192 'label' => __( 'Mouse Cursor', 'auxin-elements' ),
193 'type' => Controls_Manager::SELECT,
194 'options' => array(
195 'default' => __( 'Default', 'auxin-elements' ),
196 'pointer' => __( 'Pointer', 'auxin-elements' ),
197 'zoom-in' => __( 'Zoom', 'auxin-elements' ),
198 'help' => __( 'Help', 'auxin-elements' )
199 ),
200 'default' => 'pointer',
201 'selectors' => array(
202 '{{WRAPPER}} .tabs > li:not(.active)' => 'cursor: {{VALUE}};'
203 )
204 )
205 );
206
207 $this->add_responsive_control(
208 'tab_padding',
209 array(
210 'label' => __( 'Padding', 'auxin-elements' ),
211 'type' => Controls_Manager::DIMENSIONS,
212 'size_units' => array( 'px', 'em', '%' ),
213 'selectors' => array(
214 '{{WRAPPER}} .tabs > li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
215 )
216 )
217 );
218
219 /*$this->add_responsive_control(
220 'tab_margin',
221 array(
222 'label' => __( 'Margin', 'auxin-elements' ),
223 'type' => Controls_Manager::DIMENSIONS,
224 'size_units' => array( 'px', 'em' ),
225 'allowed_dimensions' => 'all',
226 'selectors' => array(
227 '{{WRAPPER}} .tabs > li' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
228 )
229 )
230 );*/
231
232 $this->add_control(
233 'tab_border_radius',
234 array(
235 'label' => __( 'Border Radius', 'auxin-elements' ),
236 'type' => Controls_Manager::DIMENSIONS,
237 'size_units' => array( 'px', 'em', '%' ),
238 'selectors' => array(
239 '{{WRAPPER}} .tabs > li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow:hidden;'
240 ),
241 'allowed_dimensions' => 'all',
242 'separator' => 'after'
243 )
244 );
245
246 $this->start_controls_tabs( 'tab_status' );
247
248 $this->start_controls_tab(
249 'tab_status_normal',
250 array(
251 'label' => __( 'Normal' , 'auxin-elements' )
252 )
253 );
254
255 $this->add_group_control(
256 Group_Control_Box_Shadow::get_type(),
257 array(
258 'name' => 'tab_boxshadow_normal',
259 'label' => __( 'Box Shadow', 'auxin-elements' ),
260 'selector' => '{{WRAPPER}} .tabs > li',
261 'separator' => 'none'
262 )
263 );
264
265 $this->add_group_control(
266 Group_Control_Border::get_type(),
267 array(
268 'name' => 'tab_border_normal',
269 'selector' => '{{WRAPPER}} .tabs > li',
270 'separator' => 'none'
271 )
272 );
273
274 $this->add_group_control(
275 Group_Control_Background::get_type(),
276 array(
277 'name' => 'tab_background_normal',
278 'selector' => '{{WRAPPER}} .tabs > li',
279 'separator' => 'none'
280 )
281 );
282
283 $this->end_controls_tab();
284
285
286 $this->start_controls_tab(
287 'tab_status_hover',
288 array(
289 'label' => __( 'Hover' , 'auxin-elements' )
290 )
291 );
292
293 $this->add_group_control(
294 Group_Control_Box_Shadow::get_type(),
295 array(
296 'name' => 'tab_boxshadow_hover',
297 'label' => __( 'Box Shadow Normal', 'auxin-elements' ),
298 'selector' => '{{WRAPPER}} .tabs > li:hover',
299 'separator' => 'none'
300 )
301 );
302
303 $this->add_group_control(
304 Group_Control_Border::get_type(),
305 array(
306 'name' => 'tab_border_hover',
307 'selector' => '{{WRAPPER}} .tabs > li:hover',
308 'separator' => 'none'
309 )
310 );
311
312 $this->add_group_control(
313 Group_Control_Background::get_type(),
314 array(
315 'name' => 'tab_background_hover',
316 'selector' => '{{WRAPPER}} .tabs > li:hover',
317 'separator' => 'none'
318 )
319 );
320
321 $this->end_controls_tab();
322
323
324 $this->start_controls_tab(
325 'title_bar_status_active',
326 array(
327 'label' => __( 'Selected' , 'auxin-elements' )
328 )
329 );
330
331 $this->add_group_control(
332 Group_Control_Box_Shadow::get_type(),
333 array(
334 'name' => 'title_bar_boxshadow_active',
335 'label' => __( 'Box Shadow Normal', 'auxin-elements' ),
336 'selector' => '{{WRAPPER}} .tabs > li.active',
337 'separator' => 'none'
338 )
339 );
340
341 $this->add_group_control(
342 Group_Control_Border::get_type(),
343 array(
344 'name' => 'title_bar_border_active',
345 'selector' => '{{WRAPPER}} .tabs > li.active',
346 'separator' => 'none'
347 )
348 );
349
350 $this->add_group_control(
351 Group_Control_Background::get_type(),
352 array(
353 'name' => 'title_bar_background_active',
354 'selector' => '{{WRAPPER}} .tabs > li.active',
355 'separator' => 'none'
356 )
357 );
358
359 $this->end_controls_tab();
360
361 $this->end_controls_tabs();
362
363
364 $this->end_controls_section();
365
366
367 /* Title Style Section
368 /*-------------------------------------*/
369
370 $this->start_controls_section(
371 'title_style_section',
372 array(
373 'label' => __( 'Title', 'auxin-elements' ),
374 'tab' => Controls_Manager::TAB_STYLE
375 )
376 );
377
378 $this->start_controls_tabs( 'title_colors' );
379
380 $this->start_controls_tab(
381 'title_color_normal',
382 array(
383 'label' => __( 'Normal' , 'auxin-elements' )
384 )
385 );
386
387 $this->add_control(
388 'title_color',
389 array(
390 'label' => __( 'Color', 'auxin-elements' ),
391 'type' => Controls_Manager::COLOR,
392 'selectors' => array(
393 '{{WRAPPER}} .tabs a' => 'color: {{VALUE}} !important;'
394 )
395 )
396 );
397
398 $this->end_controls_tab();
399
400 $this->start_controls_tab(
401 'title_color_hover',
402 array(
403 'label' => __( 'Hover' , 'auxin-elements' )
404 )
405 );
406
407 $this->add_control(
408 'title_hover_color',
409 array(
410 'label' => __( 'Color', 'auxin-elements' ),
411 'type' => Controls_Manager::COLOR,
412 'selectors' => array(
413 '{{WRAPPER}} .tabs li:hover a' => 'color: {{VALUE}} !important;',
414 )
415 )
416 );
417
418 $this->end_controls_tab();
419
420 $this->end_controls_tabs();
421
422 $this->add_group_control(
423 Group_Control_Typography::get_type(),
424 array(
425 'name' => 'title_typography',
426 'scheme' => Typography::TYPOGRAPHY_1,
427 'selector' => '{{WRAPPER}} .tabs a'
428 )
429 );
430
431 $this->end_controls_section();
432
433 /* Content Style Section
434 /*-------------------------------------*/
435
436 $this->start_controls_section(
437 'content_style_section',
438 array(
439 'label' => __( 'Content', 'auxin-elements' ),
440 'tab' => Controls_Manager::TAB_STYLE
441 )
442 );
443
444 $this->add_control(
445 'content_color',
446 array(
447 'label' => __( 'Color', 'auxin-elements' ),
448 'type' => Controls_Manager::COLOR,
449 'selectors' => array(
450 '{{WRAPPER}} .tabs-content .entry-editor' => 'color: {{VALUE}}'
451 )
452 )
453 );
454
455 $this->add_group_control(
456 Group_Control_Typography::get_type(),
457 array(
458 'name' => 'content_typography',
459 'scheme' => Typography::TYPOGRAPHY_1,
460 'selector' => '{{WRAPPER}} .tabs-content .entry-editor'
461 )
462 );
463
464 $this->add_responsive_control(
465 'content_padding',
466 array(
467 'label' => __( 'Padding', 'auxin-elements' ),
468 'type' => Controls_Manager::DIMENSIONS,
469 'size_units' => array( 'px', 'em', '%' ),
470 'separator' => 'before',
471 'selectors' => array(
472 '{{WRAPPER}} .tabs-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
473 )
474 )
475 );
476
477 $this->add_responsive_control(
478 'content_margin',
479 array(
480 'label' => __( 'Margin', 'auxin-elements' ),
481 'type' => Controls_Manager::DIMENSIONS,
482 'size_units' => array( 'px', 'em' ),
483 'allowed_dimensions' => 'all',
484 'selectors' => array(
485 '{{WRAPPER}} .tabs-content' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
486 )
487 )
488 );
489
490 $this->add_control(
491 'content_border_radius',
492 array(
493 'label' => __( 'Border Radius', 'auxin-elements' ),
494 'type' => Controls_Manager::DIMENSIONS,
495 'size_units' => array( 'px', 'em', '%' ),
496 'selectors' => array(
497 '{{WRAPPER}} .tabs-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow:hidden;'
498 ),
499 'allowed_dimensions' => 'all',
500 'separator' => 'before'
501 )
502 );
503
504 $this->add_group_control(
505 Group_Control_Box_Shadow::get_type(),
506 array(
507 'name' => 'content_shadow',
508 'selector' => '{{WRAPPER}} .tabs-content',
509 'separator' => 'none'
510 )
511 );
512
513 $this->add_group_control(
514 Group_Control_Border::get_type(),
515 array(
516 'name' => 'content_border',
517 'selector' => '{{WRAPPER}} .tabs-content',
518 'separator' => 'none'
519 )
520 );
521
522 $this->add_group_control(
523 Group_Control_Background::get_type(),
524 array(
525 'name' => 'content_background',
526 'selector' => '{{WRAPPER}} .tabs-content',
527 'separator' => 'none'
528 )
529 );
530
531 $this->end_controls_section();
532 }
533
534 /**
535 * Render 'Tabs' widget output on the frontend.
536 *
537 * Written in PHP and used to generate the final HTML.
538 *
539 * @since 1.0.0
540 * @access protected
541 */
542 protected function render() {
543
544 add_filter( 'auxin/core_elements/dynamic_tags/shortcode/should_escape', '__return_false' );
545
546 $settings = $this->get_settings_for_display();
547
548 $args = array(
549 'style' => $settings['skin'],
550 'tabs' => $settings['tab_items'],
551 //'type' => $settings['type'],
552 'tab_id_prefix'=> substr( $this->get_id_int(), 0, 3 )
553 );
554
555 // pass the args through the corresponding shortcode callback
556 echo auxin_widget_tabs_callback( $args );
557
558 add_filter( 'auxin/core_elements/dynamic_tags/shortcode/should_escape', '__return_true' );
559 }
560
561
562 /**
563 * Render tabs element in the editor.
564 *
565 * @access protected
566 */
567 protected function _content_template() {
568 ?>
569 <section class="widget-container aux-widget-tabs">
570 <div class="widget-container widget-tabs {{{ settings.style }}}">
571 <div class="widget-inner">
572 <ul class="tabs">
573 <#
574 if ( settings.tab_items ) {
575 var tabindex = view.getIDInt().toString().substr( 0, 3 );
576
577 _.each( settings.tab_items, function( item, index ) {
578 var tabLabelKey = view.getRepeaterSettingKey( 'tab_label', 'tab_items', index ),
579 IdNumber = tabindex + index + 1;
580
581 view.addRenderAttribute( tabLabelKey, {
582 'id': 'aux-tab-' + IdNumber,
583 'href': '',
584 'tabindex': IdNumber,
585 'role': 'tab',
586 'aria-controls': 'aux-tab-content-' + IdNumber
587 } );
588 #>
589 <li><a {{{ view.getRenderAttributeString( tabLabelKey ) }}}>{{{ item.tab_label }}}</a></li>
590 <#
591 });
592 }
593 #>
594 </ul>
595 <ul class="tabs-content">
596 <#
597 if ( settings.tab_items ) {
598 var tabindex = view.getIDInt().toString().substr( 0, 3 );
599
600 _.each( settings.tab_items, function( item, index ) {
601 var tabContentKey = view.getRepeaterSettingKey( 'content', 'tab_items', index ),
602 IdNumber = tabindex + index + 1;
603
604 view.addRenderAttribute( tabContentKey, {
605 'id': 'aux-tab-content-' + IdNumber,
606 'class': [ 'entry-editor' ],
607 'role': 'tabpanel',
608 'aria-labelledby': 'aux-tab-' + IdNumber
609 } );
610
611 view.addInlineEditingAttributes( tabContentKey, 'advanced' );
612 #>
613 <li>
614 <div {{{ view.getRenderAttributeString( tabContentKey ) }}}>
615 <p>{{{ item.content }}}</p>
616 </div>
617 </li>
618 <#
619 });
620 }
621 #>
622 </ul>
623 </div>
624 </div>
625 </section>
626 <?php
627 }
628
629 }
630