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