dep
1 month ago
premium-banner.php
3 weeks ago
premium-blog.php
3 weeks ago
premium-button.php
3 weeks ago
premium-carousel.php
3 weeks ago
premium-contactform.php
3 weeks ago
premium-countdown.php
3 weeks ago
premium-counter.php
3 weeks ago
premium-dual-header.php
3 weeks ago
premium-fancytext.php
3 weeks ago
premium-grid.php
3 weeks ago
premium-icon-list.php
3 weeks ago
premium-image-button.php
3 weeks ago
premium-image-scroll.php
3 weeks ago
premium-image-separator.php
3 weeks ago
premium-lottie.php
3 weeks ago
premium-maps.php
3 weeks ago
premium-media-wheel.php
3 weeks ago
premium-mobile-menu.php
3 weeks ago
premium-modalbox.php
3 weeks ago
premium-nav-menu.php
3 weeks ago
premium-notifications.php
3 weeks ago
premium-person.php
3 weeks ago
premium-pinterest-feed.php
3 weeks ago
premium-post-ticker.php
3 weeks ago
premium-pricing-table.php
3 weeks ago
premium-progressbar.php
3 weeks ago
premium-search-form.php
3 weeks ago
premium-svg-drawer.php
3 weeks ago
premium-tcloud.php
3 weeks ago
premium-testimonials.php
3 weeks ago
premium-textual-showcase.php
3 weeks ago
premium-tiktok-feed.php
3 weeks ago
premium-title.php
3 weeks ago
premium-videobox.php
3 weeks ago
premium-vscroll.php
3 weeks ago
premium-weather.php
3 weeks ago
premium-world-clock.php
3 weeks ago
premium-testimonials.php
2192 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Premium Testimonials. |
| 4 | */ |
| 5 | |
| 6 | namespace PremiumAddons\Widgets; |
| 7 | |
| 8 | // Elementor Classes. |
| 9 | use Elementor\Modules\DynamicTags\Module as TagsModule; |
| 10 | use Elementor\Plugin; |
| 11 | use Elementor\Widget_Base; |
| 12 | use Elementor\Utils; |
| 13 | use Elementor\Control_Media; |
| 14 | use Elementor\Controls_Manager; |
| 15 | use Elementor\Repeater; |
| 16 | use Elementor\Core\Kits\Documents\Tabs\Global_Colors; |
| 17 | use Elementor\Group_Control_Image_Size; |
| 18 | use Elementor\Group_Control_Typography; |
| 19 | use Elementor\Group_Control_Css_Filter; |
| 20 | use Elementor\Group_Control_Border; |
| 21 | use Elementor\Group_Control_Text_Shadow; |
| 22 | use Elementor\Group_Control_Box_Shadow; |
| 23 | use PremiumAddons\Includes\Controls\Premium_Background; |
| 24 | |
| 25 | // PremiumAddons Classes. |
| 26 | use PremiumAddons\Includes\Helper_Functions; |
| 27 | |
| 28 | if ( ! defined( 'ABSPATH' ) ) { |
| 29 | exit; // If this file is called directly, abort. |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Class Premium_Testimonials |
| 34 | */ |
| 35 | class Premium_Testimonials extends Widget_Base { |
| 36 | |
| 37 | /** |
| 38 | * Retrieve Widget Name. |
| 39 | * |
| 40 | * @since 1.0.0 |
| 41 | * @access public |
| 42 | */ |
| 43 | public function get_name() { |
| 44 | return 'premium-addon-testimonials'; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Retrieve Widget Title. |
| 49 | * |
| 50 | * @since 1.0.0 |
| 51 | * @access public |
| 52 | */ |
| 53 | public function get_title() { |
| 54 | return __( 'Testimonial', 'premium-addons-for-elementor' ); |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Retrieve Widget Icon. |
| 59 | * |
| 60 | * @since 1.0.0 |
| 61 | * @access public |
| 62 | * |
| 63 | * @return string widget icon. |
| 64 | */ |
| 65 | public function get_icon() { |
| 66 | return 'pa-testimonials'; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Retrieve Widget Dependent CSS. |
| 71 | * |
| 72 | * @since 1.0.0 |
| 73 | * @access public |
| 74 | * |
| 75 | * @return array CSS style handles. |
| 76 | */ |
| 77 | public function get_style_depends() { |
| 78 | return array( |
| 79 | 'pa-glass', |
| 80 | 'font-awesome-5-all', |
| 81 | 'pa-slick', |
| 82 | 'premium-addons', |
| 83 | ); |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Retrieve Widget Dependent JS. |
| 88 | * |
| 89 | * @since 1.0.0 |
| 90 | * @access public |
| 91 | * |
| 92 | * @return array JS script handles. |
| 93 | */ |
| 94 | public function get_script_depends() { |
| 95 | |
| 96 | $is_edit = Helper_Functions::is_edit_mode(); |
| 97 | |
| 98 | $scripts = array(); |
| 99 | |
| 100 | if ( $is_edit ) { |
| 101 | |
| 102 | $scripts = array( 'isotope-js', 'pa-glass', 'pa-slick' ); |
| 103 | |
| 104 | } else { |
| 105 | $settings = $this->get_settings(); |
| 106 | $load_masonry = 'masonry' === $settings['premium_testimonial_layout'] && 'yes' !== $settings['carousel'] && 'skin4' !== $settings['skin']; |
| 107 | |
| 108 | if ( 'yes' === $settings['carousel'] || 'skin4' === $settings['skin'] ) { |
| 109 | $scripts[] = 'pa-slick'; |
| 110 | |
| 111 | if ( 'none' !== $settings['arrows_lq_effect'] ) { |
| 112 | $scripts[] = 'pa-glass'; |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | if ( $load_masonry ) { |
| 117 | $scripts[] = 'isotope-js'; |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | $scripts[] = 'premium-addons'; |
| 122 | |
| 123 | return $scripts; |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Retrieve Widget Categories. |
| 128 | * |
| 129 | * @since 1.5.1 |
| 130 | * @access public |
| 131 | * |
| 132 | * @return array Widget categories. |
| 133 | */ |
| 134 | public function get_categories() { |
| 135 | return array( 'premium-elements' ); |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * Retrieve Widget Keywords. |
| 140 | * |
| 141 | * @since 1.0.0 |
| 142 | * @access public |
| 143 | * |
| 144 | * @return array Widget keywords. |
| 145 | */ |
| 146 | public function get_keywords() { |
| 147 | return array( 'pa', 'premium', 'premium testimonials', 'quote', 'appreciate', 'rating', 'review', 'recommendation' ); |
| 148 | } |
| 149 | |
| 150 | protected function is_dynamic_content(): bool { |
| 151 | return false; |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Retrieve Widget Support URL. |
| 156 | * |
| 157 | * @access public |
| 158 | * |
| 159 | * @return string support URL. |
| 160 | */ |
| 161 | public function get_custom_help_url() { |
| 162 | return 'https://premiumaddons.com/support/'; |
| 163 | } |
| 164 | |
| 165 | public function has_widget_inner_wrapper(): bool { |
| 166 | return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' ); |
| 167 | } |
| 168 | |
| 169 | /** |
| 170 | * Register Testimonials controls. |
| 171 | * |
| 172 | * @since 1.0.0 |
| 173 | * @access protected |
| 174 | */ |
| 175 | protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
| 176 | |
| 177 | $papro_activated = Helper_Functions::check_papro_version(); |
| 178 | |
| 179 | $this->start_controls_section( |
| 180 | 'testimonial_section', |
| 181 | array( |
| 182 | 'label' => __( 'Testimonial', 'premium-addons-for-elementor' ), |
| 183 | ) |
| 184 | ); |
| 185 | |
| 186 | $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/testimonials-widget-for-elementor-page-builder/', 'testimonials', 'wp-editor', 'demo' ); |
| 187 | Helper_Functions::add_templates_controls( $this, 'testimonials', $demo ); |
| 188 | |
| 189 | $this->add_control( |
| 190 | 'multiple', |
| 191 | array( |
| 192 | 'label' => __( 'Multiple Testimonials', 'premium-addons-for-elementor' ), |
| 193 | 'description' => __( 'Enable this option if you need to add multiple testimonials', 'premium-addons-for-elementor' ), |
| 194 | 'type' => Controls_Manager::SWITCHER, |
| 195 | ) |
| 196 | ); |
| 197 | |
| 198 | $this->start_controls_tabs( |
| 199 | 'author_info_tabs', |
| 200 | array( |
| 201 | 'condition' => array( |
| 202 | 'multiple!' => 'yes', |
| 203 | ), |
| 204 | ) |
| 205 | ); |
| 206 | |
| 207 | $this->start_controls_tab( |
| 208 | 'author_info_tab_author', |
| 209 | array( |
| 210 | 'label' => __( 'Author', 'premium-addons-for-elementor' ), |
| 211 | ) |
| 212 | ); |
| 213 | |
| 214 | $this->add_control( |
| 215 | 'premium_testimonial_person_image', |
| 216 | array( |
| 217 | 'label' => __( 'Image', 'premium-addons-for-elementor' ), |
| 218 | 'type' => Controls_Manager::MEDIA, |
| 219 | 'dynamic' => array( 'active' => true ), |
| 220 | 'default' => array( |
| 221 | 'url' => Utils::get_placeholder_image_src(), |
| 222 | ), |
| 223 | 'show_label' => true, |
| 224 | ) |
| 225 | ); |
| 226 | |
| 227 | $this->add_control( |
| 228 | 'premium_testimonial_person_name', |
| 229 | array( |
| 230 | 'label' => __( 'Name', 'premium-addons-for-elementor' ), |
| 231 | 'type' => Controls_Manager::TEXT, |
| 232 | 'default' => 'Joseph L.Mabie', |
| 233 | 'dynamic' => array( 'active' => true ), |
| 234 | 'label_block' => true, |
| 235 | ) |
| 236 | ); |
| 237 | |
| 238 | $this->end_controls_tab(); |
| 239 | |
| 240 | $this->start_controls_tab( |
| 241 | 'author_info_tab_content', |
| 242 | array( |
| 243 | 'label' => __( 'Content', 'premium-addons-for-elementor' ), |
| 244 | ) |
| 245 | ); |
| 246 | |
| 247 | $this->add_control( |
| 248 | 'heading', |
| 249 | array( |
| 250 | 'label' => __( 'Heading', 'premium-addons-for-elementor' ), |
| 251 | 'type' => Controls_Manager::TEXT, |
| 252 | 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ), |
| 253 | 'dynamic' => array( 'active' => true ), |
| 254 | 'label_block' => true, |
| 255 | ) |
| 256 | ); |
| 257 | |
| 258 | $this->add_control( |
| 259 | 'premium_testimonial_company_name', |
| 260 | array( |
| 261 | 'label' => __( 'Job', 'premium-addons-for-elementor' ), |
| 262 | 'type' => Controls_Manager::TEXT, |
| 263 | 'dynamic' => array( 'active' => true ), |
| 264 | 'default' => 'Influencer', |
| 265 | 'label_block' => true, |
| 266 | ) |
| 267 | ); |
| 268 | |
| 269 | $this->add_control( |
| 270 | 'premium_testimonial_company_link_switcher', |
| 271 | array( |
| 272 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 273 | 'type' => Controls_Manager::SWITCHER, |
| 274 | 'default' => 'yes', |
| 275 | ) |
| 276 | ); |
| 277 | |
| 278 | $this->add_control( |
| 279 | 'premium_testimonial_company_link', |
| 280 | array( |
| 281 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 282 | 'type' => Controls_Manager::URL, |
| 283 | 'default' => array( |
| 284 | 'is_external' => true, |
| 285 | ), |
| 286 | 'dynamic' => array( 'active' => true ), |
| 287 | 'label_block' => true, |
| 288 | 'condition' => array( |
| 289 | 'premium_testimonial_company_link_switcher' => 'yes', |
| 290 | ), |
| 291 | ) |
| 292 | ); |
| 293 | |
| 294 | $this->add_control( |
| 295 | 'rating', |
| 296 | array( |
| 297 | 'label' => __( 'Rating Score', 'premium-addons-for-elementor' ), |
| 298 | 'type' => Controls_Manager::NUMBER, |
| 299 | 'dynamic' => array( 'active' => true ), |
| 300 | 'min' => 0, |
| 301 | 'max' => 5, |
| 302 | 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ), |
| 303 | ) |
| 304 | ); |
| 305 | |
| 306 | $this->add_control( |
| 307 | 'premium_testimonial_content', |
| 308 | array( |
| 309 | 'label' => __( 'Content', 'premium-addons-for-elementor' ), |
| 310 | 'type' => Controls_Manager::TEXTAREA, |
| 311 | 'rows' => 10, |
| 312 | 'dynamic' => array( 'active' => true ), |
| 313 | 'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida. Risus commodo viverra maecenas accumsan lacus vel facilisis.', 'premium-addons-for-elementor' ), |
| 314 | 'label_block' => true, |
| 315 | ) |
| 316 | ); |
| 317 | |
| 318 | $this->end_controls_tab(); |
| 319 | |
| 320 | $this->end_controls_tabs(); |
| 321 | |
| 322 | $repeater = new Repeater(); |
| 323 | |
| 324 | $repeater->add_control( |
| 325 | 'person_image', |
| 326 | array( |
| 327 | 'label' => __( 'Image', 'premium-addons-for-elementor' ), |
| 328 | 'type' => Controls_Manager::MEDIA, |
| 329 | 'dynamic' => array( 'active' => true ), |
| 330 | 'default' => array( |
| 331 | 'url' => Utils::get_placeholder_image_src(), |
| 332 | ), |
| 333 | 'show_label' => true, |
| 334 | ) |
| 335 | ); |
| 336 | |
| 337 | $repeater->add_control( |
| 338 | 'heading', |
| 339 | array( |
| 340 | 'label' => __( 'Heading', 'premium-addons-for-elementor' ), |
| 341 | 'type' => Controls_Manager::TEXT, |
| 342 | 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ), |
| 343 | 'dynamic' => array( 'active' => true ), |
| 344 | 'label_block' => true, |
| 345 | ) |
| 346 | ); |
| 347 | |
| 348 | $repeater->add_control( |
| 349 | 'person_name', |
| 350 | array( |
| 351 | 'label' => __( 'Name', 'premium-addons-for-elementor' ), |
| 352 | 'type' => Controls_Manager::TEXT, |
| 353 | 'dynamic' => array( 'active' => true ), |
| 354 | 'default' => 'Joseph L.Mabie', |
| 355 | 'label_block' => true, |
| 356 | ) |
| 357 | ); |
| 358 | |
| 359 | $repeater->add_control( |
| 360 | 'company_name', |
| 361 | array( |
| 362 | 'label' => __( 'Job', 'premium-addons-for-elementor' ), |
| 363 | 'type' => Controls_Manager::TEXT, |
| 364 | 'dynamic' => array( 'active' => true ), |
| 365 | 'default' => 'Influencer', |
| 366 | 'label_block' => true, |
| 367 | ) |
| 368 | ); |
| 369 | |
| 370 | $repeater->add_control( |
| 371 | 'link_switcher', |
| 372 | array( |
| 373 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 374 | 'type' => Controls_Manager::SWITCHER, |
| 375 | ) |
| 376 | ); |
| 377 | |
| 378 | $repeater->add_control( |
| 379 | 'link', |
| 380 | array( |
| 381 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 382 | 'type' => Controls_Manager::URL, |
| 383 | 'default' => array( |
| 384 | 'is_external' => true, |
| 385 | ), |
| 386 | 'label_block' => true, |
| 387 | 'condition' => array( |
| 388 | 'link_switcher' => 'yes', |
| 389 | ), |
| 390 | ) |
| 391 | ); |
| 392 | |
| 393 | $repeater->add_control( |
| 394 | 'rating', |
| 395 | array( |
| 396 | 'label' => __( 'Rating Score', 'premium-addons-for-elementor' ), |
| 397 | 'type' => Controls_Manager::NUMBER, |
| 398 | 'dynamic' => array( 'active' => true ), |
| 399 | 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ), |
| 400 | 'min' => 0, |
| 401 | 'max' => 5, |
| 402 | ) |
| 403 | ); |
| 404 | |
| 405 | $repeater->add_control( |
| 406 | 'content', |
| 407 | array( |
| 408 | 'label' => __( 'Content', 'premium-addons-for-elementor' ), |
| 409 | 'type' => Controls_Manager::TEXTAREA, |
| 410 | 'rows' => 10, |
| 411 | 'dynamic' => array( 'active' => true ), |
| 412 | 'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida. Risus commodo viverra maecenas accumsan lacus vel facilisis.', 'premium-addons-for-elementor' ), |
| 413 | 'label_block' => true, |
| 414 | ) |
| 415 | ); |
| 416 | |
| 417 | $this->add_control( |
| 418 | 'multiple_testimonials', |
| 419 | array( |
| 420 | 'label' => __( 'Testimonials', 'premium-addons-for-elementor' ), |
| 421 | 'type' => Controls_Manager::REPEATER, |
| 422 | 'default' => array( |
| 423 | array( |
| 424 | 'person_name' => 'Joseph L.Mabie', |
| 425 | 'company_name' => 'Influencer', |
| 426 | 'heading' => 'Great Support Team', |
| 427 | ), |
| 428 | array( |
| 429 | 'person_name' => 'Debra Campbell', |
| 430 | 'company_name' => 'Web Developer', |
| 431 | 'heading' => 'Very Powerful', |
| 432 | ), |
| 433 | array( |
| 434 | 'person_name' => 'Joanne Ellis', |
| 435 | 'company_name' => 'Content Creator', |
| 436 | 'heading' => 'Excellent Service', |
| 437 | ), |
| 438 | ), |
| 439 | 'fields' => $repeater->get_controls(), |
| 440 | 'title_field' => '{{{person_name}}}', |
| 441 | 'condition' => array( |
| 442 | 'multiple' => 'yes', |
| 443 | ), |
| 444 | ) |
| 445 | ); |
| 446 | |
| 447 | $this->add_control( |
| 448 | 'carousel', |
| 449 | array( |
| 450 | 'label' => __( 'Carousel', 'premium-addons-for-elementor' ), |
| 451 | 'type' => Controls_Manager::SWITCHER, |
| 452 | 'frontend_available' => true, |
| 453 | 'condition' => array( |
| 454 | 'multiple' => 'yes', |
| 455 | 'skin!' => 'skin4', |
| 456 | ), |
| 457 | ) |
| 458 | ); |
| 459 | |
| 460 | $this->add_responsive_control( |
| 461 | 'slides_to_scroll', |
| 462 | array( |
| 463 | 'label' => __( 'Slides To Scroll', 'premium-addons-for-elementor' ), |
| 464 | 'type' => Controls_Manager::NUMBER, |
| 465 | 'render_type' => 'template', |
| 466 | 'selectors' => array( |
| 467 | '{{WRAPPER}}' => '--pa-carousel-slides: {{VALUE}}', |
| 468 | ), |
| 469 | 'condition' => array( |
| 470 | 'multiple' => 'yes', |
| 471 | 'carousel' => 'yes', |
| 472 | 'skin!' => 'skin4', |
| 473 | ), |
| 474 | ) |
| 475 | ); |
| 476 | |
| 477 | $this->add_control( |
| 478 | 'carousel_play', |
| 479 | array( |
| 480 | 'label' => __( 'Auto Play', 'premium-addons-for-elementor' ), |
| 481 | 'type' => Controls_Manager::SWITCHER, |
| 482 | 'conditions' => array( |
| 483 | 'terms' => array( |
| 484 | array( |
| 485 | 'name' => 'multiple', |
| 486 | 'value' => 'yes', |
| 487 | ), |
| 488 | array( |
| 489 | 'relation' => 'or', |
| 490 | 'terms' => array( |
| 491 | array( |
| 492 | 'terms' => array( |
| 493 | array( |
| 494 | 'name' => 'skin', |
| 495 | 'operator' => '!==', |
| 496 | 'value' => 'skin4', |
| 497 | ), |
| 498 | array( |
| 499 | 'name' => 'carousel', |
| 500 | 'operator' => '===', |
| 501 | 'value' => 'yes', |
| 502 | ), |
| 503 | ), |
| 504 | ), |
| 505 | array( |
| 506 | 'terms' => array( |
| 507 | array( |
| 508 | 'name' => 'skin', |
| 509 | 'operator' => '===', |
| 510 | 'value' => 'skin4', |
| 511 | ), |
| 512 | ), |
| 513 | ), |
| 514 | |
| 515 | ), |
| 516 | ), |
| 517 | ), |
| 518 | ), |
| 519 | 'frontend_available' => true, |
| 520 | ) |
| 521 | ); |
| 522 | |
| 523 | $this->add_control( |
| 524 | 'speed', |
| 525 | array( |
| 526 | 'label' => __( 'Autoplay Speed', 'premium-addons-for-elementor' ), |
| 527 | 'description' => __( 'Autoplay Speed means at which time the next slide should come. Set a value in milliseconds (ms)', 'premium-addons-for-elementor' ), |
| 528 | 'type' => Controls_Manager::NUMBER, |
| 529 | 'default' => 5000, |
| 530 | 'conditions' => array( |
| 531 | 'terms' => array( |
| 532 | array( |
| 533 | 'name' => 'multiple', |
| 534 | 'value' => 'yes', |
| 535 | ), |
| 536 | array( |
| 537 | 'name' => 'carousel_play', |
| 538 | 'value' => 'yes', |
| 539 | ), |
| 540 | array( |
| 541 | 'relation' => 'or', |
| 542 | 'terms' => array( |
| 543 | array( |
| 544 | 'terms' => array( |
| 545 | array( |
| 546 | 'name' => 'skin', |
| 547 | 'operator' => '!==', |
| 548 | 'value' => 'skin4', |
| 549 | ), |
| 550 | array( |
| 551 | 'name' => 'carousel', |
| 552 | 'operator' => '===', |
| 553 | 'value' => 'yes', |
| 554 | ), |
| 555 | ), |
| 556 | ), |
| 557 | array( |
| 558 | 'terms' => array( |
| 559 | array( |
| 560 | 'name' => 'skin', |
| 561 | 'operator' => '===', |
| 562 | 'value' => 'skin4', |
| 563 | ), |
| 564 | ), |
| 565 | ), |
| 566 | |
| 567 | ), |
| 568 | ), |
| 569 | ), |
| 570 | ), |
| 571 | 'frontend_available' => true, |
| 572 | ) |
| 573 | ); |
| 574 | |
| 575 | $this->end_controls_section(); |
| 576 | |
| 577 | $this->start_controls_section( |
| 578 | 'display_option_section', |
| 579 | array( |
| 580 | 'label' => __( 'Display Options', 'premium-addons-for-elementor' ), |
| 581 | ) |
| 582 | ); |
| 583 | |
| 584 | $this->add_control( |
| 585 | 'skin', |
| 586 | array( |
| 587 | 'label' => __( 'Choose Skin', 'premium-addons-for-elementor' ), |
| 588 | 'type' => Controls_Manager::SELECT, |
| 589 | 'default' => 'skin1', |
| 590 | 'options' => array( |
| 591 | 'skin1' => apply_filters( 'pa_pro_label', __( 'Skin 1', 'premium-addons-for-elementor' ) ), |
| 592 | 'skin2' => apply_filters( 'pa_pro_label', __( 'Skin 2 (Pro)', 'premium-addons-for-elementor' ) ), |
| 593 | 'skin3' => apply_filters( 'pa_pro_label', __( 'Skin 3 (Pro)', 'premium-addons-for-elementor' ) ), |
| 594 | 'skin4' => apply_filters( 'pa_pro_label', __( 'Skin 4 (Pro)', 'premium-addons-for-elementor' ) ), |
| 595 | ), |
| 596 | 'prefix_class' => 'premium-testimonial__', |
| 597 | 'label_block' => true, |
| 598 | 'render_type' => 'template', |
| 599 | 'frontend_available' => true, |
| 600 | ) |
| 601 | ); |
| 602 | |
| 603 | if ( ! $papro_activated ) { |
| 604 | |
| 605 | $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'testimonials-widget', 'wp-editor', 'get-pro' ); |
| 606 | |
| 607 | $this->add_control( |
| 608 | 'pro_skins_notice', |
| 609 | array( |
| 610 | 'type' => Controls_Manager::RAW_HTML, |
| 611 | 'raw' => __( 'This option is available in Premium Addons Pro. ', 'premium-addons-for-elementor' ) . '<a href="' . esc_url( $get_pro ) . '" target="_blank">' . __( 'Upgrade now!', 'premium-addons-for-elementor' ) . '</a>', |
| 612 | 'content_classes' => 'papro-upgrade-notice', |
| 613 | 'condition' => array( |
| 614 | 'skin!' => 'skin1', |
| 615 | ), |
| 616 | ) |
| 617 | ); |
| 618 | |
| 619 | } |
| 620 | |
| 621 | $this->add_control( |
| 622 | 'skin_notice', |
| 623 | array( |
| 624 | 'raw' => __( 'This skin can be used with four or more testimonials.', 'premium-addons-for-elementor' ), |
| 625 | 'type' => Controls_Manager::RAW_HTML, |
| 626 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 627 | 'condition' => array( |
| 628 | 'multiple' => 'yes', |
| 629 | 'skin' => 'skin4', |
| 630 | ), |
| 631 | ) |
| 632 | ); |
| 633 | |
| 634 | $this->add_control( |
| 635 | 'show_image', |
| 636 | array( |
| 637 | 'label' => __( 'Show Author Image', 'premium-addons-for-elementor' ), |
| 638 | 'type' => Controls_Manager::SWITCHER, |
| 639 | 'default' => 'yes', |
| 640 | 'condition' => array( |
| 641 | 'skin!' => 'skin4', |
| 642 | ), |
| 643 | ) |
| 644 | ); |
| 645 | |
| 646 | $this->add_control( |
| 647 | 'img_position', |
| 648 | array( |
| 649 | 'label' => __( 'Image Position', 'premium-addons-for-elementor' ), |
| 650 | 'type' => Controls_Manager::SELECT, |
| 651 | 'options' => array( |
| 652 | 'relative' => __( 'Relative', 'premium-addons-for-elementor' ), |
| 653 | 'absolute' => __( 'Absolute', 'premium-addons-for-elementor' ), |
| 654 | ), |
| 655 | 'default' => 'relative', |
| 656 | 'label_block' => true, |
| 657 | 'frontend_available' => true, |
| 658 | 'condition' => array( |
| 659 | 'show_image' => 'yes', |
| 660 | 'skin' => 'skin1', |
| 661 | ), |
| 662 | ) |
| 663 | ); |
| 664 | |
| 665 | $this->add_control( |
| 666 | 'img_place', |
| 667 | array( |
| 668 | 'label' => __( 'Select Position', 'premium-addons-for-elementor' ), |
| 669 | 'type' => Controls_Manager::CHOOSE, |
| 670 | 'options' => array( |
| 671 | 'top' => array( |
| 672 | 'title' => __( 'Top', 'premium-addons-for-elementor' ), |
| 673 | 'icon' => 'eicon-flex eicon-justify-start-h premium-rotate-icon', |
| 674 | ), |
| 675 | 'bottom' => array( |
| 676 | 'title' => __( 'Bottom', 'premium-addons-for-elementor' ), |
| 677 | 'icon' => 'eicon-flex eicon-justify-end-h premium-rotate-icon', |
| 678 | ), |
| 679 | ), |
| 680 | 'default' => 'top', |
| 681 | 'prefix_class' => 'premium-testimonial__img-', |
| 682 | 'label_block' => true, |
| 683 | 'condition' => array( |
| 684 | 'show_image' => 'yes', |
| 685 | 'skin' => 'skin1', |
| 686 | 'img_position' => 'absolute', |
| 687 | ), |
| 688 | ) |
| 689 | ); |
| 690 | |
| 691 | if ( $papro_activated ) { |
| 692 | |
| 693 | do_action( 'pa_testimonials_skins_options', $this ); |
| 694 | |
| 695 | } |
| 696 | |
| 697 | $this->add_control( |
| 698 | 'premium_testimonial_person_name_size', |
| 699 | array( |
| 700 | 'label' => __( 'Name HTML Tag', 'premium-addons-for-elementor' ), |
| 701 | 'type' => Controls_Manager::SELECT, |
| 702 | 'options' => array( |
| 703 | 'h1' => 'H1', |
| 704 | 'h2' => 'H2', |
| 705 | 'h3' => 'H3', |
| 706 | 'h4' => 'H4', |
| 707 | 'h5' => 'H5', |
| 708 | 'h6' => 'H6', |
| 709 | 'div' => 'div', |
| 710 | 'span' => 'span', |
| 711 | 'p' => 'p', |
| 712 | ), |
| 713 | 'default' => 'h3', |
| 714 | 'separator' => 'before', |
| 715 | 'label_block' => true, |
| 716 | ) |
| 717 | ); |
| 718 | |
| 719 | $this->add_control( |
| 720 | 'premium_testimonial_company_name_size', |
| 721 | array( |
| 722 | 'label' => __( 'Job HTML Tag', 'premium-addons-for-elementor' ), |
| 723 | 'type' => Controls_Manager::SELECT, |
| 724 | 'options' => array( |
| 725 | 'h1' => 'H1', |
| 726 | 'h2' => 'H2', |
| 727 | 'h3' => 'H3', |
| 728 | 'h4' => 'H4', |
| 729 | 'h5' => 'H5', |
| 730 | 'h6' => 'H6', |
| 731 | 'div' => 'div', |
| 732 | 'span' => 'span', |
| 733 | 'p' => 'p', |
| 734 | ), |
| 735 | 'default' => 'h4', |
| 736 | 'label_block' => true, |
| 737 | ) |
| 738 | ); |
| 739 | |
| 740 | $this->add_control( |
| 741 | 'icon_style', |
| 742 | array( |
| 743 | 'label' => __( 'Quotation Skin', 'premium-addons-for-elementor' ), |
| 744 | 'type' => Controls_Manager::SELECT, |
| 745 | 'options' => array( |
| 746 | 'rounded' => __( 'Rounded', 'premium-addons-for-elementor' ), |
| 747 | 'sharp' => __( 'Sharp', 'premium-addons-for-elementor' ), |
| 748 | ), |
| 749 | 'default' => 'rounded', |
| 750 | 'label_block' => true, |
| 751 | ) |
| 752 | ); |
| 753 | |
| 754 | $this->add_control( |
| 755 | 'premium_testimonial_layout', |
| 756 | array( |
| 757 | 'label' => esc_html__( 'Layout', 'premium-addons-for-elementor' ), |
| 758 | 'type' => Controls_Manager::CHOOSE, |
| 759 | 'render_type' => 'template', |
| 760 | 'separator' => 'before', |
| 761 | 'options' => array( |
| 762 | 'grid' => array( |
| 763 | 'title' => esc_html__( 'Grid', 'premium-addons-for-elementor' ), |
| 764 | 'icon' => 'eicon-gallery-grid', |
| 765 | ), |
| 766 | 'masonry' => array( |
| 767 | 'title' => esc_html__( 'Masonry', 'premium-addons-for-elementor' ), |
| 768 | 'icon' => 'eicon-gallery-masonry', |
| 769 | ), |
| 770 | ), |
| 771 | 'label_block' => true, |
| 772 | 'frontend_available' => true, |
| 773 | 'default' => 'grid', |
| 774 | 'condition' => array( |
| 775 | 'multiple' => 'yes', |
| 776 | 'skin!' => 'skin4', |
| 777 | 'carousel!' => 'yes', |
| 778 | ), |
| 779 | ) |
| 780 | ); |
| 781 | |
| 782 | $this->add_responsive_control( |
| 783 | 'testimonials_per_row', |
| 784 | array( |
| 785 | 'label' => __( 'Members/Row', 'premium-addons-for-elementor' ), |
| 786 | 'type' => Controls_Manager::SELECT, |
| 787 | 'options' => array( |
| 788 | '100%' => __( '1 Column', 'premium-addons-for-elementor' ), |
| 789 | '50%' => __( '2 Columns', 'premium-addons-for-elementor' ), |
| 790 | '33.33%' => __( '3 Columns', 'premium-addons-for-elementor' ), |
| 791 | '25%' => __( '4 Columns', 'premium-addons-for-elementor' ), |
| 792 | '20%' => __( '5 Columns', 'premium-addons-for-elementor' ), |
| 793 | '16.667%' => __( '6 Columns', 'premium-addons-for-elementor' ), |
| 794 | ), |
| 795 | 'default' => '33.33%', |
| 796 | 'tablet_default' => '100%', |
| 797 | 'mobile_default' => '100%', |
| 798 | 'render_type' => 'template', |
| 799 | 'selectors' => array( |
| 800 | '{{WRAPPER}} .premium-testimonial-container' => 'width: {{VALUE}}', |
| 801 | ), |
| 802 | 'separator' => 'before', |
| 803 | 'condition' => array( |
| 804 | 'multiple' => 'yes', |
| 805 | 'skin!' => 'skin4', |
| 806 | ), |
| 807 | 'frontend_available' => true, |
| 808 | ) |
| 809 | ); |
| 810 | |
| 811 | $this->add_responsive_control( |
| 812 | 'spacing', |
| 813 | array( |
| 814 | 'label' => __( 'Spacing', 'premium-addons-for-elementor' ), |
| 815 | 'type' => Controls_Manager::DIMENSIONS, |
| 816 | 'size_units' => array( 'px', '%', 'em' ), |
| 817 | 'default' => array( |
| 818 | 'top' => 5, |
| 819 | 'right' => 5, |
| 820 | 'bottom' => 5, |
| 821 | 'left' => 5, |
| 822 | ), |
| 823 | 'condition' => array( |
| 824 | 'multiple' => 'yes', |
| 825 | ), |
| 826 | 'selectors' => array( |
| 827 | '{{WRAPPER}} .premium-testimonial-container' => 'padding: 0 {{RIGHT}}{{UNIT}} 0 {{LEFT}}{{UNIT}}; margin: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} 0', |
| 828 | ), |
| 829 | ) |
| 830 | ); |
| 831 | |
| 832 | $this->add_control( |
| 833 | 'spacing_notice', |
| 834 | array( |
| 835 | 'raw' => __( 'Note, you may need to give a top/bottom spacing if you are not seeing the whole quotation icon or the author image.', 'premium-addons-for-elementor' ), |
| 836 | 'type' => Controls_Manager::RAW_HTML, |
| 837 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', |
| 838 | ) |
| 839 | ); |
| 840 | |
| 841 | $this->add_control( |
| 842 | 'equal_height', |
| 843 | array( |
| 844 | 'label' => __( 'Equal Height', 'premium-addons-for-elementor' ), |
| 845 | 'type' => Controls_Manager::SWITCHER, |
| 846 | 'render_type' => 'template', |
| 847 | 'description' => __( 'This option searches for the testimonial with the largest height and applies that height to the other testimonials', 'premium-addons-for-elementor' ), |
| 848 | 'prefix_class' => 'premium-testimonial__equal-', |
| 849 | 'conditions' => array( |
| 850 | 'relation' => 'and', |
| 851 | 'terms' => array( |
| 852 | array( |
| 853 | 'name' => 'multiple', |
| 854 | 'operator' => '===', |
| 855 | 'value' => 'yes', |
| 856 | ), |
| 857 | array( |
| 858 | 'relation' => 'or', |
| 859 | 'terms' => array( |
| 860 | array( |
| 861 | 'name' => 'premium_testimonial_layout', |
| 862 | 'operator' => '!==', |
| 863 | 'value' => 'masonry', |
| 864 | ), |
| 865 | array( |
| 866 | 'name' => 'carousel', |
| 867 | 'operator' => '===', |
| 868 | 'value' => 'yes', |
| 869 | ), |
| 870 | ), |
| 871 | ), |
| 872 | ), |
| 873 | ), |
| 874 | ) |
| 875 | ); |
| 876 | |
| 877 | $this->end_controls_section(); |
| 878 | |
| 879 | $this->start_controls_section( |
| 880 | 'section_pa_docs', |
| 881 | array( |
| 882 | 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ), |
| 883 | ) |
| 884 | ); |
| 885 | |
| 886 | $doc_url = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/docs/why-im-not-able-to-see-elementor-font-awesome-5-icons-in-premium-add-ons', 'testimonials-widget', 'wp-editor', 'get-support' ); |
| 887 | $title = __( 'I\'m not able to see Font Awesome icons in the widget »', 'premium-addons-for-elementor' ); |
| 888 | |
| 889 | $this->add_control( |
| 890 | 'doc_1', |
| 891 | array( |
| 892 | 'type' => Controls_Manager::RAW_HTML, |
| 893 | 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ), |
| 894 | 'content_classes' => 'editor-pa-doc', |
| 895 | ) |
| 896 | ); |
| 897 | |
| 898 | Helper_Functions::register_element_feedback_controls( $this ); |
| 899 | |
| 900 | $this->end_controls_section(); |
| 901 | |
| 902 | Helper_Functions::register_papro_promotion_controls( $this, 'testimonials' ); |
| 903 | |
| 904 | $this->start_controls_section( |
| 905 | 'premium_testimonial_image_style', |
| 906 | array( |
| 907 | 'label' => __( 'Author Image', 'premium-addons-for-elementor' ), |
| 908 | 'tab' => Controls_Manager::TAB_STYLE, |
| 909 | 'condition' => array( |
| 910 | 'show_image' => 'yes', |
| 911 | ), |
| 912 | ) |
| 913 | ); |
| 914 | |
| 915 | $this->add_control( |
| 916 | 'premium_testimonial_img_size', |
| 917 | array( |
| 918 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 919 | 'type' => Controls_Manager::SLIDER, |
| 920 | 'size_units' => array( 'px', 'em' ), |
| 921 | 'default' => array( |
| 922 | 'unit' => 'px', |
| 923 | 'size' => 100, |
| 924 | ), |
| 925 | 'range' => array( |
| 926 | 'px' => array( |
| 927 | 'min' => 10, |
| 928 | 'max' => 150, |
| 929 | ), |
| 930 | ), |
| 931 | 'selectors' => array( |
| 932 | '{{WRAPPER}} .premium-testimonial-img-wrapper' => 'width: {{SIZE}}{{UNIT}}; height:{{SIZE}}{{UNIT}}', |
| 933 | '{{WRAPPER}} .premium-testimonial__carousel' => 'width: calc( 3 * {{SIZE}}{{UNIT}} )', |
| 934 | ), |
| 935 | ) |
| 936 | ); |
| 937 | |
| 938 | $this->add_group_control( |
| 939 | Group_Control_Border::get_type(), |
| 940 | array( |
| 941 | 'name' => 'img_border', |
| 942 | 'selector' => '{{WRAPPER}} .premium-testimonial-img-wrapper', |
| 943 | ) |
| 944 | ); |
| 945 | |
| 946 | $this->add_control( |
| 947 | 'active_border', |
| 948 | array( |
| 949 | 'label' => __( 'Active Border Color', 'premium-addons-for-elementor' ), |
| 950 | 'type' => Controls_Manager::COLOR, |
| 951 | 'selectors' => array( |
| 952 | '{{WRAPPER}} .slick-center .premium-testimonial-img-wrapper' => 'border-color: {{VALUE}} !important', |
| 953 | ), |
| 954 | 'condition' => array( |
| 955 | 'multiple' => 'yes', |
| 956 | 'skin' => 'skin4', |
| 957 | ), |
| 958 | ) |
| 959 | ); |
| 960 | |
| 961 | $this->add_control( |
| 962 | 'img_border_radius', |
| 963 | array( |
| 964 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 965 | 'type' => Controls_Manager::SLIDER, |
| 966 | 'size_units' => array( 'px', '%', 'em' ), |
| 967 | 'selectors' => array( |
| 968 | '{{WRAPPER}} .premium-testimonial-img-wrapper' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 969 | ), |
| 970 | ) |
| 971 | ); |
| 972 | |
| 973 | $this->add_group_control( |
| 974 | Group_Control_Css_Filter::get_type(), |
| 975 | array( |
| 976 | 'name' => 'css_filters', |
| 977 | 'selector' => '{{WRAPPER}} .premium-testimonial-img-wrapper', |
| 978 | ) |
| 979 | ); |
| 980 | |
| 981 | $this->add_group_control( |
| 982 | Group_Control_Css_Filter::get_type(), |
| 983 | array( |
| 984 | 'name' => 'hover_css_filters', |
| 985 | 'label' => __( 'Hover CSS Filters', 'premium-addons-for-elementor' ), |
| 986 | 'selector' => '{{WRAPPER}} .premium-testimonial-container:hover .premium-testimonial-img-wrapper', |
| 987 | ) |
| 988 | ); |
| 989 | |
| 990 | $this->end_controls_section(); |
| 991 | |
| 992 | $this->start_controls_section( |
| 993 | 'heading_style_section', |
| 994 | array( |
| 995 | 'label' => __( 'Heading', 'premium-addons-for-elementor' ), |
| 996 | 'tab' => Controls_Manager::TAB_STYLE, |
| 997 | ) |
| 998 | ); |
| 999 | |
| 1000 | $this->add_control( |
| 1001 | 'heading_color', |
| 1002 | array( |
| 1003 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1004 | 'type' => Controls_Manager::COLOR, |
| 1005 | 'global' => array( |
| 1006 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1007 | ), |
| 1008 | 'selectors' => array( |
| 1009 | '{{WRAPPER}} .premium-testimonial-heading' => 'color: {{VALUE}};', |
| 1010 | ), |
| 1011 | ) |
| 1012 | ); |
| 1013 | |
| 1014 | $this->add_group_control( |
| 1015 | Group_Control_Typography::get_type(), |
| 1016 | array( |
| 1017 | 'name' => 'heading_typography', |
| 1018 | 'selector' => '{{WRAPPER}} .premium-testimonial-heading', |
| 1019 | ) |
| 1020 | ); |
| 1021 | |
| 1022 | $this->add_group_control( |
| 1023 | Group_Control_Text_Shadow::get_type(), |
| 1024 | array( |
| 1025 | 'name' => 'heading_shadow', |
| 1026 | 'selector' => '{{WRAPPER}} .premium-testimonial-heading', |
| 1027 | ) |
| 1028 | ); |
| 1029 | |
| 1030 | $this->add_responsive_control( |
| 1031 | 'heading_margin', |
| 1032 | array( |
| 1033 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1034 | 'type' => Controls_Manager::DIMENSIONS, |
| 1035 | 'size_units' => array( 'px', 'em', '%' ), |
| 1036 | 'selectors' => array( |
| 1037 | '{{WRAPPER}} .premium-testimonial-heading' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};', |
| 1038 | ), |
| 1039 | ) |
| 1040 | ); |
| 1041 | |
| 1042 | $this->end_controls_section(); |
| 1043 | |
| 1044 | $this->start_controls_section( |
| 1045 | 'person_style_section', |
| 1046 | array( |
| 1047 | 'label' => __( 'Author', 'premium-addons-for-elementor' ), |
| 1048 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1049 | ) |
| 1050 | ); |
| 1051 | |
| 1052 | $this->add_control( |
| 1053 | 'premium_testimonial_person_name_color', |
| 1054 | array( |
| 1055 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1056 | 'type' => Controls_Manager::COLOR, |
| 1057 | 'selectors' => array( |
| 1058 | '{{WRAPPER}} .premium-testimonial-person-name' => 'color: {{VALUE}};', |
| 1059 | ), |
| 1060 | ) |
| 1061 | ); |
| 1062 | |
| 1063 | $this->add_group_control( |
| 1064 | Group_Control_Typography::get_type(), |
| 1065 | array( |
| 1066 | 'name' => 'author_name_typography', |
| 1067 | 'selector' => '{{WRAPPER}} .premium-testimonial-person-name', |
| 1068 | ) |
| 1069 | ); |
| 1070 | |
| 1071 | $this->add_group_control( |
| 1072 | Group_Control_Text_Shadow::get_type(), |
| 1073 | array( |
| 1074 | 'name' => 'author_name_shadow', |
| 1075 | 'selector' => '{{WRAPPER}} .premium-testimonial-person-name', |
| 1076 | ) |
| 1077 | ); |
| 1078 | |
| 1079 | $this->add_responsive_control( |
| 1080 | 'name_margin', |
| 1081 | array( |
| 1082 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1083 | 'type' => Controls_Manager::DIMENSIONS, |
| 1084 | 'size_units' => array( 'px', 'em', '%' ), |
| 1085 | 'selectors' => array( |
| 1086 | '{{WRAPPER}} .premium-testimonial-person-name' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};', |
| 1087 | ), |
| 1088 | ) |
| 1089 | ); |
| 1090 | |
| 1091 | $this->end_controls_section(); |
| 1092 | |
| 1093 | $this->start_controls_section( |
| 1094 | 'company_style_section', |
| 1095 | array( |
| 1096 | 'label' => __( 'Job', 'premium-addons-for-elementor' ), |
| 1097 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1098 | ) |
| 1099 | ); |
| 1100 | |
| 1101 | $this->add_responsive_control( |
| 1102 | 'job_align', |
| 1103 | array( |
| 1104 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 1105 | 'type' => Controls_Manager::CHOOSE, |
| 1106 | 'options' => array( |
| 1107 | 'flex-start' => array( |
| 1108 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 1109 | 'icon' => 'eicon-text-align-left', |
| 1110 | ), |
| 1111 | 'center' => array( |
| 1112 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 1113 | 'icon' => 'eicon-text-align-center', |
| 1114 | ), |
| 1115 | 'flex-end' => array( |
| 1116 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 1117 | 'icon' => 'eicon-text-align-right', |
| 1118 | ), |
| 1119 | ), |
| 1120 | 'default' => 'center', |
| 1121 | 'toggle' => false, |
| 1122 | 'selectors' => array( |
| 1123 | '{{WRAPPER}} .premium-testimonial-author-info' => 'align-items: {{VALUE}}', |
| 1124 | ), |
| 1125 | ) |
| 1126 | ); |
| 1127 | |
| 1128 | $this->add_control( |
| 1129 | 'premium_testimonial_company_name_color', |
| 1130 | array( |
| 1131 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1132 | 'type' => Controls_Manager::COLOR, |
| 1133 | 'global' => array( |
| 1134 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1135 | ), |
| 1136 | 'selectors' => array( |
| 1137 | '{{WRAPPER}} .premium-testimonial-company-link' => 'color: {{VALUE}};', |
| 1138 | ), |
| 1139 | ) |
| 1140 | ); |
| 1141 | |
| 1142 | $this->add_group_control( |
| 1143 | Group_Control_Typography::get_type(), |
| 1144 | array( |
| 1145 | 'name' => 'company_name_typography', |
| 1146 | 'selector' => '{{WRAPPER}} .premium-testimonial-company-link', |
| 1147 | ) |
| 1148 | ); |
| 1149 | |
| 1150 | $this->add_group_control( |
| 1151 | Group_Control_Text_Shadow::get_type(), |
| 1152 | array( |
| 1153 | 'name' => 'company_name_shadow', |
| 1154 | 'selector' => '{{WRAPPER}} .premium-testimonial-company-link', |
| 1155 | ) |
| 1156 | ); |
| 1157 | |
| 1158 | $this->add_responsive_control( |
| 1159 | 'job_margin', |
| 1160 | array( |
| 1161 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1162 | 'type' => Controls_Manager::DIMENSIONS, |
| 1163 | 'size_units' => array( 'px', 'em', '%' ), |
| 1164 | 'selectors' => array( |
| 1165 | '{{WRAPPER}} .premium-testimonial-job' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};', |
| 1166 | ), |
| 1167 | ) |
| 1168 | ); |
| 1169 | |
| 1170 | $this->end_controls_section(); |
| 1171 | |
| 1172 | $this->start_controls_section( |
| 1173 | 'rating_style_section', |
| 1174 | array( |
| 1175 | 'label' => __( 'Rating Score', 'premium-addons-for-elementor' ), |
| 1176 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1177 | ) |
| 1178 | ); |
| 1179 | |
| 1180 | $this->add_control( |
| 1181 | 'star_size', |
| 1182 | array( |
| 1183 | 'label' => __( 'Star Size', 'premium-addons-for-elementor' ), |
| 1184 | 'type' => Controls_Manager::NUMBER, |
| 1185 | 'min' => 1, |
| 1186 | 'max' => 50, |
| 1187 | 'default' => 15, |
| 1188 | ) |
| 1189 | ); |
| 1190 | |
| 1191 | $this->add_control( |
| 1192 | 'fill', |
| 1193 | array( |
| 1194 | 'label' => __( 'Star Color', 'premium-addons-for-elementor' ), |
| 1195 | 'type' => Controls_Manager::COLOR, |
| 1196 | 'global' => false, |
| 1197 | 'default' => '#ffab40', |
| 1198 | ) |
| 1199 | ); |
| 1200 | |
| 1201 | $this->add_control( |
| 1202 | 'empty', |
| 1203 | array( |
| 1204 | 'label' => __( 'Empty Star Color', 'premium-addons-for-elementor' ), |
| 1205 | 'type' => Controls_Manager::COLOR, |
| 1206 | 'global' => false, |
| 1207 | ) |
| 1208 | ); |
| 1209 | |
| 1210 | $this->add_control( |
| 1211 | 'rating_spacing', |
| 1212 | array( |
| 1213 | 'label' => __( 'Spacing', 'premium-addons-for-elementor' ), |
| 1214 | 'type' => Controls_Manager::SLIDER, |
| 1215 | 'size_units' => array( 'px', 'em', 'custom' ), |
| 1216 | 'selectors' => array( |
| 1217 | '{{WRAPPER}} .premium-fb-rev-star:not(:last-child)' => 'margin-inline-end: {{SIZE}}{{UNIT}};', |
| 1218 | ), |
| 1219 | ) |
| 1220 | ); |
| 1221 | |
| 1222 | $this->add_responsive_control( |
| 1223 | 'rating_margin', |
| 1224 | array( |
| 1225 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1226 | 'type' => Controls_Manager::DIMENSIONS, |
| 1227 | 'size_units' => array( 'px', 'em', '%' ), |
| 1228 | 'selectors' => array( |
| 1229 | '{{WRAPPER}} .premium-testimonial__rating-wrapper' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};', |
| 1230 | ), |
| 1231 | ) |
| 1232 | ); |
| 1233 | |
| 1234 | $this->end_controls_section(); |
| 1235 | |
| 1236 | $this->start_controls_section( |
| 1237 | 'content_style_section', |
| 1238 | array( |
| 1239 | 'label' => __( 'Content', 'premium-addons-for-elementor' ), |
| 1240 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1241 | ) |
| 1242 | ); |
| 1243 | |
| 1244 | $this->add_control( |
| 1245 | 'premium_testimonial_content_color', |
| 1246 | array( |
| 1247 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1248 | 'type' => Controls_Manager::COLOR, |
| 1249 | 'global' => array( |
| 1250 | 'default' => Global_Colors::COLOR_TEXT, |
| 1251 | ), |
| 1252 | 'selectors' => array( |
| 1253 | '{{WRAPPER}} .premium-testimonial-text-wrapper' => 'color: {{VALUE}};', |
| 1254 | ), |
| 1255 | ) |
| 1256 | ); |
| 1257 | |
| 1258 | $this->add_group_control( |
| 1259 | Group_Control_Typography::get_type(), |
| 1260 | array( |
| 1261 | 'name' => 'content_typography', |
| 1262 | 'selector' => '{{WRAPPER}} .premium-testimonial-text-wrapper', |
| 1263 | ) |
| 1264 | ); |
| 1265 | |
| 1266 | $this->add_responsive_control( |
| 1267 | 'premium_testimonial_margin', |
| 1268 | array( |
| 1269 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1270 | 'type' => Controls_Manager::DIMENSIONS, |
| 1271 | 'size_units' => array( 'px', 'em', '%' ), |
| 1272 | 'selectors' => array( |
| 1273 | '{{WRAPPER}} .premium-testimonial-text-wrapper' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};', |
| 1274 | ), |
| 1275 | ) |
| 1276 | ); |
| 1277 | |
| 1278 | $this->end_controls_section(); |
| 1279 | |
| 1280 | $this->start_controls_section( |
| 1281 | 'quotes_style_section', |
| 1282 | array( |
| 1283 | 'label' => __( 'Quotation Icon', 'premium-addons-for-elementor' ), |
| 1284 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1285 | ) |
| 1286 | ); |
| 1287 | |
| 1288 | $this->add_control( |
| 1289 | 'premium_testimonial_quote_icon_color', |
| 1290 | array( |
| 1291 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1292 | 'type' => Controls_Manager::COLOR, |
| 1293 | 'default' => '#58BFCA', |
| 1294 | 'selectors' => array( |
| 1295 | '{{WRAPPER}} .premium-testimonial-quote' => 'fill: {{VALUE}};', |
| 1296 | ), |
| 1297 | ) |
| 1298 | ); |
| 1299 | |
| 1300 | $this->add_responsive_control( |
| 1301 | 'premium_testimonial_quotes_size', |
| 1302 | array( |
| 1303 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 1304 | 'type' => Controls_Manager::SLIDER, |
| 1305 | 'size_units' => array( 'px', 'em', '%' ), |
| 1306 | 'range' => array( |
| 1307 | 'px' => array( |
| 1308 | 'min' => 5, |
| 1309 | 'max' => 250, |
| 1310 | ), |
| 1311 | ), |
| 1312 | 'selectors' => array( |
| 1313 | '{{WRAPPER}} .premium-testimonial-upper-quote svg, {{WRAPPER}} .premium-testimonial-lower-quote svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}', |
| 1314 | ), |
| 1315 | ) |
| 1316 | ); |
| 1317 | |
| 1318 | $this->add_responsive_control( |
| 1319 | 'premium_testimonial_upper_quote_position', |
| 1320 | array( |
| 1321 | 'label' => __( 'Top Icon Position', 'premium-addons-for-elementor' ), |
| 1322 | 'type' => Controls_Manager::DIMENSIONS, |
| 1323 | 'size_units' => array( 'px', 'em', '%' ), |
| 1324 | // 'default' => array( |
| 1325 | // 'top' => 0, |
| 1326 | // 'left' => 12, |
| 1327 | // 'unit' => 'px', |
| 1328 | // ), |
| 1329 | 'selectors' => array( |
| 1330 | '{{WRAPPER}} .premium-testimonial-upper-quote' => 'top: {{TOP}}{{UNIT}}; left:{{LEFT}}{{UNIT}};', |
| 1331 | ), |
| 1332 | 'condition' => array( |
| 1333 | 'skin!' => 'skin3', |
| 1334 | ), |
| 1335 | ) |
| 1336 | ); |
| 1337 | |
| 1338 | $this->add_responsive_control( |
| 1339 | 'premium_testimonial_lower_quote_position', |
| 1340 | array( |
| 1341 | 'label' => __( 'Bottom Icon Position', 'premium-addons-for-elementor' ), |
| 1342 | 'type' => Controls_Manager::DIMENSIONS, |
| 1343 | 'size_units' => array( 'px', 'em', '%' ), |
| 1344 | // 'default' => array( |
| 1345 | // 'bottom' => 3, |
| 1346 | // 'right' => 12, |
| 1347 | // 'unit' => 'px', |
| 1348 | // ), |
| 1349 | 'selectors' => array( |
| 1350 | '{{WRAPPER}} .premium-testimonial-lower-quote' => 'right: {{RIGHT}}{{UNIT}}; bottom: {{BOTTOM}}{{UNIT}};', |
| 1351 | ), |
| 1352 | 'condition' => array( |
| 1353 | 'skin!' => array( 'skin2', 'skin4' ), |
| 1354 | ), |
| 1355 | ) |
| 1356 | ); |
| 1357 | |
| 1358 | $this->end_controls_section(); |
| 1359 | |
| 1360 | $this->start_controls_section( |
| 1361 | 'carousel_style_section', |
| 1362 | array( |
| 1363 | 'label' => __( 'Carousel Arrows', 'premium-addons-for-elementor' ), |
| 1364 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1365 | // 'condition' => array( |
| 1366 | // 'carousel' => 'yes', |
| 1367 | // 'skin!' => 'skin4', |
| 1368 | // ), |
| 1369 | 'conditions' => array( |
| 1370 | 'terms' => array( |
| 1371 | array( |
| 1372 | 'name' => 'multiple', |
| 1373 | 'value' => 'yes', |
| 1374 | ), |
| 1375 | array( |
| 1376 | 'relation' => 'or', |
| 1377 | 'terms' => array( |
| 1378 | array( |
| 1379 | 'terms' => array( |
| 1380 | array( |
| 1381 | 'name' => 'skin', |
| 1382 | 'operator' => '!==', |
| 1383 | 'value' => 'skin4', |
| 1384 | ), |
| 1385 | array( |
| 1386 | 'name' => 'carousel', |
| 1387 | 'operator' => '===', |
| 1388 | 'value' => 'yes', |
| 1389 | ), |
| 1390 | ), |
| 1391 | ), |
| 1392 | array( |
| 1393 | 'terms' => array( |
| 1394 | array( |
| 1395 | 'name' => 'skin', |
| 1396 | 'operator' => '===', |
| 1397 | 'value' => 'skin4', |
| 1398 | ), |
| 1399 | ), |
| 1400 | ), |
| 1401 | |
| 1402 | ), |
| 1403 | ), |
| 1404 | ), |
| 1405 | ), |
| 1406 | ) |
| 1407 | ); |
| 1408 | |
| 1409 | $this->add_responsive_control( |
| 1410 | 'carousel_arrows_pos', |
| 1411 | array( |
| 1412 | 'label' => __( 'Horizontal Position', 'premium-addons-for-elementor' ), |
| 1413 | 'type' => Controls_Manager::SLIDER, |
| 1414 | 'size_units' => array( 'px', 'em' ), |
| 1415 | 'range' => array( |
| 1416 | 'px' => array( |
| 1417 | 'min' => -100, |
| 1418 | 'max' => 100, |
| 1419 | ), |
| 1420 | 'em' => array( |
| 1421 | 'min' => -10, |
| 1422 | 'max' => 10, |
| 1423 | ), |
| 1424 | ), |
| 1425 | 'conditions' => array( |
| 1426 | 'terms' => array( |
| 1427 | array( |
| 1428 | 'name' => 'multiple', |
| 1429 | 'value' => 'yes', |
| 1430 | ), |
| 1431 | array( |
| 1432 | 'relation' => 'or', |
| 1433 | 'terms' => array( |
| 1434 | array( |
| 1435 | 'terms' => array( |
| 1436 | array( |
| 1437 | 'name' => 'skin', |
| 1438 | 'operator' => '!==', |
| 1439 | 'value' => 'skin4', |
| 1440 | ), |
| 1441 | array( |
| 1442 | 'name' => 'carousel', |
| 1443 | 'operator' => '===', |
| 1444 | 'value' => 'yes', |
| 1445 | ), |
| 1446 | ), |
| 1447 | ), |
| 1448 | array( |
| 1449 | 'terms' => array( |
| 1450 | array( |
| 1451 | 'name' => 'skin', |
| 1452 | 'operator' => '===', |
| 1453 | 'value' => 'skin4', |
| 1454 | ), |
| 1455 | ), |
| 1456 | ), |
| 1457 | |
| 1458 | ), |
| 1459 | ), |
| 1460 | ), |
| 1461 | ), |
| 1462 | 'selectors' => array( |
| 1463 | '{{WRAPPER}} .premium-testimonial-box a.carousel-arrow.carousel-next' => 'right: {{SIZE}}{{UNIT}};', |
| 1464 | '{{WRAPPER}} .premium-testimonial-box a.carousel-arrow.carousel-prev' => 'left: {{SIZE}}{{UNIT}};', |
| 1465 | ), |
| 1466 | ) |
| 1467 | ); |
| 1468 | |
| 1469 | $this->add_responsive_control( |
| 1470 | 'carousel_arrows_vpos', |
| 1471 | array( |
| 1472 | 'label' => __( 'Vertical Position', 'premium-addons-for-elementor' ), |
| 1473 | 'type' => Controls_Manager::SLIDER, |
| 1474 | 'size_units' => array( 'px', 'em', '%' ), |
| 1475 | 'range' => array( |
| 1476 | 'px' => array( |
| 1477 | 'min' => 0, |
| 1478 | 'max' => 600, |
| 1479 | ), |
| 1480 | 'em' => array( |
| 1481 | 'min' => 0, |
| 1482 | 'max' => 20, |
| 1483 | ), |
| 1484 | ), |
| 1485 | 'conditions' => array( |
| 1486 | 'terms' => array( |
| 1487 | array( |
| 1488 | 'name' => 'multiple', |
| 1489 | 'value' => 'yes', |
| 1490 | ), |
| 1491 | array( |
| 1492 | 'relation' => 'or', |
| 1493 | 'terms' => array( |
| 1494 | array( |
| 1495 | 'terms' => array( |
| 1496 | array( |
| 1497 | 'name' => 'skin', |
| 1498 | 'operator' => '!==', |
| 1499 | 'value' => 'skin4', |
| 1500 | ), |
| 1501 | array( |
| 1502 | 'name' => 'carousel', |
| 1503 | 'operator' => '===', |
| 1504 | 'value' => 'yes', |
| 1505 | ), |
| 1506 | ), |
| 1507 | ), |
| 1508 | array( |
| 1509 | 'terms' => array( |
| 1510 | array( |
| 1511 | 'name' => 'skin', |
| 1512 | 'operator' => '===', |
| 1513 | 'value' => 'skin4', |
| 1514 | ), |
| 1515 | ), |
| 1516 | ), |
| 1517 | |
| 1518 | ), |
| 1519 | ), |
| 1520 | ), |
| 1521 | ), |
| 1522 | 'selectors' => array( |
| 1523 | '{{WRAPPER}} .premium-testimonial-box a.carousel-arrow' => 'top: {{SIZE}}{{UNIT}};', |
| 1524 | ), |
| 1525 | ) |
| 1526 | ); |
| 1527 | |
| 1528 | $this->add_control( |
| 1529 | 'arrow_color', |
| 1530 | array( |
| 1531 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1532 | 'type' => Controls_Manager::COLOR, |
| 1533 | 'global' => array( |
| 1534 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1535 | ), |
| 1536 | 'selectors' => array( |
| 1537 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'color: {{VALUE}};', |
| 1538 | ), |
| 1539 | ) |
| 1540 | ); |
| 1541 | |
| 1542 | $this->add_control( |
| 1543 | 'arrow_hover_color', |
| 1544 | array( |
| 1545 | 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ), |
| 1546 | 'type' => Controls_Manager::COLOR, |
| 1547 | 'global' => array( |
| 1548 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1549 | ), |
| 1550 | 'selectors' => array( |
| 1551 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow:hover' => 'color: {{VALUE}};', |
| 1552 | ), |
| 1553 | ) |
| 1554 | ); |
| 1555 | |
| 1556 | $this->add_responsive_control( |
| 1557 | 'arrow_size', |
| 1558 | array( |
| 1559 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 1560 | 'type' => Controls_Manager::SLIDER, |
| 1561 | 'size_units' => array( 'px', '%', 'em' ), |
| 1562 | 'selectors' => array( |
| 1563 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow i' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1564 | ), |
| 1565 | ) |
| 1566 | ); |
| 1567 | |
| 1568 | $this->add_control( |
| 1569 | 'arrow_background', |
| 1570 | array( |
| 1571 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1572 | 'type' => Controls_Manager::COLOR, |
| 1573 | 'global' => array( |
| 1574 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1575 | ), |
| 1576 | 'selectors' => array( |
| 1577 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'background-color: {{VALUE}};', |
| 1578 | ), |
| 1579 | ) |
| 1580 | ); |
| 1581 | |
| 1582 | $this->add_control( |
| 1583 | 'arrow_hover_background', |
| 1584 | array( |
| 1585 | 'label' => __( 'Background Hover Color', 'premium-addons-for-elementor' ), |
| 1586 | 'type' => Controls_Manager::COLOR, |
| 1587 | 'global' => array( |
| 1588 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1589 | ), |
| 1590 | 'selectors' => array( |
| 1591 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow:hover' => 'background-color: {{VALUE}};', |
| 1592 | ), |
| 1593 | ) |
| 1594 | ); |
| 1595 | |
| 1596 | $this->add_control( |
| 1597 | 'arrows_lq_effect', |
| 1598 | array( |
| 1599 | 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ), |
| 1600 | 'type' => Controls_Manager::SELECT, |
| 1601 | 'description' => sprintf( |
| 1602 | /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */ |
| 1603 | esc_html__( 'Important: Make sure this element has a semi-transparent background color to see the effect. See all presets from %1$shere%2$s.', 'premium-addons-for-elementor' ), |
| 1604 | '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">', |
| 1605 | '</a>' |
| 1606 | ), |
| 1607 | 'options' => array( |
| 1608 | 'none' => __( 'None', 'premium-addons-for-elementor' ), |
| 1609 | 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ), |
| 1610 | 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ), |
| 1611 | 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ), |
| 1612 | 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ), |
| 1613 | 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ), |
| 1614 | 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ), |
| 1615 | ), |
| 1616 | 'frontend_available' => true, |
| 1617 | 'default' => 'none', |
| 1618 | 'label_block' => true, |
| 1619 | ) |
| 1620 | ); |
| 1621 | |
| 1622 | $this->add_control( |
| 1623 | 'arrow_border_radius', |
| 1624 | array( |
| 1625 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1626 | 'type' => Controls_Manager::SLIDER, |
| 1627 | 'size_units' => array( 'px', '%', 'em' ), |
| 1628 | 'selectors' => array( |
| 1629 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1630 | ), |
| 1631 | ) |
| 1632 | ); |
| 1633 | |
| 1634 | $this->add_control( |
| 1635 | 'arrow_padding', |
| 1636 | array( |
| 1637 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1638 | 'type' => Controls_Manager::SLIDER, |
| 1639 | 'size_units' => array( 'px', '%', 'em' ), |
| 1640 | 'selectors' => array( |
| 1641 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'padding: {{SIZE}}{{UNIT}};', |
| 1642 | ), |
| 1643 | ) |
| 1644 | ); |
| 1645 | |
| 1646 | $this->end_controls_section(); |
| 1647 | |
| 1648 | $this->start_controls_section( |
| 1649 | 'container_style_section', |
| 1650 | array( |
| 1651 | 'label' => __( 'Container', 'premium-addons-for-elementor' ), |
| 1652 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1653 | ) |
| 1654 | ); |
| 1655 | |
| 1656 | $this->add_responsive_control( |
| 1657 | 'content_align', |
| 1658 | array( |
| 1659 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 1660 | 'type' => Controls_Manager::CHOOSE, |
| 1661 | 'options' => array( |
| 1662 | 'left' => array( |
| 1663 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 1664 | 'icon' => 'eicon-text-align-left', |
| 1665 | ), |
| 1666 | 'center' => array( |
| 1667 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 1668 | 'icon' => 'eicon-text-align-center', |
| 1669 | ), |
| 1670 | 'right' => array( |
| 1671 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 1672 | 'icon' => 'eicon-text-align-right', |
| 1673 | ), |
| 1674 | ), |
| 1675 | 'selectors_dictionary' => array( |
| 1676 | 'left' => 'align-items: flex-start; justify-content: flex-start; text-align: left', |
| 1677 | 'center' => 'align-items: center; justify-content: flex-start; text-align: center', |
| 1678 | 'right' => 'align-items: flex-end; justify-content: flex-start; text-align: right', |
| 1679 | ), |
| 1680 | 'default' => 'center', |
| 1681 | 'selectors' => array( |
| 1682 | '{{WRAPPER}} .premium-testimonial-content-wrapper' => '{{VALUE}}', |
| 1683 | ), |
| 1684 | ) |
| 1685 | ); |
| 1686 | |
| 1687 | $this->add_group_control( |
| 1688 | Premium_Background::get_type(), |
| 1689 | array( |
| 1690 | 'name' => 'premium_testimonial_background', |
| 1691 | 'types' => array( 'classic', 'gradient' ), |
| 1692 | 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper', |
| 1693 | ) |
| 1694 | ); |
| 1695 | |
| 1696 | $this->add_group_control( |
| 1697 | Group_Control_Border::get_type(), |
| 1698 | array( |
| 1699 | 'name' => 'premium_testimonial_container_border', |
| 1700 | 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper', |
| 1701 | ) |
| 1702 | ); |
| 1703 | |
| 1704 | $this->add_control( |
| 1705 | 'premium_testimonial_container_border_radius', |
| 1706 | array( |
| 1707 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1708 | 'type' => Controls_Manager::SLIDER, |
| 1709 | 'size_units' => array( 'px', 'em', '%' ), |
| 1710 | 'selectors' => array( |
| 1711 | '{{WRAPPER}} .premium-testimonial-content-wrapper' => 'border-radius: {{SIZE}}{{UNIT}}', |
| 1712 | ), |
| 1713 | 'condition' => array( |
| 1714 | 'container_adv_radius!' => 'yes', |
| 1715 | ), |
| 1716 | ) |
| 1717 | ); |
| 1718 | |
| 1719 | $this->add_control( |
| 1720 | 'container_adv_radius', |
| 1721 | array( |
| 1722 | 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ), |
| 1723 | 'type' => Controls_Manager::SWITCHER, |
| 1724 | 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>', |
| 1725 | ) |
| 1726 | ); |
| 1727 | |
| 1728 | $this->add_control( |
| 1729 | 'container_adv_radius_value', |
| 1730 | array( |
| 1731 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1732 | 'type' => Controls_Manager::TEXT, |
| 1733 | 'dynamic' => array( 'active' => true ), |
| 1734 | 'selectors' => array( |
| 1735 | '{{WRAPPER}} .premium-testimonial-content-wrapper' => 'border-radius: {{VALUE}};', |
| 1736 | ), |
| 1737 | 'condition' => array( |
| 1738 | 'container_adv_radius' => 'yes', |
| 1739 | ), |
| 1740 | 'ai' => array( |
| 1741 | 'active' => false, |
| 1742 | ), |
| 1743 | ) |
| 1744 | ); |
| 1745 | |
| 1746 | $this->add_group_control( |
| 1747 | Group_Control_Box_Shadow::get_type(), |
| 1748 | array( |
| 1749 | 'name' => 'premium_testimonial_container_box_shadow', |
| 1750 | 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper', |
| 1751 | ) |
| 1752 | ); |
| 1753 | |
| 1754 | $this->add_responsive_control( |
| 1755 | 'premium_testimonial_box_padding', |
| 1756 | array( |
| 1757 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1758 | 'type' => Controls_Manager::DIMENSIONS, |
| 1759 | 'size_units' => array( 'px', 'em', '%' ), |
| 1760 | 'selectors' => array( |
| 1761 | '{{WRAPPER}} .premium-testimonial-content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1762 | ), |
| 1763 | ) |
| 1764 | ); |
| 1765 | |
| 1766 | $this->end_controls_section(); |
| 1767 | } |
| 1768 | |
| 1769 | /** |
| 1770 | * Render Testimonials widget output on the frontend. |
| 1771 | * |
| 1772 | * Written in PHP and used to generate the final HTML. |
| 1773 | * |
| 1774 | * @since 1.0.0 |
| 1775 | * @access protected |
| 1776 | */ |
| 1777 | protected function render() { |
| 1778 | |
| 1779 | $settings = $this->get_settings_for_display(); |
| 1780 | |
| 1781 | $papro_activated = Helper_Functions::check_papro_version(); |
| 1782 | |
| 1783 | if ( ! $papro_activated || version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.9.8', '<' ) ) { |
| 1784 | |
| 1785 | if ( 'skin1' !== $settings['skin'] ) { |
| 1786 | |
| 1787 | ?> |
| 1788 | <div class="premium-error-notice"> |
| 1789 | <?php |
| 1790 | $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' ); |
| 1791 | echo wp_kses_post( $message ); |
| 1792 | ?> |
| 1793 | </div> |
| 1794 | <?php |
| 1795 | return false; |
| 1796 | |
| 1797 | } |
| 1798 | } |
| 1799 | |
| 1800 | $person_title_tag = Helper_Functions::validate_html_tag( $settings['premium_testimonial_person_name_size'] ); |
| 1801 | $job_tag = Helper_Functions::validate_html_tag( $settings['premium_testimonial_company_name_size'] ); |
| 1802 | |
| 1803 | $this->add_render_attribute( |
| 1804 | 'testimonials_container', |
| 1805 | 'class', |
| 1806 | array( |
| 1807 | 'premium-testimonial-box', |
| 1808 | ) |
| 1809 | ); |
| 1810 | |
| 1811 | $show_image = 'skin4' !== $settings['skin'] ? $settings['show_image'] : 'yes'; |
| 1812 | |
| 1813 | if ( 'yes' === $show_image ) { |
| 1814 | $this->add_render_attribute( 'img_wrap', 'class', 'premium-testimonial-img-wrapper' ); |
| 1815 | } |
| 1816 | |
| 1817 | if ( 'yes' !== $settings['multiple'] ) { |
| 1818 | |
| 1819 | $this->add_inline_editing_attributes( 'premium_testimonial_person_name' ); |
| 1820 | $this->add_inline_editing_attributes( 'premium_testimonial_company_name' ); |
| 1821 | $this->add_inline_editing_attributes( 'heading' ); |
| 1822 | $this->add_inline_editing_attributes( 'premium_testimonial_content', 'advanced' ); |
| 1823 | |
| 1824 | if ( 'yes' === $show_image ) { |
| 1825 | |
| 1826 | $image_src = ''; |
| 1827 | |
| 1828 | if ( ! empty( $settings['premium_testimonial_person_image']['url'] ) ) { |
| 1829 | $image_src = $settings['premium_testimonial_person_image']['url']; |
| 1830 | $alt = esc_attr( Control_Media::get_image_alt( $settings['premium_testimonial_person_image'] ) ); |
| 1831 | } |
| 1832 | } |
| 1833 | |
| 1834 | if ( 'yes' === $settings['premium_testimonial_company_link_switcher'] ) { |
| 1835 | |
| 1836 | $this->add_link_attributes( 'link', $settings['premium_testimonial_company_link'] ); |
| 1837 | $this->add_render_attribute( 'link', 'class', 'premium-testimonial-company-link' ); |
| 1838 | |
| 1839 | } |
| 1840 | } else { |
| 1841 | |
| 1842 | $testimonials = $settings['multiple_testimonials']; |
| 1843 | |
| 1844 | $this->add_render_attribute( 'testimonials_container', 'class', 'multiple-testimonials' ); |
| 1845 | // $this->add_render_attribute( 'testimonials_container', 'data-testimonials-equal', $settings['multiple_equal_height'] ); |
| 1846 | |
| 1847 | } |
| 1848 | |
| 1849 | if ( 'yes' === $settings['multiple'] && 'masonry' === $settings['premium_testimonial_layout'] && 'yes' !== $settings['carousel'] ) { |
| 1850 | $this->add_render_attribute( 'testimonials_container', 'class', 'premium-testimonial-masonry' ); |
| 1851 | } |
| 1852 | |
| 1853 | $carousel = 'yes' === $settings['carousel'] ? true : false; |
| 1854 | |
| 1855 | if ( $carousel ) { |
| 1856 | |
| 1857 | $this->add_render_attribute( 'testimonials_container', 'data-carousel', $carousel ); |
| 1858 | |
| 1859 | $this->add_render_attribute( |
| 1860 | 'testimonials_container', |
| 1861 | array( |
| 1862 | 'data-rtl' => is_rtl(), |
| 1863 | ) |
| 1864 | ); |
| 1865 | |
| 1866 | } |
| 1867 | |
| 1868 | ?> |
| 1869 | |
| 1870 | <?php |
| 1871 | if ( 'yes' === $settings['multiple'] && 'skin4' === $settings['skin'] ) { |
| 1872 | |
| 1873 | $images_markup = ''; |
| 1874 | |
| 1875 | foreach ( $testimonials as $index => $testimonial ) { |
| 1876 | |
| 1877 | $testionial_image_html = $this->get_author_image( $testimonial ); |
| 1878 | $images_markup .= '<div class="premium-testimonial__carousel-img premium-testimonial-img-wrapper" data-index="' . $index . '">' . $testionial_image_html . '</div>'; |
| 1879 | } |
| 1880 | |
| 1881 | echo '<div class="premium-testimonial__carousel">' . wp_kses_post( $images_markup ) . '</div>'; |
| 1882 | } |
| 1883 | ?> |
| 1884 | |
| 1885 | <div <?php $this->print_render_attribute_string( 'testimonials_container' ); ?>> |
| 1886 | |
| 1887 | <?php if ( 'yes' !== $settings['multiple'] ) : ?> |
| 1888 | |
| 1889 | <div class="premium-testimonial-container"> |
| 1890 | |
| 1891 | <?php if ( 'skin3' !== $settings['skin'] ) : ?> |
| 1892 | <div class="premium-testimonial-upper-quote"> |
| 1893 | <?php $this->render_quote_icon(); ?> |
| 1894 | </div> |
| 1895 | <?php endif; ?> |
| 1896 | |
| 1897 | <div class="premium-testimonial-content-wrapper"> |
| 1898 | |
| 1899 | <?php if ( ! empty( $settings['heading'] ) ) : ?> |
| 1900 | <div class="premium-testimonial-heading"> |
| 1901 | <p <?php $this->print_render_attribute_string( 'heading' ); ?>> |
| 1902 | <?php echo wp_kses_post( $settings['heading'] ); ?> |
| 1903 | </p> |
| 1904 | </div> |
| 1905 | <?php endif; ?> |
| 1906 | |
| 1907 | <div class="premium-testimonial-text-wrapper"> |
| 1908 | <div <?php $this->print_render_attribute_string( 'premium_testimonial_content' ); ?>> |
| 1909 | <?php echo $this->parse_text_editor( $settings['premium_testimonial_content'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 1910 | </div> |
| 1911 | </div> |
| 1912 | |
| 1913 | <?php if ( ! empty( $settings['rating'] ) ) : ?> |
| 1914 | <div class="premium-testimonial__rating-wrapper"> |
| 1915 | <?php echo Helper_Functions::render_rating_stars( $settings['rating'], $settings['fill'], $settings['empty'], $settings['star_size'] ); ?> |
| 1916 | </div> |
| 1917 | <?php endif; ?> |
| 1918 | |
| 1919 | <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?> |
| 1920 | <div class="premium-testimonial__img-info"> |
| 1921 | <?php endif; ?> |
| 1922 | |
| 1923 | |
| 1924 | <?php if ( ! empty( $image_src ) ) : ?> |
| 1925 | <div <?php $this->print_render_attribute_string( 'img_wrap' ); ?>> |
| 1926 | <img src="<?php echo esc_url( $image_src ); ?>" alt="<?php echo esc_attr( $alt ); ?>" class="premium-testimonial-person-image"> |
| 1927 | </div> |
| 1928 | <?php endif; ?> |
| 1929 | |
| 1930 | |
| 1931 | <div class="premium-testimonial-author-info"> |
| 1932 | <<?php echo wp_kses_post( $person_title_tag ); ?> class="premium-testimonial-person-name"> |
| 1933 | <span <?php $this->print_render_attribute_string( 'premium_testimonial_person_name' ); ?>> |
| 1934 | <?php echo wp_kses_post( $settings['premium_testimonial_person_name'] ); ?> |
| 1935 | </span> |
| 1936 | </<?php echo wp_kses_post( $person_title_tag ); ?>> |
| 1937 | |
| 1938 | <?php if ( ! empty( $settings['premium_testimonial_company_name'] ) ) : ?> |
| 1939 | <<?php echo wp_kses_post( $job_tag ); ?> class="premium-testimonial-job"> |
| 1940 | <?php if ( 'yes' === $settings['premium_testimonial_company_link_switcher'] ) : ?> |
| 1941 | <a <?php $this->print_render_attribute_string( 'link' ); ?>> |
| 1942 | <span <?php $this->print_render_attribute_string( 'premium_testimonial_company_name' ); ?>> |
| 1943 | <?php echo wp_kses_post( $settings['premium_testimonial_company_name'] ); ?> |
| 1944 | </span> |
| 1945 | </a> |
| 1946 | <?php else : ?> |
| 1947 | <span class="premium-testimonial-company-link" <?php $this->print_render_attribute_string( 'premium_testimonial_company_name' ); ?>> |
| 1948 | <?php echo wp_kses_post( $settings['premium_testimonial_company_name'] ); ?> |
| 1949 | </span> |
| 1950 | <?php endif; ?> |
| 1951 | </<?php echo wp_kses_post( $job_tag ); ?>> |
| 1952 | <?php endif; ?> |
| 1953 | </div> |
| 1954 | |
| 1955 | <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?> |
| 1956 | </div> |
| 1957 | <?php endif; ?> |
| 1958 | |
| 1959 | </div> |
| 1960 | |
| 1961 | <?php if ( in_array( $settings['skin'], array( 'skin1', 'skin3' ), true ) ) : ?> |
| 1962 | <div class="premium-testimonial-lower-quote"> |
| 1963 | <?php $this->render_quote_icon(); ?> |
| 1964 | </div> |
| 1965 | <?php endif; ?> |
| 1966 | </div> |
| 1967 | |
| 1968 | <?php else : ?> |
| 1969 | |
| 1970 | <?php if ( 'skin4' === $settings['skin'] ) : ?> |
| 1971 | <div class="premium-testimonial-upper-quote"> |
| 1972 | <?php $this->render_quote_icon(); ?> |
| 1973 | </div> |
| 1974 | <?php endif; ?> |
| 1975 | |
| 1976 | <?php |
| 1977 | foreach ( $testimonials as $index => $testimonial ) : |
| 1978 | |
| 1979 | if ( 'yes' === $show_image ) { |
| 1980 | $testionial_image_html = $this->get_author_image( $testimonial ); |
| 1981 | } |
| 1982 | |
| 1983 | if ( 'yes' === $testimonial['link_switcher'] ) { |
| 1984 | |
| 1985 | $this->add_render_attribute( 'link_' . $index, 'class', 'premium-testimonial-company-link' ); |
| 1986 | $this->add_link_attributes( 'link_' . $index, $testimonial['link'] ); |
| 1987 | } |
| 1988 | |
| 1989 | ?> |
| 1990 | |
| 1991 | <div class="premium-testimonial-container"> |
| 1992 | |
| 1993 | <?php if ( ! in_array( $settings['skin'], array( 'skin3', 'skin4' ), true ) ) : ?> |
| 1994 | <div class="premium-testimonial-upper-quote"> |
| 1995 | <?php $this->render_quote_icon(); ?> |
| 1996 | </div> |
| 1997 | <?php endif; ?> |
| 1998 | |
| 1999 | <div class="premium-testimonial-content-wrapper"> |
| 2000 | |
| 2001 | <?php if ( ! empty( $testimonial['heading'] ) ) : ?> |
| 2002 | <div class="premium-testimonial-heading"> |
| 2003 | <p <?php $this->print_render_attribute_string( 'heading' ); ?>> |
| 2004 | <?php echo wp_kses_post( $testimonial['heading'] ); ?> |
| 2005 | </p> |
| 2006 | </div> |
| 2007 | <?php endif; ?> |
| 2008 | |
| 2009 | <div class="premium-testimonial-text-wrapper"> |
| 2010 | <div <?php $this->print_render_attribute_string( 'premium_testimonial_content' ); ?>> |
| 2011 | <?php echo $this->parse_text_editor( $testimonial['content'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 2012 | </div> |
| 2013 | </div> |
| 2014 | |
| 2015 | <?php if ( ! empty( $testimonial['rating'] ) ) : ?> |
| 2016 | <div class="premium-testimonial__rating-wrapper"> |
| 2017 | <?php echo Helper_Functions::render_rating_stars( $testimonial['rating'], $settings['fill'], $settings['empty'], $settings['star_size'] ); ?> |
| 2018 | </div> |
| 2019 | <?php endif; ?> |
| 2020 | |
| 2021 | <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?> |
| 2022 | <div class="premium-testimonial__img-info"> |
| 2023 | <?php endif; ?> |
| 2024 | |
| 2025 | <?php if ( 'skin4' !== $settings['skin'] ) : ?> |
| 2026 | <?php if ( ! empty( $testionial_image_html ) ) : ?> |
| 2027 | <div <?php $this->print_render_attribute_string( 'img_wrap' ); ?>> |
| 2028 | <?php echo wp_kses_post( $testionial_image_html ); ?> |
| 2029 | </div> |
| 2030 | <?php endif; ?> |
| 2031 | <?php endif; ?> |
| 2032 | |
| 2033 | <div class="premium-testimonial-author-info"> |
| 2034 | <<?php echo wp_kses_post( $person_title_tag ); ?> class="premium-testimonial-person-name"> |
| 2035 | <span <?php $this->print_render_attribute_string( 'premium_testimonial_person_name' ); ?>> |
| 2036 | <?php echo wp_kses_post( $testimonial['person_name'] ); ?> |
| 2037 | </span> |
| 2038 | </<?php echo wp_kses_post( $person_title_tag ); ?>> |
| 2039 | |
| 2040 | <?php if ( ! empty( $testimonial['company_name'] ) ) : ?> |
| 2041 | <<?php echo wp_kses_post( $job_tag ); ?> class="premium-testimonial-job"> |
| 2042 | <?php if ( 'yes' === $testimonial['link_switcher'] ) : ?> |
| 2043 | <a <?php $this->print_render_attribute_string( 'link_' . $index ); ?>> |
| 2044 | <span <?php $this->print_render_attribute_string( 'premium_testimonial_company_name' ); ?>> |
| 2045 | <?php echo wp_kses_post( $testimonial['company_name'] ); ?> |
| 2046 | </span> |
| 2047 | </a> |
| 2048 | <?php else : ?> |
| 2049 | <span class="premium-testimonial-company-link" <?php $this->print_render_attribute_string( 'premium_testimonial_company_name' ); ?>> |
| 2050 | <?php echo wp_kses_post( $testimonial['company_name'] ); ?> |
| 2051 | </span> |
| 2052 | <?php endif; ?> |
| 2053 | </<?php echo wp_kses_post( $job_tag ); ?>> |
| 2054 | <?php endif; ?> |
| 2055 | </div> |
| 2056 | |
| 2057 | <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?> |
| 2058 | </div> |
| 2059 | <?php endif; ?> |
| 2060 | |
| 2061 | </div> |
| 2062 | |
| 2063 | <?php if ( in_array( $settings['skin'], array( 'skin1', 'skin3' ), true ) ) : ?> |
| 2064 | <div class="premium-testimonial-lower-quote"> |
| 2065 | <?php $this->render_quote_icon(); ?> |
| 2066 | </div> |
| 2067 | <?php endif; ?> |
| 2068 | </div> |
| 2069 | |
| 2070 | <?php endforeach; ?> |
| 2071 | <?php |
| 2072 | endif; |
| 2073 | |
| 2074 | if ( Plugin::instance()->editor->is_edit_mode() ) { |
| 2075 | |
| 2076 | if ( 'yes' === $settings['multiple'] ) { |
| 2077 | if ( 'masonry' === $settings['premium_testimonial_layout'] && 'yes' !== $settings['carousel'] ) { |
| 2078 | $this->render_editor_script(); |
| 2079 | } |
| 2080 | } |
| 2081 | } |
| 2082 | ?> |
| 2083 | </div> |
| 2084 | <?php |
| 2085 | } |
| 2086 | |
| 2087 | /** |
| 2088 | * Render Quote Icon |
| 2089 | * |
| 2090 | * @since 4.10.13 |
| 2091 | * @access protected |
| 2092 | */ |
| 2093 | protected function render_quote_icon() { |
| 2094 | |
| 2095 | $settings = $this->get_settings_for_display(); |
| 2096 | |
| 2097 | if ( 'rounded' === $settings['icon_style'] ) { |
| 2098 | |
| 2099 | $svg_html = '<svg class="premium-testimonial-quote" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="48" height="37" viewBox="0 0 48 37"><path d="m37,37c6.07,0,11-4.93,11-11s-4.93-11-11-11c-.32,0-.63.02-.94.05.54-4.81,2.18-9.43,4.79-13.52.19-.31.2-.7.03-1.01-.18-.32-.51-.52-.88-.52h-2c-.27,0-.54.11-.73.31-5.14,5.41-11.27,14.26-11.27,25.69,0,6.07,4.93,10.99,11,11h0Zm-26,0c6.07,0,11-4.93,11-11s-4.93-11-11-11c-.32,0-.63.02-.94.05.54-4.81,2.18-9.43,4.79-13.52.19-.31.2-.7.03-1.01-.18-.32-.51-.52-.87-.52h-2c-.27,0-.54.11-.73.31C6.13,5.72,0,14.57,0,26c0,6.07,4.93,10.99,11,11h0Zm0,0"/></svg>'; |
| 2100 | |
| 2101 | } else { |
| 2102 | |
| 2103 | $svg_html = '<svg class="premium-testimonial-quote" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="48" height="37.5" viewBox="0 0 48 37.5"><path d="m21,16.5v21H0v-21.3C0,1.8,13.5,0,13.5,0l1.8,4.2s-6,.9-7.2,5.7c-1.2,3.6,1.2,6.6,1.2,6.6h11.7Zm27,0v21h-21v-21.3C27,1.8,40.5,0,40.5,0l1.8,4.2s-6,.9-7.2,5.7c-1.2,3.6,1.2,6.6,1.2,6.6h11.7Z"/></svg>'; |
| 2104 | } |
| 2105 | |
| 2106 | echo $svg_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 2107 | } |
| 2108 | |
| 2109 | /** |
| 2110 | * Get Author Image |
| 2111 | * |
| 2112 | * @since 4.10.13 |
| 2113 | * @access protected |
| 2114 | */ |
| 2115 | protected function get_author_image( $testimonial ) { |
| 2116 | |
| 2117 | $testionial_image_html = ''; |
| 2118 | if ( ! empty( $testimonial['person_image']['url'] ) ) { |
| 2119 | |
| 2120 | $image_src = $testimonial['person_image']['url']; |
| 2121 | $image_id = attachment_url_to_postid( $image_src ); |
| 2122 | |
| 2123 | $settings['image_data'] = Helper_Functions::get_image_data( $image_id, $testimonial['person_image']['url'], 'thumbnail' ); |
| 2124 | $testionial_image_html = Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'image_data' ); |
| 2125 | |
| 2126 | } |
| 2127 | |
| 2128 | return $testionial_image_html; |
| 2129 | } |
| 2130 | |
| 2131 | /** |
| 2132 | * Render Editor Masonry Script. |
| 2133 | * |
| 2134 | * @since 4.10.13 |
| 2135 | * @access protected |
| 2136 | */ |
| 2137 | protected function render_editor_script() { |
| 2138 | |
| 2139 | ?> |
| 2140 | <script type="text/javascript"> |
| 2141 | jQuery( document ).ready( function( $ ) { |
| 2142 | |
| 2143 | $( '.premium-testimonial-box' ).each( function() { |
| 2144 | |
| 2145 | var $node_id = '<?php echo esc_attr( $this->get_id() ); ?>', |
| 2146 | scope = $( '[data-id="' + $node_id + '"]' ), |
| 2147 | selector = $(this); |
| 2148 | |
| 2149 | if ( selector.closest( scope ).length < 1 ) { |
| 2150 | return; |
| 2151 | } |
| 2152 | |
| 2153 | var masonryArgs = { |
| 2154 | itemSelector : '.premium-testimonial-container', |
| 2155 | percentPosition : true, |
| 2156 | layoutMode : 'masonry', |
| 2157 | }; |
| 2158 | |
| 2159 | var $isotopeObj = {}; |
| 2160 | |
| 2161 | selector.imagesLoaded( function() { |
| 2162 | |
| 2163 | $isotopeObj = selector.isotope( masonryArgs ); |
| 2164 | |
| 2165 | $isotopeObj.imagesLoaded().progress(function() { |
| 2166 | $isotopeObj.isotope("layout"); |
| 2167 | }); |
| 2168 | |
| 2169 | selector.find('.premium-testimonial-container').resize( function() { |
| 2170 | $isotopeObj.isotope( 'layout' ); |
| 2171 | }); |
| 2172 | }); |
| 2173 | |
| 2174 | if ( window.elementor ) { |
| 2175 | //No need to limit the change to the spacing control only, as changing the container size for example will affect the masonry layout. |
| 2176 | var debounceDelay; |
| 2177 | elementor.channels.editor.on('change', function(e) { |
| 2178 | |
| 2179 | clearTimeout(debounceDelay); |
| 2180 | |
| 2181 | debounceDelay = setTimeout(function() { |
| 2182 | $isotopeObj.isotope('layout'); |
| 2183 | }, 300); |
| 2184 | }); |
| 2185 | } |
| 2186 | }); |
| 2187 | }); |
| 2188 | </script> |
| 2189 | <?php |
| 2190 | } |
| 2191 | } |
| 2192 |