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