PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 1.0.2
Shortcodes and extra features for Phlox theme v1.0.2
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 / text.php
auxin-elements / includes / elements Last commit date
about-widget.php 9 years ago accordion.php 9 years ago attachment-url.php 9 years ago audio.php 9 years ago button.php 9 years ago code.php 9 years ago contact-box.php 9 years ago contact-form.php 9 years ago divider.php 9 years ago dropcap.php 9 years ago gallery.php 9 years ago gmap.php 9 years ago highlight.php 9 years ago image.php 9 years ago instagram-feed.php 9 years ago latest-items.php 9 years ago latest-posts-slider.php 9 years ago quote.php 9 years ago recent-posts-widget.php 9 years ago recent-posts.php 9 years ago sample-element.php 9 years ago search.php 9 years ago socials-list.php 9 years ago tabs.php 9 years ago text.php 9 years ago video.php 9 years ago
text.php
273 lines
1 <?php
2 /**
3 * Text element
4 *
5 *
6 * @package auxin-elements
7 * @license LICENSE.txt
8 * @author
9 * @link https://bitbucket.org/averta/
10 * @copyright (c) 2010-2016
11 */
12 function auxin_get_text_master_array( $master_array ) {
13
14 $master_array['aux_text'] = array(
15 'name' => __('[Phlox] Text', 'auxin-elements'),
16 'auxin_output_callback' => 'auxin_widget_column_callback',
17 'base' => 'aux_text',
18 'description' => __('Simple text block.', 'auxin-elements'),
19 'class' => 'aux-widget-text',
20 'show_settings_on_create' => true,
21 'weight' => 1,
22 'is_widget' => false,
23 'is_shortcode' => true,
24 'is_so' => true,
25 'is_vc' => true,
26 'category' => THEME_NAME,
27 'group' => '',
28 'admin_enqueue_js' => '',
29 'admin_enqueue_css' => '',
30 'front_enqueue_js' => '',
31 'front_enqueue_css' => '',
32 'icon' => 'auxin-element auxin-text',
33 'custom_markup' => '',
34 'js_view' => '',
35 'html_template' => '',
36 'deprecated' => '',
37 'content_element' => false,
38 'as_parent' => '',
39 'as_child' => '',
40 'params' => array(
41 array(
42 'param_name' => 'title',
43 'type' => 'textfield',
44 'value' => '',
45 'def_value' => '',
46 'holder' => 'textfield',
47 'class' => 'title',
48 'heading' => __('Title','auxin-elements'),
49 'description' => '',
50 'admin_label' => true,
51 'dependency' => '',
52 'weight' => '',
53 'group' => '' ,
54 'edit_field_class' => ''
55 ),
56 array(
57 'param_name' => 'title_link',
58 'type' => 'textfield',
59 'value' => '',
60 'def_value' => '',
61 'holder' => 'textfield',
62 'class' => 'title_link',
63 'heading' => __('Title Link','auxin-elements'),
64 'description' => '',
65 'admin_label' => true,
66 'dependency' => '',
67 'weight' => '',
68 'group' => '' ,
69 'edit_field_class' => ''
70 ),
71 array(
72 'param_name' => 'text_align',
73 'type' => 'aux_visual_select',
74 'def_value' => 'top',
75 'choices' => array(
76 '' => array(
77 'label' => __('Theme Default', 'auxin-elements'),
78 'css_class' => 'axiAdminIcon-default',
79 ),
80 'left' => array(
81 'label' => __('Left', 'auxin-elements'),
82 'css_class' => 'axiAdminIcon-text-align-left',
83 ),
84 'center' => array(
85 'label' => __('Center', 'auxin-elements'),
86 'css_class' => 'axiAdminIcon-text-align-center'
87 ),
88 'right' => array(
89 'label' => __('Center', 'auxin-elements'),
90 'css_class' => 'axiAdminIcon-text-align-right'
91 )
92 ),
93 'holder' => 'dropdown',
94 'class' => 'text_align',
95 'heading' => __('Text Align','auxin-elements'),
96 'description' => '',
97 'admin_label' => true,
98 'dependency' => '',
99 'weight' => '',
100 'group' => '' ,
101 'edit_field_class' => ''
102 ),
103 array(
104 'param_name' => 'icon',
105 'type' => 'iconpicker',
106 'value' => '',
107 'def_value' => '',
108 'holder' => 'textfield',
109 'class' => 'iconpicker',
110 'heading' => __('Icon','auxin-elements'),
111 'description' => __('Please choose an icon from avaialable icons.', 'auxin-elements'),
112 'admin_label' => true,
113 'dependency' => '',
114 'weight' => '',
115 'group' => '' ,
116 'edit_field_class' => ''
117 ),
118 array(
119 'param_name' => 'icon_color',
120 'type' => 'colorpicker',
121 'def_value' => '#888',
122 'value' => '#888',
123 'holder' => '',
124 'class' => 'icon_color',
125 'heading' => __('Icon Color','auxin-elements'),
126 'description' => __('Choose a color for icon.','auxin-elements'),
127 'admin_label' => true,
128 'dependency' => '',
129 'weight' => '',
130 'group' => '' ,
131 'edit_field_class' => ''
132 ),
133 array(
134 'param_name' => 'image',
135 'type' => 'attach_image',
136 'def_value' => '',
137 'value' => '',
138 'holder' => '',
139 'class' => 'image',
140 'heading' => __('Image','auxin-elements'),
141 'description' => '',
142 'admin_label' => true,
143 'dependency' => '',
144 'weight' => '',
145 'group' => '' ,
146 'edit_field_class' => ''
147 ),
148 array(
149 'param_name' => 'image_position',
150 'type' => 'aux_visual_select',
151 'def_value' => 'top',
152 'choices' => array(
153 'top' => array(
154 'label' => __('White Space', 'auxin-elements'),
155 'image' => AUX_URL . 'images/visual-select/column-icon-top.svg'
156 ),
157 'left' => array(
158 'label' => __('Solid', 'auxin-elements'),
159 'image' => AUX_URL . 'images/visual-select/column-icon-left.svg'
160 ),
161 'right' => array(
162 'label' => __('Dashed', 'auxin-elements'),
163 'image' => AUX_URL . 'images/visual-select/column-icon-right.svg'
164 )
165 ),
166 'holder' => 'dropdown',
167 'class' => 'image_position',
168 'heading' => __('Image or icon position','auxin-elements'),
169 'description' => '',
170 'admin_label' => true,
171 'dependency' => '',
172 'weight' => '',
173 'group' => '' ,
174 'edit_field_class' => ''
175 ),
176 array(
177 'param_name' => 'content',
178 'type' => 'textarea_html',
179 'value' => '',
180 'def_value' => '',
181 'holder' => 'div',
182 'class' => 'content',
183 'heading' => __('Content','auxin-elements'),
184 'description' => '',
185 'admin_label' => true,
186 'dependency' => '',
187 'weight' => '',
188 'group' => '' ,
189 'edit_field_class' => ''
190 ),
191 array(
192 'param_name' => 'extra_classes',
193 'type' => 'textfield',
194 'value' => '',
195 'def_value' => '',
196 'holder' => 'textfield',
197 'class' => 'extra_classes',
198 'heading' => __('Extra class name','auxin-elements'),
199 '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'),
200 'admin_label' => true,
201 'dependency' => '',
202 'weight' => '',
203 'group' => '' ,
204 'edit_field_class' => ''
205 )
206 )
207 );
208
209 return $master_array;
210 }
211
212 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_text_master_array', 10, 1 );
213
214 // This is the widget call back in fact the front end out put of this widget comes from this function
215 function auxin_widget_column_callback( $atts, $shortcode_content = null ){
216
217 // Defining default attributes
218 $default_atts = array(
219 'title' => '', // section title
220 'title_link' => '', // the link on title
221 'content' => '', // the link on title
222 'text_align' => '',
223 'icon' => '', // icon on column side
224 'icon_color' => '#888',
225 'image' => '', // image on column side
226 'image_position' => 'top', // top,left,right
227
228 'extra_classes' => '', // custom css class names for this element
229 'custom_el_id' => '', // custom id attribute for this element
230 'base_class' => 'aux-widget-text' // base class name for container
231 );
232
233 $result = auxin_get_widget_scafold( $atts, $default_atts );
234 extract( $result['parsed_atts'] );
235
236 $icon = $icon == 'none' ? '' : $icon;
237 $icon_color = empty( $icon_color ) ? '' : 'style="color:'.$icon_color.' !important;"';
238 $text_align = empty( $text_align ) ? '' : ' aux-text-align-' . $text_align;
239 $content = empty( $content ) ? $shortcode_content : $content;
240
241 if( ! empty( $image ) && is_numeric( $image ) ) {
242 $image = auxin_get_the_resized_attachment( $image );
243 }
244
245 ob_start();
246
247 // widget header ------------------------------
248 echo $result['widget_header'];
249 ?>
250 <div class="aux-shape-<?php echo esc_attr( $image_position ) . $text_align . ' ' . $extra_classes; ?>">
251 <?php if( ! empty( $icon ) && empty( $image ) ) { ?>
252 <span class="aux-col-icon <?php echo $icon; ?>" <?php echo $icon_color; ?> > </span>
253 <?php } elseif( !empty( $image ) ) {
254 echo $image;
255 } if( ! empty( $title ) && empty( $title_link ) ) { ?>
256 <h4 class="col-title"><?php echo $title; ?></h4>
257 <?php } elseif( ! empty( $title ) && ! empty( $title_link ) ) { ?>
258 <h4 class="col-title"><a href="<?php echo $title_link; ?>"><?php echo $title; ?></a></h4>
259 <?php } if( ! empty( $content ) ) { ?>
260 <div class="entry-content">
261 <?php $encoding_flag = defined('ENT_HTML401') ? ENT_HTML401 : ENT_QUOTES; ?>
262 <p><?php echo do_shortcode( html_entity_decode( $content, $encoding_flag, 'UTF-8') ); ?></p>
263 </div>
264 <?php } ?>
265 </div>
266
267 <?php
268 // widget footer ------------------------------
269 echo $result['widget_footer'];
270
271 return ob_get_clean();
272 }
273