PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.5.0
Shortcodes and extra features for Phlox theme v2.5.0
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 / custom-list.php
auxin-elements / includes / elements Last commit date
about-widget.php 6 years ago accordion-widget.php 6 years ago accordion.php 6 years ago attachment-url.php 6 years ago audio.php 6 years ago before-after.php 6 years ago button.php 6 years ago code.php 6 years ago contact-box.php 6 years ago contact-form.php 6 years ago custom-list.php 6 years ago divider.php 6 years ago dropcap.php 6 years ago facebook.php 6 years ago flickr.php 6 years ago gallery.php 6 years ago general-element-fields.php 6 years ago gmap.php 6 years ago highlight.php 6 years ago image.php 6 years ago instagram-feed.php 6 years ago latest-items.php 8 years ago latest-posts-slider.php 6 years ago popular-posts-widget.php 6 years ago quote.php 6 years ago recent-posts-grid-carousel.php 6 years ago recent-posts-land-style.php 6 years ago recent-posts-masonry.php 6 years ago recent-posts-tiles-carousel.php 6 years ago recent-posts-tiles.php 6 years ago recent-posts-timeline.php 6 years ago recent-posts-widget.php 6 years ago recent-products.php 6 years ago related-posts.php 8 years ago sample-element.php 6 years ago search.php 6 years ago socials-list.php 6 years ago staff.php 6 years ago tab-widget.php 6 years ago tabs.php 6 years ago testimonial.php 6 years ago text.php 6 years ago touch-slider.php 6 years ago video.php 6 years ago
custom-list.php
321 lines
1 <?php
2 /**
3 * List element if site origin bundle plugin is activaited
4 *
5 *
6 * @package Auxin
7 * @license LICENSE.txt
8 * @author averta
9 * @link http://phlox.pro/
10 * @copyright (c) 2010-2020 averta
11 */
12
13 function auxin_get_list_master_array( $master_array ) {
14
15 $master_array['aux_icon_list'] = array(
16 'name' => __('List', 'auxin-elements'),
17 'auxin_output_callback' => 'auxin_widget_list_callback',
18 'base' => 'aux_icon_list',
19 'description' => __('Icon List', 'auxin-elements'),
20 'class' => 'aux-widget-icon-list',
21 'show_settings_on_create' => true,
22 'weight' => 1,
23 'is_widget' => false,
24 'is_shortcode' => true,
25 'is_so' => true,
26 'is_vc' => false,
27 'category' => THEME_NAME,
28 'group' => '',
29 'so_api' => true,
30 'admin_enqueue_js' => '',
31 'admin_enqueue_css' => '',
32 'front_enqueue_js' => '',
33 'front_enqueue_css' => '',
34 'icon' => 'aux-element aux-pb-icons-list',
35 'custom_markup' => '',
36 'js_view' => '',
37 'html_template' => '',
38 'deprecated' => '',
39 'content_element' => '',
40 'as_parent' => '',
41 'as_child' => '',
42 'params' => array(
43 array(
44 'heading' => __('Title','auxin-elements'),
45 'description' => __('leave it empty if you don`t need title.', 'auxin-elements'),
46 'param_name' => 'title',
47 'type' => 'textfield',
48 'value' => '',
49 'holder' => 'textfield',
50 'class' => 'title',
51 'admin_label' => false,
52 'dependency' => '',
53 'weight' => '',
54 'group' => '' ,
55 'edit_field_class' => ''
56 ),
57 array(
58 'heading' => __('Text','auxin-elements'),
59 'repeater' => 'list',
60 'repeater-label' => __('List', 'auxin-elements'),
61 'section-name' => __('List Item', 'auxin-elements'),
62 'param_name' => 'text_primary',
63 'type' => 'textfield',
64 'value' => __('List Item', 'auxin-elements' ),
65 'holder' => 'textfield',
66 'class' => 'text_primary',
67 'admin_label' => true,
68 'dependency' => '',
69 'weight' => '',
70 'group' => '' ,
71 'edit_field_class' => ''
72 ),
73 array(
74 'heading' => __('Icon','auxin-elements'),
75 'repeater' => 'list',
76 'repeater-label' => __('List', 'auxin-elements'),
77 'section-name' => __('List Item', 'auxin-elements'),
78 'param_name' => 'icon',
79 'type' => 'aux_iconpicker',
80 'value' => '',
81 'holder' => 'textfield',
82 'class' => 'item_icon',
83 'admin_label' => false,
84 'dependency' => '',
85 'weight' => '',
86 'group' => '' ,
87 'edit_field_class' => ''
88 ),
89 array(
90 'heading' => __('Text Tag','auxin-elements'),
91 'repeater' => 'list',
92 'repeater-label' => __('List', 'auxin-elements'),
93 'section-name' => __('List Item', 'auxin-elements'),
94 'param_name' => 'text_tag',
95 'type' => 'textfield',
96 'value' => __('List Item', 'auxin-elements' ),
97 'holder' => 'textfield',
98 'class' => 'text_tag',
99 'admin_label' => true,
100 'dependency' => '',
101 'weight' => '',
102 'group' => '' ,
103 'edit_field_class' => ''
104 ),
105 array(
106 'heading' => __('Link','auxin-elements'),
107 'repeater' => 'list',
108 'repeater-label' => __('List', 'auxin-elements'),
109 'section-name' => __('List Item', 'auxin-elements'),
110 'param_name' => 'link',
111 'type' => 'textfield',
112 'value' => '',
113 'holder' => 'textfield',
114 'class' => 'link',
115 'admin_label' => false,
116 'dependency' => '',
117 'weight' => '',
118 'group' => '' ,
119 'edit_field_class' => ''
120 ),
121 array(
122 'heading' => __('Text Seconday','auxin-elements'),
123 'repeater' => 'list',
124 'repeater-label' => __('List', 'auxin-elements'),
125 'section-name' => __('List Item', 'auxin-elements'),
126 'param_name' => 'text_secondary',
127 'type' => 'textfield',
128 'value' => '',
129 'holder' => 'textfield',
130 'class' => 'text_secondary',
131 'admin_label' => true,
132 'dependency' => '',
133 'weight' => '',
134 'group' => '' ,
135 'edit_field_class' => ''
136 ),
137 array(
138 'heading' => __('Description','auxin-elements'),
139 'repeater' => 'list',
140 'repeater-label' => __('List', 'auxin-elements'),
141 'section-name' => __('List Item', 'auxin-elements'),
142 'param_name' => 'description',
143 'type' => 'textfield',
144 'value' => '',
145 'holder' => 'textfield',
146 'class' => 'description',
147 'admin_label' => true,
148 'dependency' => '',
149 'weight' => '',
150 'group' => '' ,
151 'edit_field_class' => ''
152 ),
153 array(
154 'heading' => __('Display Connector','auxin-elements' ),
155 'description' => __('Whether to display a line that connects two texts in each list item.', 'auxin-elements'),
156 'param_name' => 'connector',
157 'type' => 'dropdown',
158 'def_value' => 'no',
159 'value' => array(
160 'yes' => __('Yes', 'auxin-elements' ),
161 'no' => __('No' , 'auxin-elements' )
162 ),
163 'holder' => '',
164 'class' => '',
165 'admin_label' => false,
166 'dependency' => '',
167 'weight' => '',
168 'group' => '' ,
169 'edit_field_class' => ''
170 ),
171 array(
172 'heading' => __('Display Divider','auxin-elements' ),
173 'description' => __('Whether to display a divider between list items or not.', 'auxin-elements'),
174 'param_name' => 'divider',
175 'type' => 'dropdown',
176 'def_value' => 'no',
177 'value' => array(
178 'yes' => __('Yes', 'auxin-elements' ),
179 'no' => __('No' , 'auxin-elements' )
180 ),
181 'holder' => '',
182 'class' => '',
183 'admin_label' => false,
184 'dependency' => '',
185 'weight' => '',
186 'group' => '' ,
187 'edit_field_class' => ''
188 ),
189 array(
190 'heading' => __('Extra class name','auxin-elements'),
191 '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.', 'auxin-elements'),
192 'param_name' => 'extra_classes',
193 'type' => 'textfield',
194 'value' => '',
195 'def_value' => '',
196 'holder' => 'textfield',
197 'class' => 'extra_classes',
198 'admin_label' => false,
199 'dependency' => '',
200 'weight' => '',
201 'group' => '' ,
202 'edit_field_class' => ''
203 )
204 )
205 );
206
207 return $master_array;
208 }
209
210 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_list_master_array', 10, 1 );
211
212
213 /**
214 * List Element
215 *
216 * @param array $atts The array containing the parsed values from shortcode, it should be same as defined params above.
217 * @param string $shortcode_content The shorcode content
218 * @return string The output of element markup
219 */
220 function auxin_widget_list_callback( $atts, $shortcode_content = null ){
221
222 // Defining default attributes
223 $default_atts = array(
224 'title' => '', // header title
225 'list' => '', // repeater items
226 'direction' => 'default',
227 'connector' => 'no',
228 'divider' => 'no',
229 'title_tag' => 'h6',
230 'item_class_prefix' => '', // Default class prefix for each repeater item
231 'extra_classes' => '', // custom css class names for this element
232 'custom_el_id' => '', // custom id attribute for this element
233 'base_class' => 'aux-widget-icon-list' // base class name for container
234 );
235
236 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
237 extract( $result['parsed_atts'] );
238
239 // widget header ------------------------------
240 $output = $result['widget_header'];
241 $output .= $result['widget_title'];
242
243 $output .= '<div class="widget-inner">';
244
245 // Attrs for list wrapper
246 $list_attrs = array(
247 'class' => array( 'aux-icon-list-items', 'aux-direction-' . esc_attr( $direction ) )
248 );
249 if( auxin_is_true( $divider ) ){
250 $list_attrs['class'][] = 'aux-icon-list-divider';
251 }
252 $output .= '<ul '. auxin_make_html_attributes( $list_attrs ) .'>';
253
254 // widget custom output -----------------------
255 if ( is_array( $list ) || is_object( $list ) ) {
256 foreach ( $list as $index => $list_item ) {
257
258 // Class for each repeater item
259 $item_classes = array( 'aux-icon-list-item' );
260
261 if( ! empty( $list_item['custom_class_name'] ) ) {
262 $item_classes[] = $list_item['custom_class_name'];
263 }
264
265 if( $item_unique_id = ! empty( $list_item['_id'] ) ? $list_item['_id'] : '' ){
266 $item_classes[] = 'aux-icon-list-item-'. $item_unique_id;
267 $item_classes[] = 'elementor-repeater-item-'. $item_unique_id;
268 }
269
270 $item_text_tag = $list_item['text_tag'];
271
272 $output .= '<li '. auxin_make_html_attributes( array( 'class' => $item_classes ) ) .'>';
273
274 // Generate link for list item
275 if( ! empty( $list_item['link']['url'] ) ){
276 $link_attrs = array(
277 'class' => array( 'aux-icon-list-link' ),
278 'href' => esc_url( $list_item['link']['url'] )
279 );
280 if( ! empty( $list_item['link']['is_external'] ) ){
281 $link_attrs['target'] = '_blank';
282 }
283 if( ! empty( $list_item['link']['nofollow'] ) ){
284 $link_attrs['rel'] = 'nofollow';
285 }
286 $output .= '<a '. auxin_make_html_attributes( $link_attrs ) .'>';
287 }
288
289 // a fix to prevent unwanted default value 'check-1' which is set in elementor
290 if( ! empty( $list_item['icon'] ) && 'check-1' != $list_item['icon'] ){
291 $output .= '<span '. auxin_make_html_attributes( array( 'class' => array( 'aux-icon-list-icon', $list_item['icon'] ) ) ) .'></span>';
292 }
293 if( ! empty( $list_item['text_primary'] ) ){
294 $output .= "<$item_text_tag ". auxin_make_html_attributes( array( 'class' => array( 'aux-icon-list-text' ) ) ) .'>' . $list_item['text_primary'] . "</$item_text_tag>";
295 }
296 if( auxin_is_true( $connector ) ){
297 $output .= '<span '. auxin_make_html_attributes( array( 'class' => array( 'aux-list-connector' ) ) ) .'></span>';
298 }
299 if( ! empty( $list_item['text_secondary'] ) ){
300 $output .= '<span '. auxin_make_html_attributes( array( 'class' => array( 'aux-icon-list-text2' ) ) ) .'>' . $list_item['text_secondary'] . '</span>';
301 }
302 if( ! empty( $list_item['description'] ) ){
303 $output .= '<p '. auxin_make_html_attributes( array( 'class' => array( 'aux-icon-list-description' ) ) ) .'>' . $list_item['description'] . '</p>';
304 }
305
306 if( ! empty( $list_item['link']['url'] ) ){
307 $output .= '</a>';
308 }
309
310 $output .= '</li>';
311 }
312 }
313
314 $output .= '</ul></div>'; // End od widget-toggle
315 $output .= $result['widget_footer'];
316
317 // widget footer ------------------------------
318
319 return $output;
320 }
321