theme-elements
1 year ago
accordion.php
1 year ago
audio.php
4 years ago
before-after.php
3 years ago
button.php
1 year ago
carousel-navigation.php
4 years ago
circle-chart.php
1 year ago
contact-box.php
4 years ago
contact-form.php
1 year ago
custom-list.php
1 year ago
divider.php
4 years ago
gallery.php
1 year ago
gmap.php
4 years ago
heading-modern.php
1 year ago
icon.php
1 year ago
image.php
1 year ago
mailchimp.php
1 year ago
modern-button.php
1 year ago
products-grid.php
1 year ago
quote.php
1 year ago
recent-comments.php
1 year ago
recent-posts-grid-carousel.php
1 year ago
recent-posts-land-style.php
1 year ago
recent-posts-masonry.php
1 year ago
recent-posts-tiles-carousel.php
1 year ago
recent-posts-tiles.php
1 year ago
recent-posts-timeline.php
1 year ago
recent-products.php
1 year ago
responsive-table.php
1 year ago
search.php
4 years ago
staff.php
1 year ago
svg.php
1 year ago
tabs.php
1 year ago
testimonial.php
1 year ago
text.php
1 year ago
touch-slider.php
1 year ago
video.php
4 years ago
testimonial.php
1009 lines
| 1 | <?php |
| 2 | namespace Auxin\Plugin\CoreElements\Elementor\Elements; |
| 3 | |
| 4 | use Elementor\Plugin; |
| 5 | use Elementor\Widget_Base; |
| 6 | use Elementor\Controls_Manager; |
| 7 | use Elementor\Group_Control_Image_Size; |
| 8 | use Elementor\Group_Control_Typography; |
| 9 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 10 | use Elementor\Utils; |
| 11 | use Elementor\Group_Control_Border; |
| 12 | use Elementor\Group_Control_Box_Shadow; |
| 13 | use Elementor\Group_Control_Background; |
| 14 | |
| 15 | |
| 16 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | exit; // Exit if accessed directly. |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Elementor 'Testimonial' widget. |
| 22 | * |
| 23 | * Elementor widget that displays an 'Testimonial' with lightbox. |
| 24 | * |
| 25 | * @since 1.0.0 |
| 26 | */ |
| 27 | class Testimonial extends Widget_Base { |
| 28 | |
| 29 | /** |
| 30 | * Get widget name. |
| 31 | * |
| 32 | * Retrieve 'Testimonial' widget name. |
| 33 | * |
| 34 | * @since 1.0.0 |
| 35 | * @access public |
| 36 | * |
| 37 | * @return string Widget name. |
| 38 | */ |
| 39 | public function get_name() { |
| 40 | return 'aux_testimonial'; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Get widget title. |
| 45 | * |
| 46 | * Retrieve 'Testimonial' widget title. |
| 47 | * |
| 48 | * @since 1.0.0 |
| 49 | * @access public |
| 50 | * |
| 51 | * @return string Widget title. |
| 52 | */ |
| 53 | public function get_title() { |
| 54 | return __('Testimonial', 'auxin-elements' ); |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Get widget icon. |
| 59 | * |
| 60 | * Retrieve 'Testimonial' widget icon. |
| 61 | * |
| 62 | * @since 1.0.0 |
| 63 | * @access public |
| 64 | * |
| 65 | * @return string Widget icon. |
| 66 | */ |
| 67 | public function get_icon() { |
| 68 | return 'eicon-testimonial auxin-badge'; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Get widget categories. |
| 73 | * |
| 74 | * Retrieve 'Testimonial' widget icon. |
| 75 | * |
| 76 | * @since 1.0.0 |
| 77 | * @access public |
| 78 | * |
| 79 | * @return string Widget icon. |
| 80 | */ |
| 81 | public function get_categories() { |
| 82 | return array( 'auxin-core' ); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Register 'Testimonial' widget controls. |
| 87 | * |
| 88 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 89 | * |
| 90 | * @since 1.0.0 |
| 91 | * @access protected |
| 92 | */ |
| 93 | protected function register_controls() { |
| 94 | |
| 95 | /*-----------------------------------------------------------------------------------*/ |
| 96 | /* audio_section |
| 97 | /*-----------------------------------------------------------------------------------*/ |
| 98 | |
| 99 | $this->start_controls_section( |
| 100 | 'template_section', |
| 101 | array( |
| 102 | 'label' => __('Image', 'auxin-elements' ), |
| 103 | ) |
| 104 | ); |
| 105 | |
| 106 | $this->add_control( |
| 107 | 'template', |
| 108 | array( |
| 109 | 'label' => __('Templates','auxin-elements' ), |
| 110 | 'label_block' => true, |
| 111 | 'type' => Controls_Manager::SELECT, //'aux-visual-select', |
| 112 | 'style_items' => 'max-width:31%;', |
| 113 | 'options' => array( |
| 114 | 'def-img' => __( 'Default template with image', 'auxin-elements' ), |
| 115 | 'bordered' => __( 'Bordered on content', 'auxin-elements' ), |
| 116 | 'quote' => __( 'Quotation mark on top of content', 'auxin-elements' ), |
| 117 | 'info-top' => __( 'Show info on top of content', 'auxin-elements' ), |
| 118 | 'image-top' => __( 'Show image on top of content', 'auxin-elements' ) |
| 119 | /* |
| 120 | 'default' => array( |
| 121 | 'label' => __( 'Default template', 'auxin-elements' ), |
| 122 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/testimonial-1.svg' |
| 123 | ), |
| 124 | 'def-img' => array( |
| 125 | 'label' => __( 'Default template with image', 'auxin-elements' ), |
| 126 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/testimonial-2.svg' |
| 127 | ), |
| 128 | 'bordered' => array( |
| 129 | 'label' => __( 'Bordered on content', 'auxin-elements' ), |
| 130 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/testimonial-3.svg' |
| 131 | ), |
| 132 | 'quote' => array( |
| 133 | 'label' => __( 'Quotation mark on top of the content', 'auxin-elements' ), |
| 134 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/testimonial-4.svg' |
| 135 | ), |
| 136 | 'info-top' => array( |
| 137 | 'label' => __( 'Show info on top of content', 'auxin-elements' ), |
| 138 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/testimonial-5.svg' |
| 139 | ), |
| 140 | 'image-top' => array( |
| 141 | 'label' => __( 'Show image on top of the content', 'auxin-elements' ), |
| 142 | 'image' => AUXELS_ADMIN_URL . '/assets/images/visual-select/testimonial-6.svg' |
| 143 | )*/ |
| 144 | ), |
| 145 | 'default' => 'image-top' |
| 146 | ) |
| 147 | ); |
| 148 | |
| 149 | $this->add_control( |
| 150 | 'show_image', |
| 151 | array( |
| 152 | 'label' => __('Display image','auxin-elements' ), |
| 153 | 'type' => Controls_Manager::SWITCHER, |
| 154 | 'label_on' => __( 'On', 'auxin-elements' ), |
| 155 | 'label_off' => __( 'Off', 'auxin-elements' ), |
| 156 | 'default' => 'yes' |
| 157 | ) |
| 158 | ); |
| 159 | |
| 160 | $this->add_control( |
| 161 | 'customer_img', |
| 162 | array( |
| 163 | 'label' => __('Customer Image','auxin-elements' ), |
| 164 | 'type' => Controls_Manager::MEDIA, |
| 165 | 'show_label' => false, |
| 166 | 'default' => array( |
| 167 | 'url' => Utils::get_placeholder_image_src() |
| 168 | ), |
| 169 | 'condition' => array( |
| 170 | 'show_image' => 'yes' |
| 171 | ) |
| 172 | ) |
| 173 | ); |
| 174 | |
| 175 | $this->add_group_control( |
| 176 | Group_Control_Image_Size::get_type(), |
| 177 | array( |
| 178 | 'name' => 'customer_img', // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `thumbnail_size` and `thumbnail_custom_dimension`. |
| 179 | 'exclude' => array( 'custom' ), |
| 180 | 'separator' => 'none', |
| 181 | 'default' => 'thumbnail', |
| 182 | 'condition' => array( |
| 183 | 'show_image' => 'yes' |
| 184 | ) |
| 185 | ) |
| 186 | ); |
| 187 | |
| 188 | $this->end_controls_section(); |
| 189 | |
| 190 | $this->start_controls_section( |
| 191 | 'content_section', |
| 192 | array( |
| 193 | 'label' => __('Content', 'auxin-elements' ), |
| 194 | ) |
| 195 | ); |
| 196 | |
| 197 | $this->add_control( |
| 198 | 'title', |
| 199 | array( |
| 200 | 'label' => __('Customer Name','auxin-elements'), |
| 201 | 'label_block' => true, |
| 202 | 'type' => Controls_Manager::TEXT, |
| 203 | 'default' => 'John Doe' |
| 204 | ) |
| 205 | ); |
| 206 | |
| 207 | $this->add_control( |
| 208 | 'subtitle', |
| 209 | array( |
| 210 | 'label' => __('Customer Occupation','auxin-elements'), |
| 211 | 'label_block' => true, |
| 212 | 'type' => Controls_Manager::TEXT, |
| 213 | 'default' => 'Manager' |
| 214 | ) |
| 215 | ); |
| 216 | |
| 217 | $this->add_control( |
| 218 | 'link', |
| 219 | array( |
| 220 | 'label' => __('Customer Link','auxin-elements'), |
| 221 | 'type' => Controls_Manager::URL, |
| 222 | 'show_external' => false, |
| 223 | 'placeholder' => 'http://phlox.pro', |
| 224 | 'dynamic' => [ |
| 225 | 'active' => true |
| 226 | ] |
| 227 | ) |
| 228 | ); |
| 229 | |
| 230 | $this->add_control( |
| 231 | 'rating', |
| 232 | array( |
| 233 | 'label' => __('Customer Rating','auxin-elements'), |
| 234 | 'label_block' => true, |
| 235 | 'type' => Controls_Manager::SELECT, |
| 236 | 'default' => 'none', |
| 237 | 'options' => array( |
| 238 | 'none' => __( 'None' , 'auxin-elements' ), |
| 239 | '1' => '1', |
| 240 | '2' => '2', |
| 241 | '3' => '3', |
| 242 | '4' => '4', |
| 243 | '5' => '5', |
| 244 | ) |
| 245 | ) |
| 246 | ); |
| 247 | |
| 248 | $this->add_control( |
| 249 | 'content', |
| 250 | array( |
| 251 | 'label' => __('Review','auxin-elements'), |
| 252 | 'type' => Controls_Manager::TEXTAREA, |
| 253 | 'rows' => '10', |
| 254 | 'default' => 'Click edit button to change this text. Collaboratively drive collaborative solutions with flexible e-services. Conveniently supply technically sound process improvements.' |
| 255 | ) |
| 256 | ); |
| 257 | |
| 258 | $this->end_controls_section(); |
| 259 | |
| 260 | /*-----------------------------------------------------------------------------------*/ |
| 261 | /* Image Style Section |
| 262 | /*-----------------------------------------------------------------------------------*/ |
| 263 | |
| 264 | $this->start_controls_section( |
| 265 | 'section_image_border', |
| 266 | array( |
| 267 | 'label' => __( 'Image', 'auxin-elements' ), |
| 268 | 'tab' => Controls_Manager::TAB_STYLE |
| 269 | ) |
| 270 | ); |
| 271 | |
| 272 | $this->add_group_control( |
| 273 | Group_Control_Border::get_type(), |
| 274 | array( |
| 275 | 'name' => 'image_border', |
| 276 | 'selector' => '{{WRAPPER}} .aux-testimonial-image img', |
| 277 | 'separator' => 'before' |
| 278 | ) |
| 279 | ); |
| 280 | |
| 281 | $this->add_responsive_control( |
| 282 | 'image_width', |
| 283 | array( |
| 284 | 'label' => __( 'Width', 'auxin-elements' ), |
| 285 | 'type' => Controls_Manager::SLIDER, |
| 286 | 'size_units' => array( 'px', '%' ), |
| 287 | 'range' => array( |
| 288 | 'px' => array( |
| 289 | 'min' => 0, |
| 290 | 'max' => 1000 |
| 291 | ), |
| 292 | '%' => array( |
| 293 | 'min' => 0, |
| 294 | 'max' => 100 |
| 295 | ) |
| 296 | ), |
| 297 | 'selectors' => array( |
| 298 | '{{WRAPPER}} .aux-widget-testimonial .aux-testimonial-image' => 'width:{{SIZE}}{{UNIT}};' |
| 299 | ) |
| 300 | ) |
| 301 | ); |
| 302 | |
| 303 | $this->add_control( |
| 304 | 'image_border_radius', |
| 305 | array( |
| 306 | 'label' => __( 'Border radius', 'auxin-elements' ), |
| 307 | 'type' => Controls_Manager::DIMENSIONS, |
| 308 | 'size_units' => array( 'px', '%' ), |
| 309 | 'selectors' => array( |
| 310 | '{{WRAPPER}} .aux-testimonial-image img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow:hidden;' |
| 311 | ), |
| 312 | 'default' => array( |
| 313 | 'unit' => '%', |
| 314 | 'top' => '100', |
| 315 | 'right' => '100', |
| 316 | 'bottom' => '100', |
| 317 | 'left' => '100', |
| 318 | 'isLinked' => true |
| 319 | ), |
| 320 | 'allowed_dimensions' => 'all' |
| 321 | ) |
| 322 | ); |
| 323 | |
| 324 | $this->add_responsive_control( |
| 325 | 'image_margin', |
| 326 | array( |
| 327 | 'label' => __( 'Top and bottom space', 'auxin-elements' ), |
| 328 | 'type' => Controls_Manager::DIMENSIONS, |
| 329 | 'size_units' => array( 'px', 'em' ), |
| 330 | 'allowed_dimensions' => 'vertical', |
| 331 | 'selectors' => array( |
| 332 | '{{WRAPPER}} .aux-testimonial-image' => 'margin-top:{{TOP}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}};' |
| 333 | ) |
| 334 | ) |
| 335 | ); |
| 336 | |
| 337 | $this->end_controls_section(); |
| 338 | |
| 339 | /*-----------------------------------------------------------------------------------*/ |
| 340 | /* Title Style Section |
| 341 | /*-----------------------------------------------------------------------------------*/ |
| 342 | |
| 343 | $this->start_controls_section( |
| 344 | 'title_style_section', |
| 345 | array( |
| 346 | 'label' => __( 'Name', 'auxin-elements' ), |
| 347 | 'tab' => Controls_Manager::TAB_STYLE, |
| 348 | 'condition' => array( |
| 349 | 'title!' => '', |
| 350 | ), |
| 351 | ) |
| 352 | ); |
| 353 | |
| 354 | $this->start_controls_tabs( 'title_colors' ); |
| 355 | |
| 356 | $this->start_controls_tab( |
| 357 | 'title_color_normal', |
| 358 | array( |
| 359 | 'label' => __( 'Normal' , 'auxin-elements' ), |
| 360 | 'condition' => array( |
| 361 | 'title!' => '', |
| 362 | ), |
| 363 | ) |
| 364 | ); |
| 365 | |
| 366 | $this->add_control( |
| 367 | 'title_color', |
| 368 | array( |
| 369 | 'label' => __( 'Color', 'auxin-elements' ), |
| 370 | 'type' => Controls_Manager::COLOR, |
| 371 | 'selectors' => array( |
| 372 | '{{WRAPPER}} .col-title a, {{WRAPPER}} .col-title' => 'color: {{VALUE}} !important;', |
| 373 | ), |
| 374 | 'condition' => array( |
| 375 | 'title!' => '', |
| 376 | ), |
| 377 | ) |
| 378 | ); |
| 379 | |
| 380 | $this->add_group_control( |
| 381 | Group_Control_Typography::get_type(), |
| 382 | array( |
| 383 | 'name' => 'title_typography', |
| 384 | 'global' => [ |
| 385 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 386 | ], |
| 387 | 'selector' => '{{WRAPPER}} .col-title, {{WRAPPER}} .col-title a', |
| 388 | 'condition' => array( |
| 389 | 'title!' => '' |
| 390 | ) |
| 391 | ) |
| 392 | ); |
| 393 | |
| 394 | $this->end_controls_tab(); |
| 395 | |
| 396 | $this->start_controls_tab( |
| 397 | 'title_color_hover', |
| 398 | array( |
| 399 | 'label' => __( 'Hover' , 'auxin-elements' ), |
| 400 | 'condition' => array( |
| 401 | 'title!' => '', |
| 402 | ), |
| 403 | ) |
| 404 | ); |
| 405 | |
| 406 | $this->add_control( |
| 407 | 'title_hover_color', |
| 408 | array( |
| 409 | 'label' => __( 'Color', 'auxin-elements' ), |
| 410 | 'type' => Controls_Manager::COLOR, |
| 411 | 'selectors' => array( |
| 412 | '{{WRAPPER}} .aux-widget-testimonial:hover .col-title' => 'color: {{VALUE}} !important;', |
| 413 | '{{WRAPPER}} .aux-widget-testimonial:hover .col-title a' => 'color: {{VALUE}} !important;', |
| 414 | ), |
| 415 | 'condition' => array( |
| 416 | 'title!' => '', |
| 417 | ), |
| 418 | ) |
| 419 | ); |
| 420 | |
| 421 | $this->add_group_control( |
| 422 | Group_Control_Typography::get_type(), |
| 423 | array( |
| 424 | 'name' => 'title_hover_typography', |
| 425 | 'global' => [ |
| 426 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 427 | ], |
| 428 | 'selector' => '{{WRAPPER}} .aux-widget-testimonial:hover .col-title, {{WRAPPER}} .aux-widget-testimonial:hover .col-title a', |
| 429 | 'condition' => array( |
| 430 | 'title!' => '' |
| 431 | ) |
| 432 | ) |
| 433 | ); |
| 434 | |
| 435 | $this->end_controls_tab(); |
| 436 | |
| 437 | $this->end_controls_tabs(); |
| 438 | |
| 439 | $this->add_responsive_control( |
| 440 | 'title_margin', |
| 441 | array( |
| 442 | 'label' => __( 'Top and bottom space', 'auxin-elements' ), |
| 443 | 'type' => Controls_Manager::DIMENSIONS, |
| 444 | 'size_units' => array( 'px', 'em' ), |
| 445 | 'allowed_dimensions' => 'vertical', |
| 446 | 'selectors' => array( |
| 447 | '{{WRAPPER}} .col-title' => 'margin-top:{{TOP}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}};' |
| 448 | ), |
| 449 | 'condition' => array( |
| 450 | 'title!' => '' |
| 451 | ) |
| 452 | ) |
| 453 | ); |
| 454 | |
| 455 | $this->end_controls_section(); |
| 456 | |
| 457 | /*-----------------------------------------------------------------------------------*/ |
| 458 | /* Subtitle style section |
| 459 | /*-----------------------------------------------------------------------------------*/ |
| 460 | |
| 461 | $this->start_controls_section( |
| 462 | 'subtitle_style_section', |
| 463 | array( |
| 464 | 'label' => __( 'Occupation', 'auxin-elements' ), |
| 465 | 'tab' => Controls_Manager::TAB_STYLE, |
| 466 | 'condition' => array( |
| 467 | 'subtitle!' => '' |
| 468 | ) |
| 469 | ) |
| 470 | ); |
| 471 | |
| 472 | $this->start_controls_tabs( 'subtitle_styles_tabs' ); |
| 473 | |
| 474 | $this->start_controls_tab( |
| 475 | 'subtitle_color_normal', |
| 476 | array( |
| 477 | 'label' => __( 'Normal' , 'auxin-elements' ), |
| 478 | 'condition' => array( |
| 479 | 'title!' => '', |
| 480 | ), |
| 481 | ) |
| 482 | ); |
| 483 | |
| 484 | $this->add_control( |
| 485 | 'subtitle_color', |
| 486 | array( |
| 487 | 'label' => __( 'Color', 'auxin-elements' ), |
| 488 | 'type' => Controls_Manager::COLOR, |
| 489 | 'selectors' => array( |
| 490 | '{{WRAPPER}} .col-subtitle' => 'color: {{VALUE}} !important;', |
| 491 | ), |
| 492 | 'condition' => array( |
| 493 | 'subtitle!' => '', |
| 494 | ), |
| 495 | ) |
| 496 | ); |
| 497 | |
| 498 | $this->add_group_control( |
| 499 | Group_Control_Typography::get_type(), |
| 500 | array( |
| 501 | 'name' => 'subtitle_typography', |
| 502 | 'global' => [ |
| 503 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 504 | ], |
| 505 | 'selector' => '{{WRAPPER}} .col-subtitle', |
| 506 | 'condition' => array( |
| 507 | 'subtitle!' => '' |
| 508 | ) |
| 509 | ) |
| 510 | ); |
| 511 | |
| 512 | $this->end_controls_tab(); |
| 513 | |
| 514 | $this->start_controls_tab( |
| 515 | 'subtitle_color_hover', |
| 516 | array( |
| 517 | 'label' => __( 'Hover' , 'auxin-elements' ), |
| 518 | 'condition' => array( |
| 519 | 'title!' => '', |
| 520 | ), |
| 521 | ) |
| 522 | ); |
| 523 | |
| 524 | $this->add_control( |
| 525 | 'subtitle_hover_color', |
| 526 | array( |
| 527 | 'label' => __( 'Color', 'auxin-elements' ), |
| 528 | 'type' => Controls_Manager::COLOR, |
| 529 | 'selectors' => array( |
| 530 | '{{WRAPPER}} .aux-widget-testimonial:hover .col-subtitle' => 'color: {{VALUE}} !important;', |
| 531 | ), |
| 532 | 'condition' => array( |
| 533 | 'subtitle!' => '', |
| 534 | ), |
| 535 | ) |
| 536 | ); |
| 537 | |
| 538 | $this->add_group_control( |
| 539 | Group_Control_Typography::get_type(), |
| 540 | array( |
| 541 | 'name' => 'subtitle_hover_typography', |
| 542 | 'global' => [ |
| 543 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 544 | ], |
| 545 | 'selector' => '{{WRAPPER}} .aux-widget-testimonial:hover .col-subtitle', |
| 546 | 'condition' => array( |
| 547 | 'subtitle!' => '' |
| 548 | ) |
| 549 | ) |
| 550 | ); |
| 551 | |
| 552 | |
| 553 | |
| 554 | $this->end_controls_tab(); |
| 555 | |
| 556 | $this->end_controls_tabs(); |
| 557 | |
| 558 | $this->add_responsive_control( |
| 559 | 'subtitle_margin_bottom', |
| 560 | array( |
| 561 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 562 | 'type' => Controls_Manager::SLIDER, |
| 563 | 'range' => array( |
| 564 | 'px' => array( |
| 565 | 'max' => 100 |
| 566 | ) |
| 567 | ), |
| 568 | 'selectors' => array( |
| 569 | '{{WRAPPER}} .col-subtitle' => 'margin-bottom: {{SIZE}}{{UNIT}};' |
| 570 | ), |
| 571 | 'condition' => array( |
| 572 | 'subtitle!' => '' |
| 573 | ) |
| 574 | ) |
| 575 | ); |
| 576 | |
| 577 | $this->end_controls_section(); |
| 578 | |
| 579 | /*-----------------------------------------------------------------------------------*/ |
| 580 | /* Review style section |
| 581 | /*-----------------------------------------------------------------------------------*/ |
| 582 | |
| 583 | $this->start_controls_section( |
| 584 | 'review_style_section', |
| 585 | array( |
| 586 | 'label' => __( 'Review', 'auxin-elements' ), |
| 587 | 'tab' => Controls_Manager::TAB_STYLE, |
| 588 | 'condition' => array( |
| 589 | 'content!' => '' |
| 590 | ) |
| 591 | ) |
| 592 | ); |
| 593 | |
| 594 | $this->start_controls_tabs( 'review_style_tabs' ); |
| 595 | |
| 596 | $this->start_controls_tab( |
| 597 | 'review_style_normal', |
| 598 | array( |
| 599 | 'label' => __( 'Normal' , 'auxin-elements' ), |
| 600 | 'condition' => array( |
| 601 | 'content!' => '', |
| 602 | ) |
| 603 | ) |
| 604 | ); |
| 605 | |
| 606 | $this->add_control( |
| 607 | 'content_color', |
| 608 | array( |
| 609 | 'label' => __( 'Color', 'auxin-elements' ), |
| 610 | 'type' => Controls_Manager::COLOR, |
| 611 | 'selectors' => array( |
| 612 | '{{WRAPPER}} .aux-testimonial-content' => 'color: {{VALUE}} !important;' |
| 613 | ), |
| 614 | 'condition' => array( |
| 615 | 'content!' => '' |
| 616 | ) |
| 617 | ) |
| 618 | ); |
| 619 | |
| 620 | $this->add_group_control( |
| 621 | Group_Control_Typography::get_type(), |
| 622 | array( |
| 623 | 'name' => 'content_typography', |
| 624 | 'global' => [ |
| 625 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 626 | ], |
| 627 | 'selector' => '{{WRAPPER}} .aux-testimonial-content', |
| 628 | 'condition' => array( |
| 629 | 'content!' => '' |
| 630 | ) |
| 631 | ) |
| 632 | ); |
| 633 | |
| 634 | $this->end_controls_tab(); |
| 635 | |
| 636 | $this->start_controls_tab( |
| 637 | 'review_style_hover', |
| 638 | array( |
| 639 | 'label' => __( 'Hover' , 'auxin-elements' ), |
| 640 | 'condition' => array( |
| 641 | 'content!' => '', |
| 642 | ) |
| 643 | ) |
| 644 | ); |
| 645 | |
| 646 | $this->add_control( |
| 647 | 'content_color_hover', |
| 648 | array( |
| 649 | 'label' => __( 'Color', 'auxin-elements' ), |
| 650 | 'type' => Controls_Manager::COLOR, |
| 651 | 'selectors' => array( |
| 652 | '{{WRAPPER}} .aux-widget-testimonial:hover .aux-testimonial-content' => 'color: {{VALUE}} !important;' |
| 653 | ), |
| 654 | 'condition' => array( |
| 655 | 'content!' => '' |
| 656 | ) |
| 657 | ) |
| 658 | ); |
| 659 | |
| 660 | $this->add_group_control( |
| 661 | Group_Control_Typography::get_type(), |
| 662 | array( |
| 663 | 'name' => 'content_typography_hover', |
| 664 | 'global' => [ |
| 665 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 666 | ], |
| 667 | 'selector' => '{{WRAPPER}} .aux-widget-testimonial:hover .aux-testimonial-content', |
| 668 | 'condition' => array( |
| 669 | 'content!' => '' |
| 670 | ) |
| 671 | ) |
| 672 | ); |
| 673 | |
| 674 | $this->end_controls_tab(); |
| 675 | |
| 676 | $this->end_controls_tabs(); |
| 677 | |
| 678 | $this->add_responsive_control( |
| 679 | 'content_margin', |
| 680 | array( |
| 681 | 'label' => __( 'Top and bottom space', 'auxin-elements' ), |
| 682 | 'type' => Controls_Manager::DIMENSIONS, |
| 683 | 'size_units' => array( 'px', 'em' ), |
| 684 | 'allowed_dimensions' => 'vertical', |
| 685 | 'selectors' => array( |
| 686 | '{{WRAPPER}} .aux-testimonial-content .entry-content' => 'margin-top:{{TOP}}{{UNIT}}; margin-bottom:{{BOTTOM}}{{UNIT}};' |
| 687 | ), |
| 688 | 'separator' => 'before' |
| 689 | ) |
| 690 | ); |
| 691 | |
| 692 | $this->add_responsive_control( |
| 693 | 'content_border_radius', |
| 694 | array( |
| 695 | 'label' => __( 'Border radius', 'auxin-elements' ), |
| 696 | 'type' => Controls_Manager::DIMENSIONS, |
| 697 | 'size_units' => array( 'px' ), |
| 698 | 'selectors' => array( |
| 699 | '{{WRAPPER}} .aux-testimonial-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 700 | ) |
| 701 | ) |
| 702 | ); |
| 703 | |
| 704 | $this->add_responsive_control( |
| 705 | 'content_padding', |
| 706 | array( |
| 707 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 708 | 'type' => Controls_Manager::DIMENSIONS, |
| 709 | 'size_units' => array( 'px', '%' ), |
| 710 | 'selectors' => array( |
| 711 | '{{WRAPPER}} .aux-testimonial-content .entry-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 712 | ) |
| 713 | ) |
| 714 | ); |
| 715 | |
| 716 | $this->add_group_control( |
| 717 | Group_Control_Border::get_type(), |
| 718 | array( |
| 719 | 'name' => 'content_border', |
| 720 | 'selector' => '{{WRAPPER}} .aux-testimonial-content', |
| 721 | 'separator' => 'both' |
| 722 | ) |
| 723 | ); |
| 724 | |
| 725 | $this->end_controls_section(); |
| 726 | |
| 727 | /*-----------------------------------------------------------------------------------*/ |
| 728 | /* Rating Style Section |
| 729 | /*-----------------------------------------------------------------------------------*/ |
| 730 | |
| 731 | $this->start_controls_section( |
| 732 | 'rating_style_section', |
| 733 | array( |
| 734 | 'label' => __( 'Rating', 'auxin-elements' ), |
| 735 | 'tab' => Controls_Manager::TAB_STYLE, |
| 736 | 'condition' => array( |
| 737 | 'rating!' => 'none' |
| 738 | ) |
| 739 | ) |
| 740 | ); |
| 741 | |
| 742 | |
| 743 | $this->add_control( |
| 744 | 'rating_empty_color', |
| 745 | array( |
| 746 | 'label' => __( 'Empty Color', 'auxin-elements' ), |
| 747 | 'type' => Controls_Manager::COLOR, |
| 748 | 'selectors' => array( |
| 749 | '{{WRAPPER}} .aux-rating-box.aux-star-rating::before' => 'color: {{VALUE}} !important;' |
| 750 | ) |
| 751 | ) |
| 752 | ); |
| 753 | |
| 754 | $this->add_control( |
| 755 | 'rating_fill_color', |
| 756 | array( |
| 757 | 'label' => __( 'Fill Color', 'auxin-elements' ), |
| 758 | 'type' => Controls_Manager::COLOR, |
| 759 | 'selectors' => array( |
| 760 | '{{WRAPPER}} .aux-rating-box.aux-star-rating span::before' => 'color: {{VALUE}} !important;' |
| 761 | ) |
| 762 | ) |
| 763 | ); |
| 764 | |
| 765 | $this->add_responsive_control( |
| 766 | 'rating_size', |
| 767 | array( |
| 768 | 'label' => __( 'Size', 'auxin-elements' ), |
| 769 | 'type' => Controls_Manager::SLIDER, |
| 770 | 'size_units' => array( 'px', 'em', 'rem' ), |
| 771 | 'range' => array( |
| 772 | 'px' => array( |
| 773 | 'min' => 1, |
| 774 | 'max' => 200 |
| 775 | ) |
| 776 | ), |
| 777 | 'selectors' => array( |
| 778 | '{{WRAPPER}} .aux-star-rating' => 'font-size: {{SIZE}}{{UNIT}};' |
| 779 | ) |
| 780 | ) |
| 781 | ); |
| 782 | |
| 783 | $this->add_responsive_control( |
| 784 | 'rating_margin_bottom', |
| 785 | array( |
| 786 | 'label' => __( 'Bottom space', 'auxin-elements' ), |
| 787 | 'type' => Controls_Manager::SLIDER, |
| 788 | 'range' => array( |
| 789 | 'px' => array( |
| 790 | 'max' => 100 |
| 791 | ) |
| 792 | ), |
| 793 | 'selectors' => array( |
| 794 | '{{WRAPPER}} .aux-star-rating' => 'margin-bottom: {{SIZE}}{{UNIT}};' |
| 795 | ) |
| 796 | ) |
| 797 | ); |
| 798 | |
| 799 | $this->end_controls_section(); |
| 800 | |
| 801 | /*-----------------------------------------------------------------------------------*/ |
| 802 | /* Block Style Section |
| 803 | /*-----------------------------------------------------------------------------------*/ |
| 804 | |
| 805 | $this->start_controls_section( |
| 806 | 'box_style_section', |
| 807 | array( |
| 808 | 'label' => __( 'Content Box', 'auxin-elements' ), |
| 809 | 'tab' => Controls_Manager::TAB_STYLE |
| 810 | ) |
| 811 | ); |
| 812 | |
| 813 | $this->add_control( |
| 814 | 'box_alignment', |
| 815 | array( |
| 816 | 'label' => __('Content Alignment', 'auxin-elements'), |
| 817 | 'type' => Controls_Manager::CHOOSE, |
| 818 | 'default' => 'center', |
| 819 | 'options' => array( |
| 820 | 'left' => array( |
| 821 | 'title' => __( 'Left', 'auxin-elements' ), |
| 822 | 'icon' => 'eicon-text-align-left', |
| 823 | ), |
| 824 | 'center' => array( |
| 825 | 'title' => __( 'Center', 'auxin-elements' ), |
| 826 | 'icon' => 'eicon-text-align-center', |
| 827 | ), |
| 828 | 'right' => array( |
| 829 | 'title' => __( 'Right', 'auxin-elements' ), |
| 830 | 'icon' => 'eicon-text-align-right', |
| 831 | ) |
| 832 | ), |
| 833 | 'return_value' => '', |
| 834 | 'selectors' => array( |
| 835 | '{{WRAPPER}} .aux-widget-testimonial' => 'text-align:{{VALUE}};', |
| 836 | ) |
| 837 | ) |
| 838 | ); |
| 839 | |
| 840 | $this->add_responsive_control( |
| 841 | 'box_border_radius', |
| 842 | array( |
| 843 | 'label' => __( 'Border radius', 'auxin-elements' ), |
| 844 | 'type' => Controls_Manager::DIMENSIONS, |
| 845 | 'size_units' => array( 'px' ), |
| 846 | 'selectors' => array( |
| 847 | '{{WRAPPER}} .aux-widget-testimonial' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 848 | ) |
| 849 | ) |
| 850 | ); |
| 851 | |
| 852 | $this->add_responsive_control( |
| 853 | 'box_padding', |
| 854 | array( |
| 855 | 'label' => __( 'Padding', 'auxin-elements' ), |
| 856 | 'type' => Controls_Manager::DIMENSIONS, |
| 857 | 'size_units' => array( 'px', '%' ), |
| 858 | 'selectors' => array( |
| 859 | '{{WRAPPER}} .aux-widget-testimonial' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 860 | ) |
| 861 | ) |
| 862 | ); |
| 863 | |
| 864 | $this->add_responsive_control( |
| 865 | 'box_width', |
| 866 | array( |
| 867 | 'label' => __('Width','auxin-elements' ), |
| 868 | 'type' => Controls_Manager::SLIDER, |
| 869 | 'size_units' => array('px', 'em','%'), |
| 870 | 'range' => array( |
| 871 | '%' => array( |
| 872 | 'min' => 1, |
| 873 | 'max' => 120, |
| 874 | 'step' => 1 |
| 875 | ), |
| 876 | 'em' => array( |
| 877 | 'min' => 1, |
| 878 | 'max' => 120, |
| 879 | 'step' => 1 |
| 880 | ), |
| 881 | 'px' => array( |
| 882 | 'min' => 1, |
| 883 | 'max' => 1900, |
| 884 | 'step' => 1 |
| 885 | ) |
| 886 | ), |
| 887 | 'selectors' => array( |
| 888 | '{{WRAPPER}} .aux-widget-testimonial' => 'max-width:{{SIZE}}{{UNIT}}; margin-left:auto; margin-right:auto;' |
| 889 | ), |
| 890 | 'separator' => 'after' |
| 891 | ) |
| 892 | ); |
| 893 | |
| 894 | $this->start_controls_tabs( 'box_tabs' ); |
| 895 | |
| 896 | $this->start_controls_tab( |
| 897 | 'box_normal', |
| 898 | array( |
| 899 | 'label' => __( 'Normal' , 'auxin-elements' ) |
| 900 | ) |
| 901 | ); |
| 902 | |
| 903 | $this->add_group_control( |
| 904 | Group_Control_Background::get_type(), |
| 905 | array( |
| 906 | 'name' => 'box_backgound', |
| 907 | 'label' => __( 'Background', 'auxin-elements' ), |
| 908 | 'selector' => '{{WRAPPER}} .aux-widget-testimonial' |
| 909 | ) |
| 910 | ); |
| 911 | |
| 912 | $this->add_group_control( |
| 913 | Group_Control_Box_Shadow::get_type(), |
| 914 | array( |
| 915 | 'name' => 'box_shadow', |
| 916 | 'selector' => '{{WRAPPER}} .aux-widget-testimonial', |
| 917 | 'separator' => 'both' |
| 918 | ) |
| 919 | ); |
| 920 | |
| 921 | $this->add_group_control( |
| 922 | Group_Control_Border::get_type(), |
| 923 | array( |
| 924 | 'name' => 'box_border', |
| 925 | 'selector' => '{{WRAPPER}} .aux-widget-testimonial', |
| 926 | 'separator' => 'none' |
| 927 | ) |
| 928 | ); |
| 929 | |
| 930 | $this->end_controls_tab(); |
| 931 | |
| 932 | $this->start_controls_tab( |
| 933 | 'box_hover', |
| 934 | array( |
| 935 | 'label' => __( 'Hover' , 'auxin-elements' ) |
| 936 | ) |
| 937 | ); |
| 938 | |
| 939 | $this->add_group_control( |
| 940 | Group_Control_Background::get_type(), |
| 941 | array( |
| 942 | 'name' => 'box_backgound_hover', |
| 943 | 'label' => __( 'Background', 'auxin-elements' ), |
| 944 | 'selector' => '{{WRAPPER}} .aux-widget-testimonial:hover' |
| 945 | ) |
| 946 | ); |
| 947 | |
| 948 | $this->add_group_control( |
| 949 | Group_Control_Box_Shadow::get_type(), |
| 950 | array( |
| 951 | 'name' => 'box_shadow_hover', |
| 952 | 'selector' => '{{WRAPPER}} .aux-widget-testimonial:hover', |
| 953 | 'separator' => 'both' |
| 954 | ) |
| 955 | ); |
| 956 | |
| 957 | $this->add_group_control( |
| 958 | Group_Control_Border::get_type(), |
| 959 | array( |
| 960 | 'name' => 'box_border_hover', |
| 961 | 'selector' => '{{WRAPPER}} .aux-widget-testimonial:hover', |
| 962 | 'separator' => 'none' |
| 963 | ) |
| 964 | ); |
| 965 | |
| 966 | $this->end_controls_tab(); |
| 967 | |
| 968 | $this->end_controls_tabs(); |
| 969 | |
| 970 | $this->end_controls_section(); |
| 971 | } |
| 972 | |
| 973 | /** |
| 974 | * Render image box widget output on the frontend. |
| 975 | * |
| 976 | * Written in PHP and used to generate the final HTML. |
| 977 | * |
| 978 | * @since 1.0.0 |
| 979 | * @access protected |
| 980 | */ |
| 981 | protected function render() { |
| 982 | |
| 983 | $settings = $this->get_settings_for_display(); |
| 984 | |
| 985 | $image_size = !empty( $settings['customer_img_size'] ) ? $settings['customer_img_size'] : 'thumbnail'; |
| 986 | if ( function_exists( 'auxin_maybe_create_image_size' ) && !empty( $settings['customer_img']['id'] ) ) { |
| 987 | auxin_maybe_create_image_size( $settings['customer_img']['id'], $image_size ); |
| 988 | } |
| 989 | |
| 990 | $image_html = !empty( $settings['customer_img']['id'] ) ? Group_Control_Image_Size::get_attachment_image_html( $settings, 'customer_img' ) : ''; |
| 991 | |
| 992 | $args = array( |
| 993 | 'template' => $settings['template'], |
| 994 | 'image_html' => $image_html, |
| 995 | 'image_size' => $image_size, |
| 996 | |
| 997 | 'title' => $settings['title'], |
| 998 | 'subtitle' => $settings['subtitle'], |
| 999 | 'link' => $settings['link']['url'], |
| 1000 | 'rating' => $settings['rating'], |
| 1001 | 'content' => $settings['content'] |
| 1002 | ); |
| 1003 | |
| 1004 | // pass the args through the corresponding shortcode callback |
| 1005 | echo auxin_widget_testimonial_callback( $args ); |
| 1006 | } |
| 1007 | |
| 1008 | } |
| 1009 |