PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 1.3.1
Shortcodes and extra features for Phlox theme v1.3.1
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 9 years ago accordion-api.php 9 years ago accordion.php 9 years ago attachment-url.php 10 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 facebook.php 9 years ago flickr.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 10 years ago latest-posts-slider.php 9 years ago popular-posts-widget.php 9 years ago quote.php 9 years ago recent-posts-grid-carousel.php 9 years ago recent-posts-land-style.php 9 years ago recent-posts-masonry.php 9 years ago recent-posts-tiles.php 9 years ago recent-posts-timeline.php 9 years ago recent-posts-widget.php 9 years ago recent-posts.php 9 years ago sample-element.php 10 years ago search.php 9 years ago socials-list.php 9 years ago tabs-api.php 9 years ago tabs.php 9 years ago text.php 9 years ago video.php 9 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 'heading' => __('Title','auxin-elements' ),
42 'description' => __('Quote title, leave it empty if you don`t need title.', 'auxin-elements' ),
43 'param_name' => 'title',
44 'type' => 'textfield',
45 'value' => '',
46 'holder' => 'textfield',
47 'class' => 'title',
48 'admin_label' => true,
49 'dependency' => '',
50 'weight' => '',
51 'group' => '' ,
52 'edit_field_class' => ''
53 ),
54 array(
55 'heading' => __('Quote text','auxin-elements' ),
56 'description' => __('Enter a text as a quote.','auxin-elements' ),
57 'param_name' => 'content',
58 'type' => 'textarea_html',
59 'value' => '',
60 'def_value' => '',
61 'holder' => 'div',
62 'class' => 'content',
63 'admin_label' => true,
64 'dependency' => '',
65 'weight' => '',
66 'group' => '' ,
67 'edit_field_class' => ''
68 ),
69 array(
70 'heading' => __('Blockqoute style','auxin-elements' ),
71 'description' => '',
72 'param_name' => 'type',
73 'type' => 'aux_visual_select',
74 'def_value' => 'blockquote-normal',
75 'choices' => array(
76 'quote-normal' => array(
77 'label' => __('Quote Normal', 'auxin-elements'),
78 'image' => AUX_URL . 'images/visual-select/blockquote-normal-1.svg'
79 ),
80 'blockquote-normal' => array(
81 'label' => __('Blockquote Normal', 'auxin-elements'),
82 'image' => AUX_URL . 'images/visual-select/blockquote-normal.svg'
83 ),
84 'blockquote-bordered' => array(
85 'label' => __('Blockquote Bordered', 'auxin-elements'),
86 'image' => AUX_URL . 'images/visual-select/blockquote-bordered.svg'
87 ),
88 'intro-normal' => array(
89 'label' => __('Intro', 'auxin-elements'),
90 'image' => AUX_URL . 'images/visual-select/quote-intro-normal.svg'
91 ),
92 'intro-hero' => array(
93 'label' => __('Intro Hero', 'auxin-elements'),
94 'image' => AUX_URL . 'images/visual-select/quote-intro-hero.svg'
95 ),
96 'intro-splitter' => array(
97 'label' => __('Intro with Splitter', 'auxin-elements'),
98 'image' => AUX_URL . 'images/visual-select/quote-intro-splitter.svg'
99 ),
100 'pullquote-normal' => array(
101 'label' => __('Pullquote Normal', 'auxin-elements'),
102 'image' => AUX_URL . 'images/visual-select/pullquote-normal.svg'
103 ),
104 'pullquote-colorized' => array(
105 'label' => __('Pullquote Colorized', 'auxin-elements'),
106 'image' => AUX_URL . 'images/visual-select/pullquote-colorized.svg'
107 )
108 ),
109 'holder' => 'dropdown',
110 'class' => 'type',
111 'admin_label' => true,
112 'dependency' => '',
113 'weight' => '',
114 'group' => '' ,
115 'edit_field_class' => ''
116 ),
117 array(
118 'heading' => __('Text align','auxin-elements' ),
119 'description' => '',
120 'param_name' => 'text_align',
121 'type' => 'dropdown',
122 'def_value' => 'none',
123 'value' => array(
124 'none' => __('Default', 'auxin-elements' ),
125 'left' => __('Left' , 'auxin-elements' ),
126 'right' => __('Right' , 'auxin-elements' ),
127 'center' => __('Center' , 'auxin-elements' )
128 ),
129 'holder' => 'dropdown',
130 'class' => 'type',
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 'heading' => __('Insert quote symbol', 'auxin-elements'),
158 'description' => '',
159 'param_name' => 'quote_symbol',
160 'type' => 'aux_switch',
161 'def_value' => '',
162 'value' => '1',
163 'holder' => 'dropdown',
164 'class' => 'showheader',
165 'admin_label' => true,
166 'dependency' => '',
167 'weight' => '',
168 'group' => '' ,
169 'edit_field_class' => ''
170 ),
171
172 array(
173 'heading' => __('Extra class name','auxin-elements' ),
174 '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' ),
175 'param_name' => 'extra_classes',
176 'type' => 'textfield',
177 'value' => '',
178 'def_value' => '',
179 'holder' => 'textfield',
180 'class' => 'extra_classes',
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