about-widget.php
5 months ago
accordion-widget.php
1 month ago
accordion.php
5 months ago
attachment-url.php
5 months ago
audio.php
5 months ago
before-after.php
5 months ago
button.php
5 months ago
code.php
5 months ago
contact-box.php
5 months ago
contact-form.php
5 months ago
custom-list.php
5 months ago
divider.php
5 months ago
dropcap.php
5 months ago
facebook.php
5 months ago
flickr.php
5 months ago
gallery.php
5 months ago
gmap.php
5 months ago
highlight.php
5 months ago
image.php
5 months ago
instagram-feed.php
5 months ago
latest-posts-slider.php
5 months ago
popular-posts-widget.php
5 months ago
products-grid.php
5 months ago
quote.php
5 months ago
recent-posts-grid-carousel.php
5 months ago
recent-posts-land-style.php
5 months ago
recent-posts-masonry.php
5 months ago
recent-posts-tiles-carousel.php
5 months ago
recent-posts-tiles.php
5 months ago
recent-posts-timeline.php
5 months ago
recent-posts-widget.php
5 months ago
recent-products.php
5 months ago
related-posts.php
8 years ago
sample-element.php
5 months ago
search.php
5 months ago
socials-list.php
5 months ago
staff.php
5 months ago
tab-widget.php
5 months ago
tabs.php
5 months ago
testimonial.php
5 months ago
text.php
5 months ago
touch-slider.php
5 months ago
video.php
5 months ago
quote.php
286 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Quote element |
| 4 | * |
| 5 | * |
| 6 | * @package Auxin |
| 7 | * @license LICENSE.txt |
| 8 | * @author averta |
| 9 | * @link http://phlox.pro/ |
| 10 | * @copyright (c) 2010-2026 averta |
| 11 | */ |
| 12 | function auxin_get_quote_master_array( $master_array ) { |
| 13 | |
| 14 | $master_array['aux_quote'] = array( |
| 15 | 'name' => __("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_widget' => true, |
| 24 | 'is_shortcode' => true, |
| 25 | 'group' => '', |
| 26 | 'admin_enqueue_js' => '', |
| 27 | 'admin_enqueue_css' => '', |
| 28 | 'front_enqueue_js' => '', |
| 29 | 'front_enqueue_css' => '', |
| 30 | 'icon' => 'aux-element aux-pb-icons-quote', |
| 31 | 'custom_markup' => '', |
| 32 | 'js_view' => '', |
| 33 | 'html_template' => '', |
| 34 | 'deprecated' => '', |
| 35 | 'content_element' => '', |
| 36 | 'as_parent' => '', |
| 37 | 'as_child' => '', |
| 38 | 'params' => array( |
| 39 | array( |
| 40 | 'heading' => __('Quote text','auxin-elements' ), |
| 41 | 'description' => __('Enter a text as a quote.','auxin-elements' ), |
| 42 | 'param_name' => 'content', |
| 43 | 'type' => 'textarea_html', |
| 44 | 'value' => '', |
| 45 | 'holder' => '', |
| 46 | 'class' => 'content', |
| 47 | 'admin_label' => false, |
| 48 | 'dependency' => '', |
| 49 | 'weight' => '', |
| 50 | 'group' => '' , |
| 51 | 'edit_field_class' => '' |
| 52 | ), |
| 53 | array( |
| 54 | 'heading' => __('Blockqoute style','auxin-elements' ), |
| 55 | 'description' => '', |
| 56 | 'param_name' => 'type', |
| 57 | 'type' => 'aux_visual_select', |
| 58 | 'def_value' => 'blockquote-normal', |
| 59 | 'choices' => array( |
| 60 | 'quote-normal' => array( |
| 61 | 'label' => __('Quote Normal', 'auxin-elements'), |
| 62 | 'image' => AUXIN_URL . 'images/visual-select/blockquote-normal-1.svg' |
| 63 | ), |
| 64 | 'blockquote-normal' => array( |
| 65 | 'label' => __('Blockquote Normal', 'auxin-elements'), |
| 66 | 'image' => AUXIN_URL . 'images/visual-select/blockquote-normal.svg' |
| 67 | ), |
| 68 | 'blockquote-bordered' => array( |
| 69 | 'label' => __('Blockquote Bordered', 'auxin-elements'), |
| 70 | 'image' => AUXIN_URL . 'images/visual-select/blockquote-bordered.svg' |
| 71 | ), |
| 72 | 'intro-normal' => array( |
| 73 | 'label' => __('Intro', 'auxin-elements'), |
| 74 | 'image' => AUXIN_URL . 'images/visual-select/quote-intro-normal.svg' |
| 75 | ), |
| 76 | 'intro-hero' => array( |
| 77 | 'label' => __('Intro Hero', 'auxin-elements'), |
| 78 | 'image' => AUXIN_URL . 'images/visual-select/quote-intro-hero.svg' |
| 79 | ), |
| 80 | 'intro-splitter' => array( |
| 81 | 'label' => __('Intro with Splitter', 'auxin-elements'), |
| 82 | 'image' => AUXIN_URL . 'images/visual-select/quote-intro-splitter.svg' |
| 83 | ), |
| 84 | 'pullquote-normal' => array( |
| 85 | 'label' => __('Pullquote Normal', 'auxin-elements'), |
| 86 | 'image' => AUXIN_URL . 'images/visual-select/pullquote-normal.svg' |
| 87 | ), |
| 88 | 'pullquote-colorized' => array( |
| 89 | 'label' => __('Pullquote Colorized', 'auxin-elements'), |
| 90 | 'image' => AUXIN_URL . 'images/visual-select/pullquote-colorized.svg' |
| 91 | ) |
| 92 | ), |
| 93 | 'holder' => '', |
| 94 | 'class' => 'type', |
| 95 | 'admin_label' => true, |
| 96 | 'dependency' => '', |
| 97 | 'weight' => '', |
| 98 | 'group' => '' , |
| 99 | 'edit_field_class' => '' |
| 100 | ), |
| 101 | array( |
| 102 | 'heading' => __('Text alignment','auxin-elements' ), |
| 103 | 'description' => '', |
| 104 | 'param_name' => 'text_align', |
| 105 | 'type' => 'dropdown', |
| 106 | 'def_value' => 'none', |
| 107 | 'value' => array( |
| 108 | 'none' => __('Default', 'auxin-elements' ), |
| 109 | 'left' => __('Left' , 'auxin-elements' ), |
| 110 | 'right' => __('Right' , 'auxin-elements' ), |
| 111 | 'center' => __('Center' , 'auxin-elements' ) |
| 112 | ), |
| 113 | 'holder' => '', |
| 114 | 'class' => 'type', |
| 115 | 'admin_label' => false, |
| 116 | 'dependency' => '', |
| 117 | 'weight' => '', |
| 118 | 'group' => '' , |
| 119 | 'edit_field_class' => '' |
| 120 | ), |
| 121 | // array( |
| 122 | // 'param_name' => 'float', |
| 123 | // 'type' => 'dropdown', |
| 124 | // 'def_value' => 'none', |
| 125 | // 'value' => array( |
| 126 | // 'none' => __('Default', 'auxin-elements' ), |
| 127 | // 'left' =>__('Left' , 'auxin-elements' ), |
| 128 | // 'right' => __('Right' , 'auxin-elements' ) |
| 129 | // ), |
| 130 | // 'holder' => 'dropdown', |
| 131 | // 'class' => 'type', |
| 132 | // 'heading' => __('Block alignment','auxin-elements' ), |
| 133 | // 'description' => '', |
| 134 | // 'admin_label' => true, |
| 135 | // 'dependency' => '', |
| 136 | // 'weight' => '', |
| 137 | // 'group' => '' , |
| 138 | // 'edit_field_class' => '' |
| 139 | // ), |
| 140 | array( |
| 141 | 'heading' => __('Insert quote symbol', 'auxin-elements'), |
| 142 | 'description' => '', |
| 143 | 'param_name' => 'quote_symbol', |
| 144 | 'type' => 'aux_switch', |
| 145 | 'value' => '1', |
| 146 | 'holder' => '', |
| 147 | 'class' => 'showheader', |
| 148 | 'admin_label' => false, |
| 149 | 'dependency' => '', |
| 150 | 'weight' => '', |
| 151 | 'group' => '' , |
| 152 | 'edit_field_class' => '' |
| 153 | ), |
| 154 | array( |
| 155 | 'heading' => __('Extra class name','auxin-elements' ), |
| 156 | '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' ), |
| 157 | 'param_name' => 'extra_classes', |
| 158 | 'type' => 'textfield', |
| 159 | 'value' => '', |
| 160 | 'def_value' => '', |
| 161 | 'holder' => '', |
| 162 | 'class' => 'extra_classes', |
| 163 | 'admin_label' => false, |
| 164 | 'dependency' => '', |
| 165 | 'weight' => '', |
| 166 | 'group' => '' , |
| 167 | 'edit_field_class' => '' |
| 168 | ) |
| 169 | |
| 170 | ) |
| 171 | ); |
| 172 | |
| 173 | return $master_array; |
| 174 | } |
| 175 | |
| 176 | add_filter( 'auxin_master_array_shortcodes', 'auxin_get_quote_master_array', 10, 1 ); |
| 177 | |
| 178 | function auxin_widget_quote_callback( $atts, $shortcode_content = null ){ |
| 179 | |
| 180 | /** |
| 181 | * type: |
| 182 | * intro-hero |
| 183 | * intro-normal |
| 184 | * intro-splitter |
| 185 | * |
| 186 | * pullquote-normal |
| 187 | * pullquote-colorized |
| 188 | * |
| 189 | * quote-normal |
| 190 | * quote-big |
| 191 | * |
| 192 | * blockquote-normal |
| 193 | * blockquote-bordered |
| 194 | * |
| 195 | * text-align: |
| 196 | * center |
| 197 | * right |
| 198 | * left |
| 199 | * |
| 200 | * float: |
| 201 | * none |
| 202 | * left |
| 203 | * right |
| 204 | */ |
| 205 | |
| 206 | // Defining default attributes |
| 207 | $default_atts = array( |
| 208 | 'content' => '', |
| 209 | |
| 210 | 'indent' => '', // custom values: yes, no |
| 211 | 'type' => 'blockquote-normal', |
| 212 | 'text_align' => '', |
| 213 | 'float' => '', |
| 214 | 'quote_symbol' => '1', |
| 215 | 'css' => '', |
| 216 | |
| 217 | 'extra_classes' => '', // custom css class names for this element |
| 218 | 'custom_el_id' => '', // custom id attribute for this element |
| 219 | 'base_class' => 'aux-widget-quote' // base class name for container |
| 220 | ); |
| 221 | |
| 222 | $result = auxin_get_widget_scafold( $atts, $default_atts, $shortcode_content ); |
| 223 | extract( $result['parsed_atts'] ); |
| 224 | |
| 225 | ob_start(); |
| 226 | |
| 227 | // widget header ------------------------------ |
| 228 | echo wp_kses_post( $result['widget_header'] ); |
| 229 | |
| 230 | // widget custom output ----------------------- |
| 231 | |
| 232 | $classes_list = array( 'aux-elem-quote' ); |
| 233 | |
| 234 | $classes_list[] = 'aux-' . $type; |
| 235 | |
| 236 | if( ! empty( $text_align ) && 'none'!== $text_align ){ |
| 237 | $classes_list[] = 'aux-text-align-' . $text_align; |
| 238 | } |
| 239 | |
| 240 | if( ! empty( $float ) ){ |
| 241 | $classes_list[] = 'aux-float-' . $float; |
| 242 | } |
| 243 | |
| 244 | if( auxin_is_true( $quote_symbol ) ){ |
| 245 | //$classes_list[] = 'aux-quote-letter'; |
| 246 | $classes_list[] = 'aux-quote-symbol'; |
| 247 | } |
| 248 | |
| 249 | if( !empty($extra_classes) ){ |
| 250 | $classes_list[] = $extra_classes; |
| 251 | } |
| 252 | |
| 253 | $classes = implode( ' ', $classes_list ); |
| 254 | $shortcode_content = auxin_do_cleanup_shortcode( $shortcode_content ); |
| 255 | $shortcode_content = empty( $shortcode_content ) ? auxin_do_cleanup_shortcode( $content ) : $shortcode_content; |
| 256 | |
| 257 | switch ( $type ) { |
| 258 | case 'intro-hero': |
| 259 | case 'intro-normal': |
| 260 | case 'intro-splitter': |
| 261 | echo sprintf( '<p class="%s">%s</p>', esc_attr( $classes ), wp_kses_post( $shortcode_content ) ); |
| 262 | break; |
| 263 | |
| 264 | case 'pullquote-normal': |
| 265 | case 'pullquote-colorized': |
| 266 | echo sprintf( '<blockquote class="%s"><p>%s</p></blockquote>', esc_attr( $classes ), wp_kses_post( $shortcode_content ) ); |
| 267 | break; |
| 268 | |
| 269 | case 'quote-normal': |
| 270 | case 'quote-big': |
| 271 | echo sprintf( '<blockquote class="%s"><p>%s</p></blockquote>', esc_attr( $classes ), wp_kses_post( $shortcode_content ) ); |
| 272 | break; |
| 273 | |
| 274 | case 'blockquote-normal': |
| 275 | case 'blockquote-bordered': |
| 276 | default: |
| 277 | echo sprintf( '<blockquote class="%s"><p>%s</p></blockquote>', esc_attr( $classes ), wp_kses_post( $shortcode_content ) ); |
| 278 | break; |
| 279 | } |
| 280 | |
| 281 | // widget footer ------------------------------ |
| 282 | echo wp_kses_post( $result['widget_footer'] ); |
| 283 | |
| 284 | return ob_get_clean(); |
| 285 | } |
| 286 |