PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 1.0.2
Shortcodes and extra features for Phlox theme v1.0.2
2.17.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 / quote.php
auxin-elements / includes / elements Last commit date
about-widget.php 10 years ago accordion.php 10 years ago attachment-url.php 10 years ago audio.php 10 years ago button.php 10 years ago code.php 10 years ago contact-box.php 10 years ago contact-form.php 10 years ago divider.php 10 years ago dropcap.php 10 years ago gallery.php 10 years ago gmap.php 10 years ago highlight.php 10 years ago image.php 10 years ago instagram-feed.php 10 years ago latest-items.php 10 years ago latest-posts-slider.php 10 years ago quote.php 10 years ago recent-posts-widget.php 10 years ago recent-posts.php 10 years ago sample-element.php 10 years ago search.php 10 years ago socials-list.php 10 years ago tabs.php 10 years ago text.php 10 years ago video.php 10 years ago
quote.php
304 lines
1 <?php
2 /**
3 * Quote 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_quote_master_array( $master_array ) {
13
14 $master_array['aux_quote'] = array(
15 'name' => __("[Phlox] Quote", 'auxin-elements' ),
16 'auxin_output_callback' => 'auxin_widget_quote_callback',
17 'base' => 'aux_quote',
18 'description' => __('Blockquote and introduction paragraph', 'auxin-elements' ),
19 'class' => 'aux-widget-quote',
20 'show_settings_on_create' => true,
21 'weight' => 1,
22 'category' => THEME_NAME,
23 'is_so' => true,
24 'is_widget' => true,
25 'is_shortcode' => true,
26 'group' => '',
27 'admin_enqueue_js' => '',
28 'admin_enqueue_css' => '',
29 'front_enqueue_js' => '',
30 'front_enqueue_css' => '',
31 'icon' => 'auxin-element auxin-quote',
32 'custom_markup' => '',
33 'js_view' => '',
34 'html_template' => '',
35 'deprecated' => '',
36 'content_element' => '',
37 'as_parent' => '',
38 'as_child' => '',
39 'params' => array(
40 array(
41 'param_name' => 'title',
42 'type' => 'textfield',
43 'value' => '',
44 'holder' => 'textfield',
45 'class' => 'title',
46 'heading' => __('Title','auxin-elements' ),
47 'description' => __('Quote title, leave it empty if you don`t need title.', 'auxin-elements' ),
48 'admin_label' => true,
49 'dependency' => '',
50 'weight' => '',
51 'group' => '' ,
52 'edit_field_class' => ''
53 ),
54 array(
55 'param_name' => 'content',
56 'type' => 'textarea_html',
57 'value' => '',
58 'def_value' => '',
59 'holder' => 'div',
60 'class' => 'content',
61 'heading' => __('Quote text','auxin-elements' ),
62 'description' => '',
63 'admin_label' => true,
64 'dependency' => '',
65 'weight' => '',
66 'group' => '' ,
67 'edit_field_class' => ''
68 ),
69 array(
70 'param_name' => 'type',
71 'type' => 'aux_visual_select',
72 'def_value' => 'blockquote-normal',
73 'choices' => array(
74 'quote-normal' => array(
75 'label' => __('Quote Normal', 'auxin-elements'),
76 'image' => AUX_URL . 'images/visual-select/blockquote-normal-1.svg'
77 ),
78 'blockquote-normal' => array(
79 'label' => __('Blockquote Normal', 'auxin-elements'),
80 'image' => AUX_URL . 'images/visual-select/blockquote-normal.svg'
81 ),
82 'blockquote-bordered' => array(
83 'label' => __('Blockquote Bordered', 'auxin-elements'),
84 'image' => AUX_URL . 'images/visual-select/blockquote-bordered.svg'
85 ),
86 'intro-normal' => array(
87 'label' => __('Intro', 'auxin-elements'),
88 'image' => AUX_URL . 'images/visual-select/quote-intro-normal.svg'
89 ),
90 'intro-hero' => array(
91 'label' => __('Intro Hero', 'auxin-elements'),
92 'image' => AUX_URL . 'images/visual-select/quote-intro-hero.svg'
93 ),
94 'intro-splitter' => array(
95 'label' => __('Intro with Splitter', 'auxin-elements'),
96 'image' => AUX_URL . 'images/visual-select/quote-intro-splitter.svg'
97 ),
98 'pullquote-normal' => array(
99 'label' => __('Pullquote Normal', 'auxin-elements'),
100 'image' => AUX_URL . 'images/visual-select/pullquote-normal.svg'
101 ),
102 'pullquote-colorized' => array(
103 'label' => __('Pullquote Colorized', 'auxin-elements'),
104 'image' => AUX_URL . 'images/visual-select/pullquote-colorized.svg'
105 )
106 ),
107 'holder' => 'dropdown',
108 'class' => 'type',
109 'heading' => __('Blockqoute Style','auxin-elements' ),
110 'description' => '',
111 'admin_label' => true,
112 'dependency' => '',
113 'weight' => '',
114 'group' => '' ,
115 'edit_field_class' => ''
116 ),
117 array(
118 'param_name' => 'text_align',
119 'type' => 'dropdown',
120 'def_value' => 'none',
121 'value' => array(
122 'none' => __('Default', 'auxin-elements' ),
123 'left' => __('Left' , 'auxin-elements' ),
124 'right' => __('Right' , 'auxin-elements' ),
125 'center' => __('Center' , 'auxin-elements' )
126 ),
127 'holder' => 'dropdown',
128 'class' => 'type',
129 'heading' => __('Text align','auxin-elements' ),
130 'description' => '',
131 'admin_label' => true,
132 'dependency' => '',
133 'weight' => '',
134 'group' => '' ,
135 'edit_field_class' => ''
136 ),
137 // array(
138 // 'param_name' => 'float',
139 // 'type' => 'dropdown',
140 // 'def_value' => 'none',
141 // 'value' => array(
142 // 'none' => __('Default', 'auxin-elements' ),
143 // 'left' =>__('Left' , 'auxin-elements' ),
144 // 'right' => __('Right' , 'auxin-elements' )
145 // ),
146 // 'holder' => 'dropdown',
147 // 'class' => 'type',
148 // 'heading' => __('Block alignment','auxin-elements' ),
149 // 'description' => '',
150 // 'admin_label' => true,
151 // 'dependency' => '',
152 // 'weight' => '',
153 // 'group' => '' ,
154 // 'edit_field_class' => ''
155 // ),
156 array(
157 'param_name' => 'quote_symbol',
158 'type' => 'aux_switch',
159 'def_value' => '',
160 'value' => '1',
161 'holder' => 'dropdown',
162 'class' => 'showheader',
163 'heading' => __('Insert quote symbol', 'auxin-elements'),
164 'description' => '',
165 'admin_label' => true,
166 'dependency' => '',
167 'weight' => '',
168 'group' => '' ,
169 'edit_field_class' => ''
170 ),
171
172 array(
173 'param_name' => 'extra_classes',
174 'type' => 'textfield',
175 'value' => '',
176 'def_value' => '',
177 'holder' => 'textfield',
178 'class' => 'extra_classes',
179 'heading' => __('Extra class name','auxin-elements' ),
180 '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' ),
181 'admin_label' => true,
182 'dependency' => '',
183 'weight' => '',
184 'group' => '' ,
185 'edit_field_class' => ''
186 )
187 )
188 );
189
190 return $master_array;
191 }
192
193 add_filter( 'auxin_master_array_shortcodes', 'auxin_get_quote_master_array', 10, 1 );
194
195 function auxin_widget_quote_callback( $atts, $shortcode_content = null ){
196
197 /**
198 * type:
199 * intro-hero
200 * intro-normal
201 * intro-splitter
202 *
203 * pullquote-normal
204 * pullquote-colorized
205 *
206 * quote-normal
207 * quote-big
208 *
209 * blockquote-normal
210 * blockquote-bordered
211 *
212 * text-align:
213 * center
214 * right
215 * left
216 *
217 * float:
218 * none
219 * left
220 * right
221 */
222
223 // Defining default attributes
224 $default_atts = array(
225 'title' => '', // header title
226 'content' => '',
227
228 'indent' => '', // custom values: yes, no
229 'type' => 'blockquote-normal',
230 'text_align' => '',
231 'float' => '',
232 'quote_symbol' => '1',
233
234 'extra_classes' => '', // custom css class names for this element
235 'custom_el_id' => '', // custom id attribute for this element
236 'base_class' => 'aux-widget-quote' // base class name for container
237 );
238
239 $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content );
240 extract( $result['parsed_atts'] );
241
242 ob_start();
243
244 // widget header ------------------------------
245 echo $result['widget_header'];
246 echo $result['widget_title'];
247
248 // widget custom output -----------------------
249
250 $classes_list = array( 'aux-elem-quote' );
251
252 $classes_list[] = 'aux-' . $type;
253
254 if( ! empty( $text_align ) && 'none'!== $text_align ){
255 $classes_list[] = 'aux-text-align-' . $text_align;
256 }
257
258 if( ! empty( $float ) ){
259 $classes_list[] = 'aux-float-' . $float;
260 }
261
262 if( $quote_symbol ){
263 $classes_list[] = 'aux-quote-letter';
264 }
265
266 if( !empty($extra_classes) ){
267 $classes_list[] = $extra_classes;
268 }
269
270
271 $classes = implode( ' ', $classes_list );
272 $shortcode_content = auxin_do_cleanup_shortcode( $shortcode_content );
273 $shortcode_content = empty( $shortcode_content ) ? auxin_do_cleanup_shortcode( $content ) : $shortcode_content;
274
275 switch ( $type ) {
276 case 'intro-hero':
277 case 'intro-normal':
278 case 'intro-splitter':
279 echo sprintf( '<p class="%s">%s</p>', $classes, $shortcode_content );
280 break;
281
282 case 'pullquote-normal':
283 case 'pullquote-colorized':
284 echo sprintf( '<blockquote class="%s"><p>%s</p></blockquote>', $classes, $shortcode_content );
285 break;
286
287 case 'quote-normal':
288 case 'quote-big':
289 echo sprintf( '<blockquote class="%s"><p>%s</p></blockquote>', $classes, $shortcode_content );
290 break;
291
292 case 'blockquote-normal':
293 case 'blockquote-bordered':
294 default:
295 echo sprintf( '<blockquote class="%s"><p>%s</p></blockquote>', $classes, $shortcode_content );
296 break;
297 }
298
299 // widget footer ------------------------------
300 echo $result['widget_footer'];
301
302 return ob_get_clean();
303 }
304