PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.17.4
Shortcodes and extra features for Phlox theme v2.17.4
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 / touch-slider.php
auxin-elements / includes / elementor / widgets Last commit date
theme-elements 1 year ago accordion.php 1 year ago audio.php 4 years ago before-after.php 3 years ago button.php 1 year ago carousel-navigation.php 4 years ago circle-chart.php 1 year ago contact-box.php 4 years ago contact-form.php 1 year ago custom-list.php 1 year ago divider.php 4 years ago gallery.php 1 year ago gmap.php 4 years ago heading-modern.php 1 year ago icon.php 1 year ago image.php 1 year ago mailchimp.php 1 year ago modern-button.php 1 year ago products-grid.php 1 year ago quote.php 1 year ago recent-comments.php 1 year ago recent-posts-grid-carousel.php 1 year ago recent-posts-land-style.php 1 year ago recent-posts-masonry.php 1 year ago recent-posts-tiles-carousel.php 1 year ago recent-posts-tiles.php 1 year ago recent-posts-timeline.php 1 year ago recent-products.php 1 year ago responsive-table.php 1 year ago search.php 4 years ago staff.php 1 year ago svg.php 1 year ago tabs.php 1 year ago testimonial.php 1 year ago text.php 1 year ago touch-slider.php 1 year ago video.php 4 years ago
touch-slider.php
486 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\Kits\Documents\Tabs\Global_Typography;
9
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly.
13 }
14
15 /**
16 * Elementor 'TouchSlider' widget.
17 *
18 * Elementor widget that displays an 'TouchSlider' with lightbox.
19 *
20 * @since 1.0.0
21 */
22 class TouchSlider extends Widget_Base {
23
24 /**
25 * Get widget name.
26 *
27 * Retrieve 'TouchSlider' widget name.
28 *
29 * @since 1.0.0
30 * @access public
31 *
32 * @return string Widget name.
33 */
34 public function get_name() {
35 return 'aux_touch_slider';
36 }
37
38 /**
39 * Get widget title.
40 *
41 * Retrieve 'TouchSlider' widget title.
42 *
43 * @since 1.0.0
44 * @access public
45 *
46 * @return string Widget title.
47 */
48 public function get_title() {
49 return __( 'Simple Image Slider', 'auxin-elements' );
50 }
51
52 /**
53 * Get widget icon.
54 *
55 * Retrieve 'TouchSlider' widget icon.
56 *
57 * @since 1.0.0
58 * @access public
59 *
60 * @return string Widget icon.
61 */
62 public function get_icon() {
63 return 'eicon-slider-device auxin-badge';
64 }
65
66 /**
67 * Get widget categories.
68 *
69 * Retrieve 'TouchSlider' widget icon.
70 *
71 * @since 1.0.0
72 * @access public
73 *
74 * @return string Widget icon.
75 */
76 public function get_categories() {
77 return array( 'auxin-core' );
78 }
79
80
81 /**
82 * Register 'TouchSlider' widget controls.
83 *
84 * Adds different input fields to allow the user to change and customize the widget settings.
85 *
86 * @since 1.0.0
87 * @access protected
88 */
89 protected function register_controls() {
90
91 /*-----------------------------------------------------------------------------------*/
92 /* images_section
93 /*-----------------------------------------------------------------------------------*/
94
95 $this->start_controls_section(
96 'images_section',
97 array(
98 'label' => __('Images', 'auxin-elements' )
99 )
100 );
101
102 $this->add_control(
103 'images',
104 array(
105 'label' => __( 'Add Images', 'auxin-elements' ),
106 'type' => Controls_Manager::GALLERY,
107 'show_label' => false,
108 )
109 );
110
111 $this->end_controls_section();
112
113 /*-----------------------------------------------------------------------------------*/
114 /* display_section
115 /*-----------------------------------------------------------------------------------*/
116
117 $this->start_controls_section(
118 'display_section',
119 array(
120 'label' => __('Display', 'auxin-elements' )
121 )
122 );
123
124 $this->add_control(
125 'arrows',
126 array(
127 'label' => __('Arrow navigation','auxin-elements' ),
128 'type' => Controls_Manager::SWITCHER,
129 'label_on' => __( 'On', 'auxin-elements' ),
130 'label_off' => __( 'Off', 'auxin-elements' ),
131 'return_value' => 'yes',
132 'default' => 'yes'
133 )
134 );
135
136
137 $this->add_control(
138 'loop',
139 array(
140 'label' => __('Loop navigation','auxin-elements' ),
141 'type' => Controls_Manager::SWITCHER,
142 'label_on' => __( 'On', 'auxin-elements' ),
143 'label_off' => __( 'Off', 'auxin-elements' ),
144 'return_value' => 'yes',
145 'default' => 'yes'
146 )
147 );
148
149 $this->add_control(
150 'slideshow',
151 array(
152 'label' => __('Slideshow','auxin-elements' ),
153 'type' => Controls_Manager::SWITCHER,
154 'label_on' => __( 'On', 'auxin-elements' ),
155 'label_off' => __( 'Off', 'auxin-elements' ),
156 'return_value' => 'yes',
157 'default' => 'no'
158 )
159 );
160
161 $this->add_control(
162 'slideshow_delay',
163 array(
164 'label' => __( 'Autoplay delay', 'auxin-elements' ),
165 'description' => __('Specifies the delay between auto-forwarding in seconds.', 'auxin-elements' ),
166 'type' => Controls_Manager::NUMBER,
167 'default' => '2',
168 'condition' => array(
169 'slideshow' => 'yes',
170 )
171 )
172 );
173
174 $this->add_control(
175 'add_title',
176 array(
177 'label' => __('Display image title','auxin-elements' ),
178 'type' => Controls_Manager::SWITCHER,
179 'label_on' => __( 'On', 'auxin-elements' ),
180 'label_off' => __( 'Off', 'auxin-elements' ),
181 'return_value' => 'yes',
182 'default' => 'yes'
183 )
184 );
185
186 $this->add_control(
187 'add_caption',
188 array(
189 'label' => __('Display image caption','auxin-elements' ),
190 'type' => Controls_Manager::SWITCHER,
191 'label_on' => __( 'On', 'auxin-elements' ),
192 'label_off' => __( 'Off', 'auxin-elements' ),
193 'return_value' => 'yes',
194 'default' => 'yes'
195 )
196 );
197
198 $this->end_controls_section();
199
200 /*-----------------------------------------------------------------------------------*/
201 /* slides_section
202 /*-----------------------------------------------------------------------------------*/
203
204 $this->start_controls_section(
205 'slides_section',
206 array(
207 'label' => __('Slides', 'auxin-elements' ),
208 'tab' => Controls_Manager::TAB_STYLE
209 )
210 );
211
212 $this->add_control(
213 'width',
214 array(
215 'label' => __('Slider image width','auxin-elements' ),
216 'type' => Controls_Manager::SLIDER,
217 'size_units' => array('px'),
218 'range' => array(
219 'px' => array(
220 'min' => 1,
221 'max' => 2000,
222 'step' => 1
223 )
224 ),
225 'default' => array(
226 'unit' => 'px',
227 'size' => 960
228 )
229 )
230 );
231
232 $this->add_control(
233 'height',
234 array(
235 'label' => __('Slider image height','auxin-elements' ),
236 'type' => Controls_Manager::SLIDER,
237 'size_units' => array('px'),
238 'range' => array(
239 'px' => array(
240 'min' => 1,
241 'max' => 2000,
242 'step' => 1
243 )
244 ),
245 'default' => array(
246 'unit' => 'px',
247 'size' => 560
248 )
249 )
250 );
251
252 $this->add_control(
253 'space',
254 array(
255 'label' => __('Space between slides','auxin-elements' ),
256 'type' => Controls_Manager::SLIDER,
257 'size_units' => array('px'),
258 'range' => array(
259 'px' => array(
260 'min' => 1,
261 'max' => 200,
262 'step' => 1
263 )
264 ),
265 'default' => array(
266 'unit' => 'px',
267 'size' => 0
268 )
269 )
270 );
271
272 $this->end_controls_section();
273
274 /*-----------------------------------------------------------------------------------*/
275 /* info_section
276 /*-----------------------------------------------------------------------------------*/
277
278 $this->start_controls_section(
279 'info_section',
280 array(
281 'label' => __('Info Container', 'auxin-elements' ),
282 'tab' => Controls_Manager::TAB_STYLE,
283 'conditions' => array(
284 'relation' => 'or',
285 'terms' => array(
286 array(
287 'name' => 'add_title',
288 'operator' => '===',
289 'value' => 'yes',
290 ), array(
291 'name' => 'add_caption',
292 'operator' => '===',
293 'value' => 'yes',
294 ),
295 ),
296 ),
297 )
298 );
299
300 $this->add_control(
301 'info_color',
302 array(
303 'label' => __( 'Background Color', 'auxin-elements' ),
304 'type' => Controls_Manager::COLOR,
305 'selectors' => array(
306 '{{WRAPPER}} .aux-info-container' => 'background: {{VALUE}};',
307 )
308 )
309 );
310
311 $this->add_responsive_control(
312 'info_padding',
313 array(
314 'label' => __( 'Padding', 'auxin-elements' ),
315 'type' => Controls_Manager::DIMENSIONS,
316 'size_units' => array( 'px', '%' ),
317 'selectors' => array(
318 '{{WRAPPER}} .aux-info-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
319 )
320 )
321 );
322
323 $this->end_controls_section();
324
325 /*-----------------------------------------------------------------------------------*/
326 /* title_section
327 /*-----------------------------------------------------------------------------------*/
328
329 $this->start_controls_section(
330 'title_section',
331 array(
332 'label' => __('Title', 'auxin-elements' ),
333 'tab' => Controls_Manager::TAB_STYLE,
334 'condition' => array(
335 'add_title' => 'yes',
336 )
337 )
338 );
339
340 $this->add_control(
341 'title_color',
342 array(
343 'label' => __( 'Color', 'auxin-elements' ),
344 'type' => Controls_Manager::COLOR,
345 'selectors' => array(
346 '{{WRAPPER}} .aux-slide-title h3' => 'color: {{VALUE}};',
347 ),
348 'condition' => array(
349 'add_title' => 'yes',
350 )
351 )
352 );
353
354 $this->add_group_control(
355 Group_Control_Typography::get_type(),
356 array(
357 'name' => 'title_typography',
358 'global' => [
359 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
360 ],
361 'selector' => '{{WRAPPER}} .aux-slide-title h3',
362 'condition' => array(
363 'add_title' => 'yes',
364 )
365 )
366 );
367
368 $this->add_responsive_control(
369 'title_padding',
370 array(
371 'label' => __( 'Padding', 'auxin-elements' ),
372 'type' => Controls_Manager::DIMENSIONS,
373 'size_units' => array( 'px', '%' ),
374 'selectors' => array(
375 '{{WRAPPER}} .aux-slide-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
376 ),
377 'condition' => array(
378 'add_title' => 'yes',
379 )
380 )
381 );
382
383 $this->end_controls_section();
384
385 /*-----------------------------------------------------------------------------------*/
386 /* caption_section
387 /*-----------------------------------------------------------------------------------*/
388
389 $this->start_controls_section(
390 'caption_section',
391 array(
392 'label' => __('Caption', 'auxin-elements' ),
393 'tab' => Controls_Manager::TAB_STYLE,
394 'condition' => array(
395 'add_caption' => 'yes',
396 )
397 )
398 );
399
400 $this->add_control(
401 'caption_color',
402 array(
403 'label' => __( 'Color', 'auxin-elements' ),
404 'type' => Controls_Manager::COLOR,
405 'selectors' => array(
406 '{{WRAPPER}} .aux-slide-info' => 'color: {{VALUE}};',
407 ),
408 'condition' => array(
409 'add_caption' => 'yes',
410 )
411 )
412 );
413
414 $this->add_group_control(
415 Group_Control_Typography::get_type(),
416 array(
417 'name' => 'caption_typography',
418 'global' => [
419 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
420 ],
421 'selector' => '{{WRAPPER}} .aux-slide-info',
422 'condition' => array(
423 'add_caption' => 'yes',
424 )
425 )
426 );
427
428 $this->add_responsive_control(
429 'caption_padding',
430 array(
431 'label' => __( 'Padding', 'auxin-elements' ),
432 'type' => Controls_Manager::DIMENSIONS,
433 'size_units' => array( 'px', '%' ),
434 'selectors' => array(
435 '{{WRAPPER}} .aux-slide-info' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
436 ),
437 'condition' => array(
438 'add_caption' => 'yes',
439 )
440 )
441 );
442
443 $this->end_controls_section();
444 }
445
446 /**
447 * Render image box widget output on the frontend.
448 *
449 * Written in PHP and used to generate the final HTML.
450 *
451 * @since 1.0.0
452 * @access protected
453 */
454 protected function render() {
455
456 $settings = $this->get_settings_for_display();
457
458 if ( ! $settings['images'] ) {
459 return;
460 }
461
462 $ids = wp_list_pluck( $settings['images'], 'id' );
463 $args = array(
464 // images_section
465 'images' => $ids,
466
467 // display_section
468 'arrows' => $settings['arrows'],
469 'loop' => $settings['loop'],
470 'slideshow' => $settings['slideshow'],
471 'slideshow_delay' => $settings['slideshow_delay'],
472 'add_title' => $settings['add_title'],
473 'add_caption' => $settings['add_caption'],
474
475 // slides_section
476 'width' => $settings['width']['size'],
477 'height' => $settings['height']['size'],
478 'space' => $settings['space']['size'],
479 );
480
481 // get the shortcode base blog page
482 echo auxin_touch_slider_callback( $args );
483 }
484
485 }
486