PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.8.1
Shortcodes and extra features for Phlox theme v2.8.1
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 / elements / touch-slider.php
auxin-elements / includes / elements Last commit date
about-widget.php 5 years ago accordion-widget.php 5 years ago accordion.php 5 years ago attachment-url.php 5 years ago audio.php 5 years ago before-after.php 5 years ago button.php 5 years ago code.php 5 years ago contact-box.php 5 years ago contact-form.php 5 years ago custom-list.php 5 years ago divider.php 5 years ago dropcap.php 5 years ago facebook.php 5 years ago flickr.php 5 years ago gallery.php 5 years ago general-element-fields.php 5 years ago gmap.php 5 years ago highlight.php 5 years ago image.php 5 years ago instagram-feed.php 5 years ago latest-items.php 5 years ago latest-posts-slider.php 5 years ago popular-posts-widget.php 5 years ago quote.php 5 years ago recent-posts-grid-carousel.php 5 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-posts-widget.php 5 years ago recent-products.php 5 years ago related-posts.php 8 years ago sample-element.php 5 years ago search.php 5 years ago socials-list.php 5 years ago staff.php 5 years ago tab-widget.php 5 years ago tabs.php 5 years ago testimonial.php 5 years ago text.php 5 years ago touch-slider.php 5 years ago video.php 5 years ago
touch-slider.php
293 lines
1 <?php
2 /**
3 * Touch slider element
4 * You should have 'Master Slider' plugin installed to use this element
5 *
6 *
7 * @package Auxin
8 * @license LICENSE.txt
9 * @author averta
10 * @link http://phlox.pro/
11 * @copyright (c) 2010-2021 averta
12 */
13 function auxin_touch_slider_master_array( $master_array ) {
14
15 $master_array['aux_touch_slider'] = array(
16 'name' => __('Simple Image Slider ', 'auxin-elements' ),
17 'auxin_output_callback' => 'auxin_touch_slider_callback',
18 'base' => 'aux_touch_slider',
19 'description' => __('Responsive image slider with touch swipe feature.', 'auxin-elements' ),
20 'class' => 'aux-widget-touch-slider',
21 'show_settings_on_create' => true,
22 'weight' => 1,
23 'is_widget' => false,
24 'is_shortcode' => true,
25 'is_so' => true,
26 'is_vc' => true,
27 'category' => THEME_NAME,
28 'group' => '',
29 'admin_enqueue_js' => '',
30 'admin_enqueue_css' => '',
31 'front_enqueue_js' => '',
32 'front_enqueue_css' => '',
33 'icon' => 'aux-element aux-pb-icons-image',
34 'custom_markup' => '',
35 'js_view' => '',
36 'html_template' => '',
37 'deprecated' => '',
38 'content_element' => '',
39 'as_parent' => '',
40 'as_child' => '',
41 'params' => array(
42 array(
43 'heading' => __('Title','auxin-elements' ),
44 'description' => __('The slider title, leave it empty if you don`t need title.', 'auxin-elements'),
45 'param_name' => 'title',
46 'type' => 'textfield',
47 'value' => '',
48 'holder' => '',
49 'class' => 'title',
50 'admin_label' => false,
51 'dependency' => '',
52 'weight' => '',
53 'group' => '',
54 'edit_field_class' => ''
55 ),
56 array(
57 'heading' => __('Images','auxin-elements'),
58 'description' => '',
59 'param_name' => 'images',
60 'type' => 'attach_images',
61 'value' => '',
62 'holder' => '',
63 'class' => 'images',
64 'admin_label' => false,
65 'dependency' => '',
66 'weight' => '',
67 'group' => '',
68 'edit_field_class' => ''
69 ),
70 array(
71 'heading' => __('Slider image width','auxin-elements' ),
72 'param_name' => 'width',
73 'type' => 'textfield',
74 'value' => '960',
75 'holder' => '',
76 'class' => '',
77 'admin_label' => false,
78 'dependency' => '',
79 'weight' => '',
80 'group' => '' ,
81 'edit_field_class' => ''
82 ),
83 array(
84 'heading' => __('Slider image height','auxin-elements' ),
85 'param_name' => 'height',
86 'type' => 'textfield',
87 'value' => '560',
88 'holder' => '',
89 'class' => '',
90 'admin_label' => false,
91 'dependency' => '',
92 'weight' => '',
93 'group' => '',
94 'edit_field_class' => ''
95 ),
96 array(
97 'heading' => __('Arrow navigation','auxin-elements' ),
98 'description' => '',
99 'param_name' => 'arrows',
100 'type' => 'aux_switch',
101 'value' => '1',
102 'class' => '',
103 'admin_label' => false,
104 'dependency' => '',
105 'weight' => '',
106 'group' => __( 'Style', 'auxin-elements' ),
107 'edit_field_class' => ''
108 ),
109 array(
110 'heading' => __('Space between slides','auxin-elements' ),
111 'param_name' => 'space',
112 'type' => 'textfield',
113 'value' => '5',
114 'holder' => '',
115 'class' => '',
116 'admin_label' => false,
117 'dependency' => '',
118 'weight' => '',
119 'group' => __( 'Style', 'auxin-elements' ),
120 'edit_field_class' => ''
121 ),
122 array(
123 'heading' => __('Looped navigation','auxin-elements' ),
124 'description' => '',
125 'param_name' => 'loop',
126 'type' => 'aux_switch',
127 'value' => '0',
128 'class' => '',
129 'admin_label' => false,
130 'dependency' => '',
131 'weight' => '',
132 'group' => __( 'Style', 'auxin-elements' ),
133 'edit_field_class' => ''
134 ),
135 array(
136 'heading' => __('Slideshow','auxin-elements' ),
137 'description' => '',
138 'param_name' => 'slideshow',
139 'type' => 'aux_switch',
140 'value' => '0',
141 'class' => '',
142 'admin_label' => true,
143 'dependency' => '',
144 'weight' => '',
145 'group' => __( 'Style', 'auxin-elements' ),
146 'edit_field_class' => ''
147 ),
148 array(
149 'heading' => __('Slideshow delay in seconds','auxin-elements' ),
150 'param_name' => 'slideshow_delay',
151 'type' => 'textfield',
152 'value' => '2',
153 'holder' => '',
154 'class' => '',
155 'admin_label' => false,
156 'dependency' => array(
157 'element' => 'slideshow',
158 'value' => '1'
159 ),
160 'weight' => '',
161 'group' => __( 'Style', 'auxin-elements' ),
162 'edit_field_class' => ''
163 ),
164 array(
165 'heading' => __('Display image title','auxin-elements' ),
166 'description' => '',
167 'param_name' => 'add_title',
168 'type' => 'aux_switch',
169 'value' => '0',
170 'class' => '',
171 'admin_label' => false,
172 'dependency' => '',
173 'weight' => '',
174 'group' => __( 'Style', 'auxin-elements' ),
175 'edit_field_class' => ''
176 ),
177 array(
178 'heading' => __('Display image caption','auxin-elements' ),
179 'description' => '',
180 'param_name' => 'add_caption',
181 'type' => 'aux_switch',
182 'value' => '0',
183 'class' => '',
184 'dependency' => '',
185 'admin_label' => false,
186 'weight' => '',
187 'group' => __( 'Style', 'auxin-elements' ),
188 'edit_field_class' => ''
189 )
190 )
191 );
192
193 return $master_array;
194 }
195
196 add_filter( 'auxin_master_array_shortcodes', 'auxin_touch_slider_master_array', 10, 1 );
197
198 /**
199 * Dynamic element with result in columns
200 * The front-end output of this element is returned by the following function
201 *
202 * @param array $atts The array containing the parsed values from shortcode
203 * containing widget info too
204 * @param string $shortcode_content The shorcode content
205 * @return string The output of element markup
206 */
207 function auxin_touch_slider_callback( $atts, $shortcode_content = null ){
208
209 // Defining default attributes
210 $default_atts = array(
211 'title' => '',
212 'images' => '',
213 'width' => '960',
214 'height' => '560',
215 'loop' => '0',
216 'space' => '5',
217 'slideshow' => '0',
218 'slideshow_delay' => '2',
219 'arrows' => '1',
220 'add_title' => '0',
221 'add_caption' => '0',
222 'skin' => 'aux-light-skin',
223
224 'extra_classes' => '', // custom css class names for this element
225 'custom_el_id' => '', // custom id attribute for this element
226 'base_class' => 'aux-widget-touch-slider aux-widget-post-slider' // base class name for container
227 );
228
229 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
230 extract( $result['parsed_atts'] );
231
232 $attachments = auxin_get_the_resized_images_by_attach_ids( $images, $width , $height, true );
233 if( empty( $attachments ) ){
234 return '';
235 }
236 ob_start();
237
238 // widget header ------------------------------
239 echo $result['widget_header'];
240 echo $result['widget_title'];
241
242 echo '<div class="master-carousel-slider aux-latest-posts-slider aux-no-js '.$skin.'" data-empty-height="'.$height.'" data-navigation="peritem" data-space="'.$space.'" data-auto-height="true" data-delay="'.$slideshow_delay.'" data-loop="'.$loop.'" data-autoplay="' . auxin_is_true( $slideshow ) . '">';
243
244 // widget custom output -----------------------
245
246 foreach ( $attachments as $attachment_id => $attachment ) {
247
248 $slide_image = '';
249 ?>
250 <div class="aux-mc-item" >
251 <div class="aux-slide-media">
252 <div class="aux-media-frame aux-media-image"><?php echo $attachment; ?></div>
253 </div>
254 <?php if( $add_title || $add_caption ) { ?>
255 <section class="aux-info-container">
256 <?php if( $add_title ) { ?>
257 <div class="aux-slide-title">
258 <h3><?php echo auxin_get_trimmed_string( get_the_title( $attachment_id ), 70, '...'); ?></h3>
259 </div>
260 <?php } if ( $add_caption ) { ?>
261 <div class="aux-slide-info">
262 <?php auxin_the_attachment_caption( $attachment_id ); ?>
263 </div>
264 <?php } ?>
265 </section>
266 <?php } ?>
267 </div>
268
269 <?php
270 }
271 if ( $arrows ) {
272 ?>
273 <div class="aux-next-arrow aux-arrow-nav aux-white aux-round aux-hover-slide">
274 <span class="aux-overlay"></span>
275 <span class="aux-svg-arrow aux-medium-right"></span>
276 <span class="aux-hover-arrow aux-svg-arrow aux-medium-right"></span>
277 </div>
278 <div class="aux-prev-arrow aux-arrow-nav aux-white aux-round aux-hover-slide">
279 <span class="aux-overlay"></span>
280 <span class="aux-svg-arrow aux-medium-left"></span>
281 <span class="aux-hover-arrow aux-svg-arrow aux-medium-left"></span>
282 </div>
283 <?php
284 }
285
286 // widget footer ------------------------------
287 echo '</div><!-- aux-col-wrapper -->';
288
289 echo $result['widget_footer'];
290
291 return ob_get_clean();
292 }
293