dep
1 year ago
premium-banner.php
1 year ago
premium-blog.php
1 year ago
premium-button.php
1 year ago
premium-carousel.php
1 year ago
premium-contactform.php
1 year ago
premium-countdown.php
1 year ago
premium-counter.php
1 year ago
premium-dual-header.php
1 year ago
premium-fancytext.php
1 year ago
premium-grid.php
1 year ago
premium-icon-list.php
1 year ago
premium-image-button.php
1 year ago
premium-image-scroll.php
1 year ago
premium-image-separator.php
1 year ago
premium-lottie.php
1 year ago
premium-maps.php
1 year ago
premium-media-wheel.php
1 year ago
premium-mobile-menu.php
1 year ago
premium-modalbox.php
1 year ago
premium-nav-menu.php
1 year ago
premium-notifications.php
1 year ago
premium-person.php
1 year ago
premium-pinterest-feed.php
1 year ago
premium-post-ticker.php
1 year ago
premium-pricing-table.php
1 year ago
premium-progressbar.php
1 year ago
premium-search-form.php
1 year ago
premium-svg-drawer.php
1 year ago
premium-tcloud.php
1 year ago
premium-testimonials.php
1 year ago
premium-textual-showcase.php
1 year ago
premium-tiktok-feed.php
1 year ago
premium-title.php
1 year ago
premium-videobox.php
1 year ago
premium-vscroll.php
1 year ago
premium-weather.php
1 year ago
premium-world-clock.php
1 year ago
premium-testimonials.php
1849 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 Elementor\Group_Control_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 | 'font-awesome-5-all', |
| 80 | 'pa-slick', |
| 81 | 'premium-addons', |
| 82 | ); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Retrieve Widget Dependent JS. |
| 87 | * |
| 88 | * @since 1.0.0 |
| 89 | * @access public |
| 90 | * |
| 91 | * @return array JS script handles. |
| 92 | */ |
| 93 | public function get_script_depends() { |
| 94 | return array( |
| 95 | 'pa-slick', |
| 96 | 'premium-addons', |
| 97 | ); |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Retrieve Widget Categories. |
| 102 | * |
| 103 | * @since 1.5.1 |
| 104 | * @access public |
| 105 | * |
| 106 | * @return array Widget categories. |
| 107 | */ |
| 108 | public function get_categories() { |
| 109 | return array( 'premium-elements' ); |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * Retrieve Widget Keywords. |
| 114 | * |
| 115 | * @since 1.0.0 |
| 116 | * @access public |
| 117 | * |
| 118 | * @return string Widget keywords. |
| 119 | */ |
| 120 | public function get_keywords() { |
| 121 | return array( 'pa', 'premium', 'premium testimonials', 'quote', 'appreciate', 'rating', 'review', 'recommendation' ); |
| 122 | } |
| 123 | |
| 124 | protected function is_dynamic_content(): bool { |
| 125 | return false; |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Retrieve Widget Support URL. |
| 130 | * |
| 131 | * @access public |
| 132 | * |
| 133 | * @return string support URL. |
| 134 | */ |
| 135 | public function get_custom_help_url() { |
| 136 | return 'https://premiumaddons.com/support/'; |
| 137 | } |
| 138 | |
| 139 | public function has_widget_inner_wrapper(): bool { |
| 140 | return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * Register Testimonials controls. |
| 145 | * |
| 146 | * @since 1.0.0 |
| 147 | * @access protected |
| 148 | */ |
| 149 | protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
| 150 | |
| 151 | $papro_activated = apply_filters( 'papro_activated', false ); |
| 152 | |
| 153 | $this->start_controls_section( |
| 154 | 'testimonial_section', |
| 155 | array( |
| 156 | 'label' => __( 'Testimonial', 'premium-addons-for-elementor' ), |
| 157 | ) |
| 158 | ); |
| 159 | |
| 160 | $this->add_control( |
| 161 | 'multiple', |
| 162 | array( |
| 163 | 'label' => __( 'Multiple Testimonials', 'premium-addons-for-elementor' ), |
| 164 | 'description' => __( 'Enable this option if you need to add multiple testimonials', 'premium-addons-for-elementor' ), |
| 165 | 'type' => Controls_Manager::SWITCHER, |
| 166 | ) |
| 167 | ); |
| 168 | |
| 169 | $this->start_controls_tabs( |
| 170 | 'author_info_tabs', |
| 171 | array( |
| 172 | 'condition' => array( |
| 173 | 'multiple!' => 'yes', |
| 174 | ), |
| 175 | ) |
| 176 | ); |
| 177 | |
| 178 | $this->start_controls_tab( |
| 179 | 'author_info_tab_author', |
| 180 | array( |
| 181 | 'label' => __( 'Author', 'premium-addons-for-elementor' ), |
| 182 | ) |
| 183 | ); |
| 184 | |
| 185 | $this->add_control( |
| 186 | 'premium_testimonial_person_image', |
| 187 | array( |
| 188 | 'label' => __( 'Image', 'premium-addons-for-elementor' ), |
| 189 | 'type' => Controls_Manager::MEDIA, |
| 190 | 'dynamic' => array( 'active' => true ), |
| 191 | 'default' => array( |
| 192 | 'url' => Utils::get_placeholder_image_src(), |
| 193 | ), |
| 194 | 'show_label' => true, |
| 195 | ) |
| 196 | ); |
| 197 | |
| 198 | $this->add_control( |
| 199 | 'premium_testimonial_person_name', |
| 200 | array( |
| 201 | 'label' => __( 'Name', 'premium-addons-for-elementor' ), |
| 202 | 'type' => Controls_Manager::TEXT, |
| 203 | 'default' => 'Joseph L.Mabie', |
| 204 | 'dynamic' => array( 'active' => true ), |
| 205 | 'label_block' => true, |
| 206 | ) |
| 207 | ); |
| 208 | |
| 209 | $this->end_controls_tab(); |
| 210 | |
| 211 | $this->start_controls_tab( |
| 212 | 'author_info_tab_content', |
| 213 | array( |
| 214 | 'label' => __( 'Content', 'premium-addons-for-elementor' ), |
| 215 | ) |
| 216 | ); |
| 217 | |
| 218 | $this->add_control( |
| 219 | 'heading', |
| 220 | array( |
| 221 | 'label' => __( 'Heading', 'premium-addons-for-elementor' ), |
| 222 | 'type' => Controls_Manager::TEXT, |
| 223 | 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ), |
| 224 | 'dynamic' => array( 'active' => true ), |
| 225 | 'label_block' => true, |
| 226 | ) |
| 227 | ); |
| 228 | |
| 229 | $this->add_control( |
| 230 | 'premium_testimonial_company_name', |
| 231 | array( |
| 232 | 'label' => __( 'Job', 'premium-addons-for-elementor' ), |
| 233 | 'type' => Controls_Manager::TEXT, |
| 234 | 'dynamic' => array( 'active' => true ), |
| 235 | 'default' => 'Influencer', |
| 236 | 'label_block' => true, |
| 237 | ) |
| 238 | ); |
| 239 | |
| 240 | $this->add_control( |
| 241 | 'premium_testimonial_company_link_switcher', |
| 242 | array( |
| 243 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 244 | 'type' => Controls_Manager::SWITCHER, |
| 245 | 'default' => 'yes', |
| 246 | ) |
| 247 | ); |
| 248 | |
| 249 | $this->add_control( |
| 250 | 'premium_testimonial_company_link', |
| 251 | array( |
| 252 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 253 | 'type' => Controls_Manager::URL, |
| 254 | 'default' => array( |
| 255 | 'is_external' => true, |
| 256 | ), |
| 257 | 'dynamic' => array( 'active' => true ), |
| 258 | 'label_block' => true, |
| 259 | 'condition' => array( |
| 260 | 'premium_testimonial_company_link_switcher' => 'yes', |
| 261 | ), |
| 262 | ) |
| 263 | ); |
| 264 | |
| 265 | $this->add_control( |
| 266 | 'rating', |
| 267 | array( |
| 268 | 'label' => __( 'Rating Score', 'premium-addons-for-elementor' ), |
| 269 | 'type' => Controls_Manager::NUMBER, |
| 270 | 'dynamic' => array( 'active' => true ), |
| 271 | 'min' => 0, |
| 272 | 'max' => 5, |
| 273 | 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ), |
| 274 | ) |
| 275 | ); |
| 276 | |
| 277 | $this->add_control( |
| 278 | 'premium_testimonial_content', |
| 279 | array( |
| 280 | 'label' => __( 'Content', 'premium-addons-for-elementor' ), |
| 281 | 'type' => Controls_Manager::TEXTAREA, |
| 282 | 'rows' => 10, |
| 283 | 'dynamic' => array( 'active' => true ), |
| 284 | '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' ), |
| 285 | 'label_block' => true, |
| 286 | ) |
| 287 | ); |
| 288 | |
| 289 | $this->end_controls_tab(); |
| 290 | |
| 291 | $this->end_controls_tabs(); |
| 292 | |
| 293 | $repeater = new REPEATER(); |
| 294 | |
| 295 | $repeater->add_control( |
| 296 | 'person_image', |
| 297 | array( |
| 298 | 'label' => __( 'Image', 'premium-addons-for-elementor' ), |
| 299 | 'type' => Controls_Manager::MEDIA, |
| 300 | 'dynamic' => array( 'active' => true ), |
| 301 | 'default' => array( |
| 302 | 'url' => Utils::get_placeholder_image_src(), |
| 303 | ), |
| 304 | 'show_label' => true, |
| 305 | ) |
| 306 | ); |
| 307 | |
| 308 | $repeater->add_control( |
| 309 | 'heading', |
| 310 | array( |
| 311 | 'label' => __( 'Heading', 'premium-addons-for-elementor' ), |
| 312 | 'type' => Controls_Manager::TEXT, |
| 313 | 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ), |
| 314 | 'dynamic' => array( 'active' => true ), |
| 315 | 'label_block' => true, |
| 316 | ) |
| 317 | ); |
| 318 | |
| 319 | $repeater->add_control( |
| 320 | 'person_name', |
| 321 | array( |
| 322 | 'label' => __( 'Name', 'premium-addons-for-elementor' ), |
| 323 | 'type' => Controls_Manager::TEXT, |
| 324 | 'dynamic' => array( 'active' => true ), |
| 325 | 'default' => 'Joseph L.Mabie', |
| 326 | 'label_block' => true, |
| 327 | ) |
| 328 | ); |
| 329 | |
| 330 | $repeater->add_control( |
| 331 | 'company_name', |
| 332 | array( |
| 333 | 'label' => __( 'Job', 'premium-addons-for-elementor' ), |
| 334 | 'type' => Controls_Manager::TEXT, |
| 335 | 'dynamic' => array( 'active' => true ), |
| 336 | 'default' => 'Influencer', |
| 337 | 'label_block' => true, |
| 338 | ) |
| 339 | ); |
| 340 | |
| 341 | $repeater->add_control( |
| 342 | 'link_switcher', |
| 343 | array( |
| 344 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 345 | 'type' => Controls_Manager::SWITCHER, |
| 346 | ) |
| 347 | ); |
| 348 | |
| 349 | $repeater->add_control( |
| 350 | 'link', |
| 351 | array( |
| 352 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 353 | 'type' => Controls_Manager::URL, |
| 354 | 'default' => array( |
| 355 | 'is_external' => true, |
| 356 | ), |
| 357 | 'label_block' => true, |
| 358 | 'condition' => array( |
| 359 | 'link_switcher' => 'yes', |
| 360 | ), |
| 361 | ) |
| 362 | ); |
| 363 | |
| 364 | $repeater->add_control( |
| 365 | 'rating', |
| 366 | array( |
| 367 | 'label' => __( 'Rating Score', 'premium-addons-for-elementor' ), |
| 368 | 'type' => Controls_Manager::NUMBER, |
| 369 | 'dynamic' => array( 'active' => true ), |
| 370 | 'description' => __( 'Leave empty if not needed.', 'premium-addons-for-elementor' ), |
| 371 | 'min' => 0, |
| 372 | 'max' => 5, |
| 373 | ) |
| 374 | ); |
| 375 | |
| 376 | $repeater->add_control( |
| 377 | 'content', |
| 378 | array( |
| 379 | 'label' => __( 'Content', 'premium-addons-for-elementor' ), |
| 380 | 'type' => Controls_Manager::TEXTAREA, |
| 381 | 'rows' => 10, |
| 382 | 'dynamic' => array( 'active' => true ), |
| 383 | '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' ), |
| 384 | 'label_block' => true, |
| 385 | ) |
| 386 | ); |
| 387 | |
| 388 | $this->add_control( |
| 389 | 'multiple_testimonials', |
| 390 | array( |
| 391 | 'label' => __( 'Testimonials', 'premium-addons-for-elementor' ), |
| 392 | 'type' => Controls_Manager::REPEATER, |
| 393 | 'default' => array( |
| 394 | array( |
| 395 | 'person_name' => 'Joseph L.Mabie', |
| 396 | 'company_name' => 'Influencer', |
| 397 | 'heading' => 'Great Support Team', |
| 398 | ), |
| 399 | array( |
| 400 | 'person_name' => 'Debra Campbell', |
| 401 | 'company_name' => 'Web Developer', |
| 402 | 'heading' => 'Very Powerful', |
| 403 | ), |
| 404 | array( |
| 405 | 'person_name' => 'Joanne Ellis', |
| 406 | 'company_name' => 'Content Creator', |
| 407 | 'heading' => 'Excellent Service', |
| 408 | ), |
| 409 | ), |
| 410 | 'fields' => $repeater->get_controls(), |
| 411 | 'title_field' => '{{{person_name}}}', |
| 412 | 'condition' => array( |
| 413 | 'multiple' => 'yes', |
| 414 | ), |
| 415 | ) |
| 416 | ); |
| 417 | |
| 418 | $this->add_control( |
| 419 | 'carousel', |
| 420 | array( |
| 421 | 'label' => __( 'Carousel', 'premium-addons-for-elementor' ), |
| 422 | 'type' => Controls_Manager::SWITCHER, |
| 423 | 'frontend_available' => true, |
| 424 | 'condition' => array( |
| 425 | 'multiple' => 'yes', |
| 426 | 'skin!' => 'skin4', |
| 427 | ), |
| 428 | ) |
| 429 | ); |
| 430 | |
| 431 | $this->add_control( |
| 432 | 'carousel_play', |
| 433 | array( |
| 434 | 'label' => __( 'Auto Play', 'premium-addons-for-elementor' ), |
| 435 | 'type' => Controls_Manager::SWITCHER, |
| 436 | 'conditions' => array( |
| 437 | 'terms' => array( |
| 438 | array( |
| 439 | 'name' => 'multiple', |
| 440 | 'value' => 'yes', |
| 441 | ), |
| 442 | array( |
| 443 | 'relation' => 'or', |
| 444 | 'terms' => array( |
| 445 | array( |
| 446 | 'terms' => array( |
| 447 | array( |
| 448 | 'name' => 'skin', |
| 449 | 'operator' => '!==', |
| 450 | 'value' => 'skin4', |
| 451 | ), |
| 452 | array( |
| 453 | 'name' => 'carousel', |
| 454 | 'operator' => '===', |
| 455 | 'value' => 'yes', |
| 456 | ), |
| 457 | ), |
| 458 | ), |
| 459 | array( |
| 460 | 'terms' => array( |
| 461 | array( |
| 462 | 'name' => 'skin', |
| 463 | 'operator' => '===', |
| 464 | 'value' => 'skin4', |
| 465 | ), |
| 466 | ), |
| 467 | ), |
| 468 | |
| 469 | ), |
| 470 | ), |
| 471 | ), |
| 472 | ), |
| 473 | 'frontend_available' => true, |
| 474 | ) |
| 475 | ); |
| 476 | |
| 477 | $this->add_control( |
| 478 | 'speed', |
| 479 | array( |
| 480 | 'label' => __( 'Autoplay Speed', 'premium-addons-for-elementor' ), |
| 481 | 'description' => __( 'Autoplay Speed means at which time the next slide should come. Set a value in milliseconds (ms)', 'premium-addons-for-elementor' ), |
| 482 | 'type' => Controls_Manager::NUMBER, |
| 483 | 'default' => 5000, |
| 484 | 'conditions' => array( |
| 485 | 'terms' => array( |
| 486 | array( |
| 487 | 'name' => 'multiple', |
| 488 | 'value' => 'yes', |
| 489 | ), |
| 490 | array( |
| 491 | 'name' => 'carousel_play', |
| 492 | 'value' => 'yes', |
| 493 | ), |
| 494 | array( |
| 495 | 'relation' => 'or', |
| 496 | 'terms' => array( |
| 497 | array( |
| 498 | 'terms' => array( |
| 499 | array( |
| 500 | 'name' => 'skin', |
| 501 | 'operator' => '!==', |
| 502 | 'value' => 'skin4', |
| 503 | ), |
| 504 | array( |
| 505 | 'name' => 'carousel', |
| 506 | 'operator' => '===', |
| 507 | 'value' => 'yes', |
| 508 | ), |
| 509 | ), |
| 510 | ), |
| 511 | array( |
| 512 | 'terms' => array( |
| 513 | array( |
| 514 | 'name' => 'skin', |
| 515 | 'operator' => '===', |
| 516 | 'value' => 'skin4', |
| 517 | ), |
| 518 | ), |
| 519 | ), |
| 520 | |
| 521 | ), |
| 522 | ), |
| 523 | ), |
| 524 | ), |
| 525 | 'frontend_available' => true, |
| 526 | ) |
| 527 | ); |
| 528 | |
| 529 | $this->add_responsive_control( |
| 530 | 'carousel_arrows_pos', |
| 531 | array( |
| 532 | 'label' => __( 'Arrows Position', 'premium-addons-for-elementor' ), |
| 533 | 'type' => Controls_Manager::SLIDER, |
| 534 | 'size_units' => array( 'px', 'em' ), |
| 535 | 'range' => array( |
| 536 | 'px' => array( |
| 537 | 'min' => -100, |
| 538 | 'max' => 100, |
| 539 | ), |
| 540 | 'em' => array( |
| 541 | 'min' => -10, |
| 542 | 'max' => 10, |
| 543 | ), |
| 544 | ), |
| 545 | 'condition' => array( |
| 546 | 'multiple' => 'yes', |
| 547 | 'carousel' => 'yes', |
| 548 | 'skin!' => 'skin4', |
| 549 | ), |
| 550 | 'selectors' => array( |
| 551 | '{{WRAPPER}} .premium-testimonial-box a.carousel-arrow.carousel-next' => 'right: {{SIZE}}{{UNIT}};', |
| 552 | '{{WRAPPER}} .premium-testimonial-box a.carousel-arrow.carousel-prev' => 'left: {{SIZE}}{{UNIT}};', |
| 553 | ), |
| 554 | ) |
| 555 | ); |
| 556 | |
| 557 | $this->end_controls_section(); |
| 558 | |
| 559 | $this->start_controls_section( |
| 560 | 'display_option_section', |
| 561 | array( |
| 562 | 'label' => __( 'Display Options', 'premium-addons-for-elementor' ), |
| 563 | ) |
| 564 | ); |
| 565 | |
| 566 | $this->add_control( |
| 567 | 'skin', |
| 568 | array( |
| 569 | 'label' => __( 'Choose Skin', 'premium-addons-for-elementor' ), |
| 570 | 'type' => Controls_Manager::SELECT, |
| 571 | 'default' => 'skin1', |
| 572 | 'options' => array( |
| 573 | 'skin1' => apply_filters( 'pa_pro_label', __( 'Skin 1', 'premium-addons-for-elementor' ) ), |
| 574 | 'skin2' => apply_filters( 'pa_pro_label', __( 'Skin 2 (Pro)', 'premium-addons-for-elementor' ) ), |
| 575 | 'skin3' => apply_filters( 'pa_pro_label', __( 'Skin 3 (Pro)', 'premium-addons-for-elementor' ) ), |
| 576 | 'skin4' => apply_filters( 'pa_pro_label', __( 'Skin 4 (Pro)', 'premium-addons-for-elementor' ) ), |
| 577 | ), |
| 578 | 'prefix_class' => 'premium-testimonial__', |
| 579 | 'label_block' => true, |
| 580 | 'render_type' => 'template', |
| 581 | 'frontend_available' => true, |
| 582 | ) |
| 583 | ); |
| 584 | |
| 585 | if ( ! $papro_activated ) { |
| 586 | |
| 587 | $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'testimonials-widget', 'wp-editor', 'get-pro' ); |
| 588 | |
| 589 | $this->add_control( |
| 590 | 'pro_skins_notice', |
| 591 | array( |
| 592 | 'type' => Controls_Manager::RAW_HTML, |
| 593 | '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>', |
| 594 | 'content_classes' => 'papro-upgrade-notice', |
| 595 | 'condition' => array( |
| 596 | 'skin!' => 'skin1', |
| 597 | ), |
| 598 | ) |
| 599 | ); |
| 600 | |
| 601 | } |
| 602 | |
| 603 | $this->add_control( |
| 604 | 'skin_notice', |
| 605 | array( |
| 606 | 'raw' => __( 'This skin can be used with four or more testimonials.', 'premium-addons-for-elementor' ), |
| 607 | 'type' => Controls_Manager::RAW_HTML, |
| 608 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 609 | 'condition' => array( |
| 610 | 'multiple' => 'yes', |
| 611 | 'skin' => 'skin4', |
| 612 | ), |
| 613 | ) |
| 614 | ); |
| 615 | |
| 616 | $this->add_control( |
| 617 | 'show_image', |
| 618 | array( |
| 619 | 'label' => __( 'Show Author Image', 'premium-addons-for-elementor' ), |
| 620 | 'type' => Controls_Manager::SWITCHER, |
| 621 | 'default' => 'yes', |
| 622 | 'condition' => array( |
| 623 | 'skin!' => 'skin4', |
| 624 | ), |
| 625 | ) |
| 626 | ); |
| 627 | |
| 628 | $this->add_control( |
| 629 | 'img_position', |
| 630 | array( |
| 631 | 'label' => __( 'Image Position', 'premium-addons-for-elementor' ), |
| 632 | 'type' => Controls_Manager::SELECT, |
| 633 | 'options' => array( |
| 634 | 'relative' => __( 'Relative', 'premium-addons-for-elementor' ), |
| 635 | 'absolute' => __( 'Absolute', 'premium-addons-for-elementor' ), |
| 636 | ), |
| 637 | 'default' => 'relative', |
| 638 | 'label_block' => true, |
| 639 | 'frontend_available' => true, |
| 640 | 'condition' => array( |
| 641 | 'show_image' => 'yes', |
| 642 | 'skin' => 'skin1', |
| 643 | ), |
| 644 | ) |
| 645 | ); |
| 646 | |
| 647 | $this->add_control( |
| 648 | 'img_place', |
| 649 | array( |
| 650 | 'label' => __( 'Select Position', 'premium-addons-for-elementor' ), |
| 651 | 'type' => Controls_Manager::CHOOSE, |
| 652 | 'options' => array( |
| 653 | 'top' => array( |
| 654 | 'title' => __( 'Top', 'premium-addons-for-elementor' ), |
| 655 | 'icon' => 'eicon-flex eicon-justify-start-h premium-rotate-icon', |
| 656 | ), |
| 657 | 'bottom' => array( |
| 658 | 'title' => __( 'Bottom', 'premium-addons-for-elementor' ), |
| 659 | 'icon' => 'eicon-flex eicon-justify-end-h premium-rotate-icon', |
| 660 | ), |
| 661 | ), |
| 662 | 'default' => 'top', |
| 663 | 'prefix_class' => 'premium-testimonial__img-', |
| 664 | 'label_block' => true, |
| 665 | 'condition' => array( |
| 666 | 'show_image' => 'yes', |
| 667 | 'skin' => 'skin1', |
| 668 | 'img_position' => 'absolute', |
| 669 | ), |
| 670 | ) |
| 671 | ); |
| 672 | |
| 673 | if ( $papro_activated ) { |
| 674 | |
| 675 | do_action( 'pa_testimonials_skins_options', $this ); |
| 676 | |
| 677 | } |
| 678 | |
| 679 | $this->add_control( |
| 680 | 'premium_testimonial_person_name_size', |
| 681 | array( |
| 682 | 'label' => __( 'Name HTML Tag', 'premium-addons-for-elementor' ), |
| 683 | 'type' => Controls_Manager::SELECT, |
| 684 | 'options' => array( |
| 685 | 'h1' => 'H1', |
| 686 | 'h2' => 'H2', |
| 687 | 'h3' => 'H3', |
| 688 | 'h4' => 'H4', |
| 689 | 'h5' => 'H5', |
| 690 | 'h6' => 'H6', |
| 691 | 'div' => 'div', |
| 692 | 'span' => 'span', |
| 693 | 'p' => 'p', |
| 694 | ), |
| 695 | 'default' => 'h3', |
| 696 | 'separator' => 'before', |
| 697 | 'label_block' => true, |
| 698 | ) |
| 699 | ); |
| 700 | |
| 701 | $this->add_control( |
| 702 | 'premium_testimonial_company_name_size', |
| 703 | array( |
| 704 | 'label' => __( 'Job HTML Tag', 'premium-addons-for-elementor' ), |
| 705 | 'type' => Controls_Manager::SELECT, |
| 706 | 'options' => array( |
| 707 | 'h1' => 'H1', |
| 708 | 'h2' => 'H2', |
| 709 | 'h3' => 'H3', |
| 710 | 'h4' => 'H4', |
| 711 | 'h5' => 'H5', |
| 712 | 'h6' => 'H6', |
| 713 | 'div' => 'div', |
| 714 | 'span' => 'span', |
| 715 | 'p' => 'p', |
| 716 | ), |
| 717 | 'default' => 'h4', |
| 718 | 'label_block' => true, |
| 719 | ) |
| 720 | ); |
| 721 | |
| 722 | $this->add_control( |
| 723 | 'icon_style', |
| 724 | array( |
| 725 | 'label' => __( 'Quotation Skin', 'premium-addons-for-elementor' ), |
| 726 | 'type' => Controls_Manager::SELECT, |
| 727 | 'options' => array( |
| 728 | 'rounded' => __( 'Rounded', 'premium-addons-for-elementor' ), |
| 729 | 'sharp' => __( 'Sharp', 'premium-addons-for-elementor' ), |
| 730 | ), |
| 731 | 'default' => 'rounded', |
| 732 | 'label_block' => true, |
| 733 | ) |
| 734 | ); |
| 735 | |
| 736 | $this->add_responsive_control( |
| 737 | 'testimonials_per_row', |
| 738 | array( |
| 739 | 'label' => __( 'Members/Row', 'premium-addons-for-elementor' ), |
| 740 | 'type' => Controls_Manager::SELECT, |
| 741 | 'options' => array( |
| 742 | '100%' => __( '1 Column', 'premium-addons-for-elementor' ), |
| 743 | '50%' => __( '2 Columns', 'premium-addons-for-elementor' ), |
| 744 | '33.33%' => __( '3 Columns', 'premium-addons-for-elementor' ), |
| 745 | '25%' => __( '4 Columns', 'premium-addons-for-elementor' ), |
| 746 | '20%' => __( '5 Columns', 'premium-addons-for-elementor' ), |
| 747 | '16.667%' => __( '6 Columns', 'premium-addons-for-elementor' ), |
| 748 | ), |
| 749 | 'default' => '33.33%', |
| 750 | 'tablet_default' => '100%', |
| 751 | 'mobile_default' => '100%', |
| 752 | 'render_type' => 'template', |
| 753 | 'selectors' => array( |
| 754 | '{{WRAPPER}} .premium-testimonial-container' => 'width: {{VALUE}}', |
| 755 | ), |
| 756 | 'separator' => 'before', |
| 757 | 'condition' => array( |
| 758 | 'multiple' => 'yes', |
| 759 | 'skin!' => 'skin4', |
| 760 | ), |
| 761 | 'frontend_available' => true, |
| 762 | ) |
| 763 | ); |
| 764 | |
| 765 | $this->add_responsive_control( |
| 766 | 'spacing', |
| 767 | array( |
| 768 | 'label' => __( 'Spacing', 'premium-addons-for-elementor' ), |
| 769 | 'type' => Controls_Manager::DIMENSIONS, |
| 770 | 'size_units' => array( 'px', '%', 'em' ), |
| 771 | 'default' => array( |
| 772 | 'top' => 5, |
| 773 | 'right' => 5, |
| 774 | 'bottom' => 5, |
| 775 | 'left' => 5, |
| 776 | ), |
| 777 | 'condition' => array( |
| 778 | 'multiple' => 'yes', |
| 779 | ), |
| 780 | 'selectors' => array( |
| 781 | '{{WRAPPER}} .premium-testimonial-container' => 'padding: 0 {{RIGHT}}{{UNIT}} 0 {{LEFT}}{{UNIT}}; margin: {{TOP}}{{UNIT}} 0 {{BOTTOM}}{{UNIT}} 0', |
| 782 | ), |
| 783 | ) |
| 784 | ); |
| 785 | |
| 786 | $this->add_control( |
| 787 | 'spacing_notice', |
| 788 | array( |
| 789 | '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' ), |
| 790 | 'type' => Controls_Manager::RAW_HTML, |
| 791 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', |
| 792 | ) |
| 793 | ); |
| 794 | |
| 795 | $this->add_control( |
| 796 | 'equal_height', |
| 797 | array( |
| 798 | 'label' => __( 'Equal Height', 'premium-addons-for-elementor' ), |
| 799 | 'type' => Controls_Manager::SWITCHER, |
| 800 | 'description' => __( 'This option searches for the testimonial with the largest height and applies that height to the other testimonials', 'premium-addons-for-elementor' ), |
| 801 | 'prefix_class' => 'premium-testimonial__equal-', |
| 802 | 'condition' => array( |
| 803 | 'multiple' => 'yes', |
| 804 | ), |
| 805 | ) |
| 806 | ); |
| 807 | |
| 808 | $this->end_controls_section(); |
| 809 | |
| 810 | $this->start_controls_section( |
| 811 | 'section_pa_docs', |
| 812 | array( |
| 813 | 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ), |
| 814 | ) |
| 815 | ); |
| 816 | |
| 817 | $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' ); |
| 818 | $title = __( 'I\'m not able to see Font Awesome icons in the widget »', 'premium-addons-for-elementor' ); |
| 819 | |
| 820 | $this->add_control( |
| 821 | 'doc_1', |
| 822 | array( |
| 823 | 'type' => Controls_Manager::RAW_HTML, |
| 824 | 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ), |
| 825 | 'content_classes' => 'editor-pa-doc', |
| 826 | ) |
| 827 | ); |
| 828 | |
| 829 | $this->end_controls_section(); |
| 830 | |
| 831 | $this->start_controls_section( |
| 832 | 'premium_testimonial_image_style', |
| 833 | array( |
| 834 | 'label' => __( 'Author Image', 'premium-addons-for-elementor' ), |
| 835 | 'tab' => Controls_Manager::TAB_STYLE, |
| 836 | 'condition' => array( |
| 837 | 'show_image' => 'yes', |
| 838 | ), |
| 839 | ) |
| 840 | ); |
| 841 | |
| 842 | $this->add_control( |
| 843 | 'premium_testimonial_img_size', |
| 844 | array( |
| 845 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 846 | 'type' => Controls_Manager::SLIDER, |
| 847 | 'size_units' => array( 'px', 'em' ), |
| 848 | 'default' => array( |
| 849 | 'unit' => 'px', |
| 850 | 'size' => 100, |
| 851 | ), |
| 852 | 'range' => array( |
| 853 | 'px' => array( |
| 854 | 'min' => 10, |
| 855 | 'max' => 150, |
| 856 | ), |
| 857 | ), |
| 858 | 'selectors' => array( |
| 859 | '{{WRAPPER}} .premium-testimonial-img-wrapper' => 'width: {{SIZE}}{{UNIT}}; height:{{SIZE}}{{UNIT}}', |
| 860 | '{{WRAPPER}} .premium-testimonial__carousel' => 'width: calc( 3 * {{SIZE}}{{UNIT}} )', |
| 861 | ), |
| 862 | ) |
| 863 | ); |
| 864 | |
| 865 | $this->add_group_control( |
| 866 | Group_Control_Border::get_type(), |
| 867 | array( |
| 868 | 'name' => 'img_border', |
| 869 | 'selector' => '{{WRAPPER}} .premium-testimonial-img-wrapper', |
| 870 | ) |
| 871 | ); |
| 872 | |
| 873 | $this->add_control( |
| 874 | 'active_border', |
| 875 | array( |
| 876 | 'label' => __( 'Active Border Color', 'premium-addons-for-elementor' ), |
| 877 | 'type' => Controls_Manager::COLOR, |
| 878 | 'selectors' => array( |
| 879 | '{{WRAPPER}} .slick-center .premium-testimonial-img-wrapper' => 'border-color: {{VALUE}} !important', |
| 880 | ), |
| 881 | 'condition' => array( |
| 882 | 'multiple' => 'yes', |
| 883 | 'skin' => 'skin4', |
| 884 | ), |
| 885 | ) |
| 886 | ); |
| 887 | |
| 888 | $this->add_control( |
| 889 | 'img_border_radius', |
| 890 | array( |
| 891 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 892 | 'type' => Controls_Manager::SLIDER, |
| 893 | 'size_units' => array( 'px', '%', 'em' ), |
| 894 | 'selectors' => array( |
| 895 | '{{WRAPPER}} .premium-testimonial-img-wrapper' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 896 | ), |
| 897 | ) |
| 898 | ); |
| 899 | |
| 900 | $this->add_group_control( |
| 901 | Group_Control_Css_Filter::get_type(), |
| 902 | array( |
| 903 | 'name' => 'css_filters', |
| 904 | 'selector' => '{{WRAPPER}} .premium-testimonial-img-wrapper', |
| 905 | ) |
| 906 | ); |
| 907 | |
| 908 | $this->add_group_control( |
| 909 | Group_Control_Css_Filter::get_type(), |
| 910 | array( |
| 911 | 'name' => 'hover_css_filters', |
| 912 | 'label' => __( 'Hover CSS Filters', 'premium-addons-for-elementor' ), |
| 913 | 'selector' => '{{WRAPPER}} .premium-testimonial-container:hover .premium-testimonial-img-wrapper', |
| 914 | ) |
| 915 | ); |
| 916 | |
| 917 | $this->end_controls_section(); |
| 918 | |
| 919 | $this->start_controls_section( |
| 920 | 'heading_style_section', |
| 921 | array( |
| 922 | 'label' => __( 'Heading', 'premium-addons-for-elementor' ), |
| 923 | 'tab' => Controls_Manager::TAB_STYLE, |
| 924 | ) |
| 925 | ); |
| 926 | |
| 927 | $this->add_control( |
| 928 | 'heading_color', |
| 929 | array( |
| 930 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 931 | 'type' => Controls_Manager::COLOR, |
| 932 | 'global' => array( |
| 933 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 934 | ), |
| 935 | 'selectors' => array( |
| 936 | '{{WRAPPER}} .premium-testimonial-heading' => 'color: {{VALUE}};', |
| 937 | ), |
| 938 | ) |
| 939 | ); |
| 940 | |
| 941 | $this->add_group_control( |
| 942 | Group_Control_Typography::get_type(), |
| 943 | array( |
| 944 | 'name' => 'heading_typography', |
| 945 | 'selector' => '{{WRAPPER}} .premium-testimonial-heading', |
| 946 | ) |
| 947 | ); |
| 948 | |
| 949 | $this->add_group_control( |
| 950 | Group_Control_Text_Shadow::get_type(), |
| 951 | array( |
| 952 | 'name' => 'heading_shadow', |
| 953 | 'selector' => '{{WRAPPER}} .premium-testimonial-heading', |
| 954 | ) |
| 955 | ); |
| 956 | |
| 957 | $this->add_responsive_control( |
| 958 | 'heading_margin', |
| 959 | array( |
| 960 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 961 | 'type' => Controls_Manager::DIMENSIONS, |
| 962 | 'size_units' => array( 'px', 'em', '%' ), |
| 963 | 'selectors' => array( |
| 964 | '{{WRAPPER}} .premium-testimonial-heading' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};', |
| 965 | ), |
| 966 | ) |
| 967 | ); |
| 968 | |
| 969 | $this->end_controls_section(); |
| 970 | |
| 971 | $this->start_controls_section( |
| 972 | 'person_style_section', |
| 973 | array( |
| 974 | 'label' => __( 'Author', 'premium-addons-for-elementor' ), |
| 975 | 'tab' => Controls_Manager::TAB_STYLE, |
| 976 | ) |
| 977 | ); |
| 978 | |
| 979 | $this->add_control( |
| 980 | 'premium_testimonial_person_name_color', |
| 981 | array( |
| 982 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 983 | 'type' => Controls_Manager::COLOR, |
| 984 | 'selectors' => array( |
| 985 | '{{WRAPPER}} .premium-testimonial-person-name' => 'color: {{VALUE}};', |
| 986 | ), |
| 987 | ) |
| 988 | ); |
| 989 | |
| 990 | $this->add_group_control( |
| 991 | Group_Control_Typography::get_type(), |
| 992 | array( |
| 993 | 'name' => 'author_name_typography', |
| 994 | 'selector' => '{{WRAPPER}} .premium-testimonial-person-name', |
| 995 | ) |
| 996 | ); |
| 997 | |
| 998 | $this->add_group_control( |
| 999 | Group_Control_Text_Shadow::get_type(), |
| 1000 | array( |
| 1001 | 'name' => 'author_name_shadow', |
| 1002 | 'selector' => '{{WRAPPER}} .premium-testimonial-person-name', |
| 1003 | ) |
| 1004 | ); |
| 1005 | |
| 1006 | $this->add_responsive_control( |
| 1007 | 'name_margin', |
| 1008 | array( |
| 1009 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1010 | 'type' => Controls_Manager::DIMENSIONS, |
| 1011 | 'size_units' => array( 'px', 'em', '%' ), |
| 1012 | 'selectors' => array( |
| 1013 | '{{WRAPPER}} .premium-testimonial-person-name' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};', |
| 1014 | ), |
| 1015 | ) |
| 1016 | ); |
| 1017 | |
| 1018 | $this->end_controls_section(); |
| 1019 | |
| 1020 | $this->start_controls_section( |
| 1021 | 'company_style_section', |
| 1022 | array( |
| 1023 | 'label' => __( 'Job', 'premium-addons-for-elementor' ), |
| 1024 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1025 | ) |
| 1026 | ); |
| 1027 | |
| 1028 | $this->add_responsive_control( |
| 1029 | 'job_align', |
| 1030 | array( |
| 1031 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 1032 | 'type' => Controls_Manager::CHOOSE, |
| 1033 | 'options' => array( |
| 1034 | 'flex-start' => array( |
| 1035 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 1036 | 'icon' => 'eicon-text-align-left', |
| 1037 | ), |
| 1038 | 'center' => array( |
| 1039 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 1040 | 'icon' => 'eicon-text-align-center', |
| 1041 | ), |
| 1042 | 'flex-end' => array( |
| 1043 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 1044 | 'icon' => 'eicon-text-align-right', |
| 1045 | ), |
| 1046 | ), |
| 1047 | 'default' => 'center', |
| 1048 | 'toggle' => false, |
| 1049 | 'selectors' => array( |
| 1050 | '{{WRAPPER}} .premium-testimonial-author-info' => 'align-items: {{VALUE}}', |
| 1051 | ), |
| 1052 | ) |
| 1053 | ); |
| 1054 | |
| 1055 | $this->add_control( |
| 1056 | 'premium_testimonial_company_name_color', |
| 1057 | array( |
| 1058 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1059 | 'type' => Controls_Manager::COLOR, |
| 1060 | 'global' => array( |
| 1061 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1062 | ), |
| 1063 | 'selectors' => array( |
| 1064 | '{{WRAPPER}} .premium-testimonial-company-link' => 'color: {{VALUE}};', |
| 1065 | ), |
| 1066 | ) |
| 1067 | ); |
| 1068 | |
| 1069 | $this->add_group_control( |
| 1070 | Group_Control_Typography::get_type(), |
| 1071 | array( |
| 1072 | 'name' => 'company_name_typography', |
| 1073 | 'selector' => '{{WRAPPER}} .premium-testimonial-company-link', |
| 1074 | ) |
| 1075 | ); |
| 1076 | |
| 1077 | $this->add_group_control( |
| 1078 | Group_Control_Text_Shadow::get_type(), |
| 1079 | array( |
| 1080 | 'name' => 'company_name_shadow', |
| 1081 | 'selector' => '{{WRAPPER}} .premium-testimonial-company-link', |
| 1082 | ) |
| 1083 | ); |
| 1084 | |
| 1085 | $this->add_responsive_control( |
| 1086 | 'job_margin', |
| 1087 | array( |
| 1088 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1089 | 'type' => Controls_Manager::DIMENSIONS, |
| 1090 | 'size_units' => array( 'px', 'em', '%' ), |
| 1091 | 'selectors' => array( |
| 1092 | '{{WRAPPER}} .premium-testimonial-job' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};', |
| 1093 | ), |
| 1094 | ) |
| 1095 | ); |
| 1096 | |
| 1097 | $this->end_controls_section(); |
| 1098 | |
| 1099 | $this->start_controls_section( |
| 1100 | 'rating_style_section', |
| 1101 | array( |
| 1102 | 'label' => __( 'Rating Score', 'premium-addons-for-elementor' ), |
| 1103 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1104 | ) |
| 1105 | ); |
| 1106 | |
| 1107 | $this->add_control( |
| 1108 | 'star_size', |
| 1109 | array( |
| 1110 | 'label' => __( 'Star Size', 'premium-addons-for-elementor' ), |
| 1111 | 'type' => Controls_Manager::NUMBER, |
| 1112 | 'min' => 1, |
| 1113 | 'max' => 50, |
| 1114 | 'default' => 15, |
| 1115 | ) |
| 1116 | ); |
| 1117 | |
| 1118 | $this->add_control( |
| 1119 | 'fill', |
| 1120 | array( |
| 1121 | 'label' => __( 'Star Color', 'premium-addons-for-elementor' ), |
| 1122 | 'type' => Controls_Manager::COLOR, |
| 1123 | 'global' => false, |
| 1124 | 'default' => '#ffab40', |
| 1125 | ) |
| 1126 | ); |
| 1127 | |
| 1128 | $this->add_control( |
| 1129 | 'empty', |
| 1130 | array( |
| 1131 | 'label' => __( 'Empty Star Color', 'premium-addons-for-elementor' ), |
| 1132 | 'type' => Controls_Manager::COLOR, |
| 1133 | 'global' => false, |
| 1134 | ) |
| 1135 | ); |
| 1136 | |
| 1137 | $this->add_responsive_control( |
| 1138 | 'rating_margin', |
| 1139 | array( |
| 1140 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1141 | 'type' => Controls_Manager::DIMENSIONS, |
| 1142 | 'size_units' => array( 'px', 'em', '%' ), |
| 1143 | 'selectors' => array( |
| 1144 | '{{WRAPPER}} .premium-testimonial__rating-wrapper' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};', |
| 1145 | ), |
| 1146 | ) |
| 1147 | ); |
| 1148 | |
| 1149 | $this->end_controls_section(); |
| 1150 | |
| 1151 | $this->start_controls_section( |
| 1152 | 'content_style_section', |
| 1153 | array( |
| 1154 | 'label' => __( 'Content', 'premium-addons-for-elementor' ), |
| 1155 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1156 | ) |
| 1157 | ); |
| 1158 | |
| 1159 | $this->add_control( |
| 1160 | 'premium_testimonial_content_color', |
| 1161 | array( |
| 1162 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1163 | 'type' => Controls_Manager::COLOR, |
| 1164 | 'global' => array( |
| 1165 | 'default' => Global_Colors::COLOR_TEXT, |
| 1166 | ), |
| 1167 | 'selectors' => array( |
| 1168 | '{{WRAPPER}} .premium-testimonial-text-wrapper' => 'color: {{VALUE}};', |
| 1169 | ), |
| 1170 | ) |
| 1171 | ); |
| 1172 | |
| 1173 | $this->add_group_control( |
| 1174 | Group_Control_Typography::get_type(), |
| 1175 | array( |
| 1176 | 'name' => 'content_typography', |
| 1177 | 'selector' => '{{WRAPPER}} .premium-testimonial-text-wrapper', |
| 1178 | ) |
| 1179 | ); |
| 1180 | |
| 1181 | $this->add_responsive_control( |
| 1182 | 'premium_testimonial_margin', |
| 1183 | array( |
| 1184 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1185 | 'type' => Controls_Manager::DIMENSIONS, |
| 1186 | 'size_units' => array( 'px', 'em', '%' ), |
| 1187 | 'selectors' => array( |
| 1188 | '{{WRAPPER}} .premium-testimonial-text-wrapper' => 'margin: {{top}}{{UNIT}} {{right}}{{UNIT}} {{bottom}}{{UNIT}} {{left}}{{UNIT}};', |
| 1189 | ), |
| 1190 | ) |
| 1191 | ); |
| 1192 | |
| 1193 | $this->end_controls_section(); |
| 1194 | |
| 1195 | $this->start_controls_section( |
| 1196 | 'quotes_style_section', |
| 1197 | array( |
| 1198 | 'label' => __( 'Quotation Icon', 'premium-addons-for-elementor' ), |
| 1199 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1200 | ) |
| 1201 | ); |
| 1202 | |
| 1203 | $this->add_control( |
| 1204 | 'premium_testimonial_quote_icon_color', |
| 1205 | array( |
| 1206 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1207 | 'type' => Controls_Manager::COLOR, |
| 1208 | 'default' => '#58BFCA', |
| 1209 | 'selectors' => array( |
| 1210 | '{{WRAPPER}} .premium-testimonial-quote' => 'fill: {{VALUE}};', |
| 1211 | ), |
| 1212 | ) |
| 1213 | ); |
| 1214 | |
| 1215 | $this->add_responsive_control( |
| 1216 | 'premium_testimonial_quotes_size', |
| 1217 | array( |
| 1218 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 1219 | 'type' => Controls_Manager::SLIDER, |
| 1220 | 'size_units' => array( 'px', 'em', '%' ), |
| 1221 | 'range' => array( |
| 1222 | 'px' => array( |
| 1223 | 'min' => 5, |
| 1224 | 'max' => 250, |
| 1225 | ), |
| 1226 | ), |
| 1227 | 'selectors' => array( |
| 1228 | '{{WRAPPER}} .premium-testimonial-upper-quote svg, {{WRAPPER}} .premium-testimonial-lower-quote svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}', |
| 1229 | ), |
| 1230 | ) |
| 1231 | ); |
| 1232 | |
| 1233 | $this->add_responsive_control( |
| 1234 | 'premium_testimonial_upper_quote_position', |
| 1235 | array( |
| 1236 | 'label' => __( 'Top Icon Position', 'premium-addons-for-elementor' ), |
| 1237 | 'type' => Controls_Manager::DIMENSIONS, |
| 1238 | 'size_units' => array( 'px', 'em', '%' ), |
| 1239 | // 'default' => array( |
| 1240 | // 'top' => 0, |
| 1241 | // 'left' => 12, |
| 1242 | // 'unit' => 'px', |
| 1243 | // ), |
| 1244 | 'selectors' => array( |
| 1245 | '{{WRAPPER}} .premium-testimonial-upper-quote' => 'top: {{TOP}}{{UNIT}}; left:{{LEFT}}{{UNIT}};', |
| 1246 | ), |
| 1247 | 'condition' => array( |
| 1248 | 'skin!' => 'skin3', |
| 1249 | ), |
| 1250 | ) |
| 1251 | ); |
| 1252 | |
| 1253 | $this->add_responsive_control( |
| 1254 | 'premium_testimonial_lower_quote_position', |
| 1255 | array( |
| 1256 | 'label' => __( 'Bottom Icon Position', 'premium-addons-for-elementor' ), |
| 1257 | 'type' => Controls_Manager::DIMENSIONS, |
| 1258 | 'size_units' => array( 'px', 'em', '%' ), |
| 1259 | // 'default' => array( |
| 1260 | // 'bottom' => 3, |
| 1261 | // 'right' => 12, |
| 1262 | // 'unit' => 'px', |
| 1263 | // ), |
| 1264 | 'selectors' => array( |
| 1265 | '{{WRAPPER}} .premium-testimonial-lower-quote' => 'right: {{RIGHT}}{{UNIT}}; bottom: {{BOTTOM}}{{UNIT}};', |
| 1266 | ), |
| 1267 | 'condition' => array( |
| 1268 | 'skin!' => array( 'skin2', 'skin4' ), |
| 1269 | ), |
| 1270 | ) |
| 1271 | ); |
| 1272 | |
| 1273 | $this->end_controls_section(); |
| 1274 | |
| 1275 | $this->start_controls_section( |
| 1276 | 'carousel_style_section', |
| 1277 | array( |
| 1278 | 'label' => __( 'Carousel', 'premium-addons-for-elementor' ), |
| 1279 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1280 | 'condition' => array( |
| 1281 | 'carousel' => 'yes', |
| 1282 | 'skin!' => 'skin4', |
| 1283 | ), |
| 1284 | ) |
| 1285 | ); |
| 1286 | |
| 1287 | $this->add_control( |
| 1288 | 'arrow_color', |
| 1289 | array( |
| 1290 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1291 | 'type' => Controls_Manager::COLOR, |
| 1292 | 'global' => array( |
| 1293 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1294 | ), |
| 1295 | 'selectors' => array( |
| 1296 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'color: {{VALUE}};', |
| 1297 | ), |
| 1298 | ) |
| 1299 | ); |
| 1300 | |
| 1301 | $this->add_control( |
| 1302 | 'arrow_hover_color', |
| 1303 | array( |
| 1304 | 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ), |
| 1305 | 'type' => Controls_Manager::COLOR, |
| 1306 | 'global' => array( |
| 1307 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1308 | ), |
| 1309 | 'selectors' => array( |
| 1310 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow:hover' => 'color: {{VALUE}};', |
| 1311 | ), |
| 1312 | ) |
| 1313 | ); |
| 1314 | |
| 1315 | $this->add_responsive_control( |
| 1316 | 'arrow_size', |
| 1317 | array( |
| 1318 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 1319 | 'type' => Controls_Manager::SLIDER, |
| 1320 | 'size_units' => array( 'px', '%', 'em' ), |
| 1321 | 'selectors' => array( |
| 1322 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow i' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1323 | ), |
| 1324 | ) |
| 1325 | ); |
| 1326 | |
| 1327 | $this->add_control( |
| 1328 | 'arrow_background', |
| 1329 | array( |
| 1330 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1331 | 'type' => Controls_Manager::COLOR, |
| 1332 | 'global' => array( |
| 1333 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1334 | ), |
| 1335 | 'selectors' => array( |
| 1336 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'background-color: {{VALUE}};', |
| 1337 | ), |
| 1338 | ) |
| 1339 | ); |
| 1340 | |
| 1341 | $this->add_control( |
| 1342 | 'arrow_hover_background', |
| 1343 | array( |
| 1344 | 'label' => __( 'Background Hover Color', 'premium-addons-for-elementor' ), |
| 1345 | 'type' => Controls_Manager::COLOR, |
| 1346 | 'global' => array( |
| 1347 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1348 | ), |
| 1349 | 'selectors' => array( |
| 1350 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow:hover' => 'background-color: {{VALUE}};', |
| 1351 | ), |
| 1352 | ) |
| 1353 | ); |
| 1354 | |
| 1355 | $this->add_control( |
| 1356 | 'arrow_border_radius', |
| 1357 | array( |
| 1358 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1359 | 'type' => Controls_Manager::SLIDER, |
| 1360 | 'size_units' => array( 'px', '%', 'em' ), |
| 1361 | 'selectors' => array( |
| 1362 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1363 | ), |
| 1364 | ) |
| 1365 | ); |
| 1366 | |
| 1367 | $this->add_control( |
| 1368 | 'arrow_padding', |
| 1369 | array( |
| 1370 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1371 | 'type' => Controls_Manager::SLIDER, |
| 1372 | 'size_units' => array( 'px', '%', 'em' ), |
| 1373 | 'selectors' => array( |
| 1374 | '{{WRAPPER}} .premium-testimonial-box .slick-arrow' => 'padding: {{SIZE}}{{UNIT}};', |
| 1375 | ), |
| 1376 | ) |
| 1377 | ); |
| 1378 | |
| 1379 | $this->end_controls_section(); |
| 1380 | |
| 1381 | $this->start_controls_section( |
| 1382 | 'container_style_section', |
| 1383 | array( |
| 1384 | 'label' => __( 'Container', 'premium-addons-for-elementor' ), |
| 1385 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1386 | ) |
| 1387 | ); |
| 1388 | |
| 1389 | $this->add_responsive_control( |
| 1390 | 'content_align', |
| 1391 | array( |
| 1392 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 1393 | 'type' => Controls_Manager::CHOOSE, |
| 1394 | 'options' => array( |
| 1395 | 'left' => array( |
| 1396 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 1397 | 'icon' => 'eicon-text-align-left', |
| 1398 | ), |
| 1399 | 'center' => array( |
| 1400 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 1401 | 'icon' => 'eicon-text-align-center', |
| 1402 | ), |
| 1403 | 'right' => array( |
| 1404 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 1405 | 'icon' => 'eicon-text-align-right', |
| 1406 | ), |
| 1407 | ), |
| 1408 | 'selectors_dictionary' => array( |
| 1409 | 'left' => 'align-items: flex-start; justify-content: flex-start; text-align: left', |
| 1410 | 'center' => 'align-items: center; justify-content: flex-start; text-align: center', |
| 1411 | 'right' => 'align-items: flex-end; justify-content: flex-start; text-align: right', |
| 1412 | ), |
| 1413 | 'default' => 'center', |
| 1414 | 'selectors' => array( |
| 1415 | '{{WRAPPER}} .premium-testimonial-content-wrapper' => '{{VALUE}}', |
| 1416 | ), |
| 1417 | ) |
| 1418 | ); |
| 1419 | |
| 1420 | $this->add_group_control( |
| 1421 | Group_Control_Background::get_type(), |
| 1422 | array( |
| 1423 | 'name' => 'premium_testimonial_background', |
| 1424 | 'types' => array( 'classic', 'gradient' ), |
| 1425 | 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper', |
| 1426 | ) |
| 1427 | ); |
| 1428 | |
| 1429 | $this->add_group_control( |
| 1430 | Group_Control_Border::get_type(), |
| 1431 | array( |
| 1432 | 'name' => 'premium_testimonial_container_border', |
| 1433 | 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper', |
| 1434 | ) |
| 1435 | ); |
| 1436 | |
| 1437 | $this->add_control( |
| 1438 | 'premium_testimonial_container_border_radius', |
| 1439 | array( |
| 1440 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1441 | 'type' => Controls_Manager::SLIDER, |
| 1442 | 'size_units' => array( 'px', 'em', '%' ), |
| 1443 | 'selectors' => array( |
| 1444 | '{{WRAPPER}} .premium-testimonial-content-wrapper' => 'border-radius: {{SIZE}}{{UNIT}}', |
| 1445 | ), |
| 1446 | 'condition' => array( |
| 1447 | 'container_adv_radius!' => 'yes', |
| 1448 | ), |
| 1449 | ) |
| 1450 | ); |
| 1451 | |
| 1452 | $this->add_control( |
| 1453 | 'container_adv_radius', |
| 1454 | array( |
| 1455 | 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ), |
| 1456 | 'type' => Controls_Manager::SWITCHER, |
| 1457 | '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>', |
| 1458 | ) |
| 1459 | ); |
| 1460 | |
| 1461 | $this->add_control( |
| 1462 | 'container_adv_radius_value', |
| 1463 | array( |
| 1464 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1465 | 'type' => Controls_Manager::TEXT, |
| 1466 | 'dynamic' => array( 'active' => true ), |
| 1467 | 'selectors' => array( |
| 1468 | '{{WRAPPER}} .premium-testimonial-content-wrapper' => 'border-radius: {{VALUE}};', |
| 1469 | ), |
| 1470 | 'condition' => array( |
| 1471 | 'container_adv_radius' => 'yes', |
| 1472 | ), |
| 1473 | ) |
| 1474 | ); |
| 1475 | |
| 1476 | $this->add_group_control( |
| 1477 | Group_Control_Box_Shadow::get_type(), |
| 1478 | array( |
| 1479 | 'name' => 'premium_testimonial_container_box_shadow', |
| 1480 | 'selector' => '{{WRAPPER}} .premium-testimonial-content-wrapper', |
| 1481 | ) |
| 1482 | ); |
| 1483 | |
| 1484 | $this->add_responsive_control( |
| 1485 | 'premium_testimonial_box_padding', |
| 1486 | array( |
| 1487 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1488 | 'type' => Controls_Manager::DIMENSIONS, |
| 1489 | 'size_units' => array( 'px', 'em', '%' ), |
| 1490 | 'selectors' => array( |
| 1491 | '{{WRAPPER}} .premium-testimonial-content-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1492 | ), |
| 1493 | ) |
| 1494 | ); |
| 1495 | |
| 1496 | $this->end_controls_section(); |
| 1497 | } |
| 1498 | |
| 1499 | /** |
| 1500 | * Render Testimonials widget output on the frontend. |
| 1501 | * |
| 1502 | * Written in PHP and used to generate the final HTML. |
| 1503 | * |
| 1504 | * @since 1.0.0 |
| 1505 | * @access protected |
| 1506 | */ |
| 1507 | protected function render() { |
| 1508 | |
| 1509 | $settings = $this->get_settings_for_display(); |
| 1510 | |
| 1511 | $papro_activated = apply_filters( 'papro_activated', false ); |
| 1512 | |
| 1513 | if ( ! $papro_activated || version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.9.8', '<' ) ) { |
| 1514 | |
| 1515 | if ( 'skin1' !== $settings['skin'] ) { |
| 1516 | |
| 1517 | ?> |
| 1518 | <div class="premium-error-notice"> |
| 1519 | <?php |
| 1520 | $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' ); |
| 1521 | echo wp_kses_post( $message ); |
| 1522 | ?> |
| 1523 | </div> |
| 1524 | <?php |
| 1525 | return false; |
| 1526 | |
| 1527 | } |
| 1528 | } |
| 1529 | |
| 1530 | $person_title_tag = Helper_Functions::validate_html_tag( $settings['premium_testimonial_person_name_size'] ); |
| 1531 | $job_tag = Helper_Functions::validate_html_tag( $settings['premium_testimonial_company_name_size'] ); |
| 1532 | |
| 1533 | $this->add_render_attribute( |
| 1534 | 'testimonials_container', |
| 1535 | 'class', |
| 1536 | array( |
| 1537 | 'premium-testimonial-box', |
| 1538 | ) |
| 1539 | ); |
| 1540 | |
| 1541 | $show_image = 'skin4' !== $settings['skin'] ? $settings['show_image'] : 'yes'; |
| 1542 | |
| 1543 | if ( 'yes' === $show_image ) { |
| 1544 | $this->add_render_attribute( 'img_wrap', 'class', 'premium-testimonial-img-wrapper' ); |
| 1545 | } |
| 1546 | |
| 1547 | if ( 'yes' !== $settings['multiple'] ) { |
| 1548 | |
| 1549 | $this->add_inline_editing_attributes( 'premium_testimonial_person_name' ); |
| 1550 | $this->add_inline_editing_attributes( 'premium_testimonial_company_name' ); |
| 1551 | $this->add_inline_editing_attributes( 'heading' ); |
| 1552 | $this->add_inline_editing_attributes( 'premium_testimonial_content', 'advanced' ); |
| 1553 | |
| 1554 | if ( 'yes' === $show_image ) { |
| 1555 | |
| 1556 | $image_src = ''; |
| 1557 | |
| 1558 | if ( ! empty( $settings['premium_testimonial_person_image']['url'] ) ) { |
| 1559 | $image_src = $settings['premium_testimonial_person_image']['url']; |
| 1560 | $alt = esc_attr( Control_Media::get_image_alt( $settings['premium_testimonial_person_image'] ) ); |
| 1561 | } |
| 1562 | } |
| 1563 | |
| 1564 | if ( 'yes' === $settings['premium_testimonial_company_link_switcher'] ) { |
| 1565 | |
| 1566 | $this->add_link_attributes( 'link', $settings['premium_testimonial_company_link'] ); |
| 1567 | $this->add_render_attribute( 'link', 'class', 'premium-testimonial-company-link' ); |
| 1568 | |
| 1569 | } |
| 1570 | } else { |
| 1571 | |
| 1572 | $testimonials = $settings['multiple_testimonials']; |
| 1573 | |
| 1574 | $this->add_render_attribute( 'testimonials_container', 'class', 'multiple-testimonials' ); |
| 1575 | // $this->add_render_attribute( 'testimonials_container', 'data-testimonials-equal', $settings['multiple_equal_height'] ); |
| 1576 | |
| 1577 | } |
| 1578 | |
| 1579 | $carousel = 'yes' === $settings['carousel'] ? true : false; |
| 1580 | |
| 1581 | if ( $carousel ) { |
| 1582 | |
| 1583 | $this->add_render_attribute( 'testimonials_container', 'data-carousel', $carousel ); |
| 1584 | |
| 1585 | $this->add_render_attribute( |
| 1586 | 'testimonials_container', |
| 1587 | array( |
| 1588 | 'data-rtl' => is_rtl(), |
| 1589 | ) |
| 1590 | ); |
| 1591 | |
| 1592 | } |
| 1593 | |
| 1594 | ?> |
| 1595 | |
| 1596 | <?php |
| 1597 | if ( 'yes' === $settings['multiple'] && 'skin4' === $settings['skin'] ) { |
| 1598 | |
| 1599 | $images_markup = ''; |
| 1600 | |
| 1601 | foreach ( $testimonials as $index => $testimonial ) { |
| 1602 | |
| 1603 | $testionial_image_html = $this->get_author_image( $testimonial ); |
| 1604 | $images_markup .= '<div class="premium-testimonial__carousel-img premium-testimonial-img-wrapper" data-index="' . $index . '">' . $testionial_image_html . '</div>'; |
| 1605 | } |
| 1606 | |
| 1607 | echo '<div class="premium-testimonial__carousel">' . wp_kses_post( $images_markup ) . '</div>'; |
| 1608 | } |
| 1609 | ?> |
| 1610 | |
| 1611 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'testimonials_container' ) ); ?>> |
| 1612 | |
| 1613 | <?php if ( 'yes' !== $settings['multiple'] ) : ?> |
| 1614 | |
| 1615 | <div class="premium-testimonial-container"> |
| 1616 | |
| 1617 | <?php if ( 'skin3' !== $settings['skin'] ) : ?> |
| 1618 | <div class="premium-testimonial-upper-quote"> |
| 1619 | <?php $this->render_quote_icon(); ?> |
| 1620 | </div> |
| 1621 | <?php endif; ?> |
| 1622 | |
| 1623 | <div class="premium-testimonial-content-wrapper"> |
| 1624 | |
| 1625 | <?php if ( ! empty( $settings['heading'] ) ) : ?> |
| 1626 | <div class="premium-testimonial-heading"> |
| 1627 | <p <?php echo wp_kses_post( $this->get_render_attribute_string( 'heading' ) ); ?>> |
| 1628 | <?php echo wp_kses_post( $settings['heading'] ); ?> |
| 1629 | </p> |
| 1630 | </div> |
| 1631 | <?php endif; ?> |
| 1632 | |
| 1633 | <div class="premium-testimonial-text-wrapper"> |
| 1634 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_testimonial_content' ) ); ?>> |
| 1635 | <?php echo $this->parse_text_editor( $settings['premium_testimonial_content'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 1636 | </div> |
| 1637 | </div> |
| 1638 | |
| 1639 | <?php if ( ! empty( $settings['rating'] ) ) : ?> |
| 1640 | <div class="premium-testimonial__rating-wrapper"> |
| 1641 | <?php echo Helper_Functions::render_rating_stars( $settings['rating'], $settings['fill'], $settings['empty'], $settings['star_size'] ); ?> |
| 1642 | </div> |
| 1643 | <?php endif; ?> |
| 1644 | |
| 1645 | <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?> |
| 1646 | <div class="premium-testimonial__img-info"> |
| 1647 | <?php endif; ?> |
| 1648 | |
| 1649 | |
| 1650 | <?php if ( ! empty( $image_src ) ) : ?> |
| 1651 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'img_wrap' ) ); ?>> |
| 1652 | <img src="<?php echo esc_url( $image_src ); ?>" alt="<?php echo esc_attr( $alt ); ?>" class="premium-testimonial-person-image"> |
| 1653 | </div> |
| 1654 | <?php endif; ?> |
| 1655 | |
| 1656 | |
| 1657 | <div class="premium-testimonial-author-info"> |
| 1658 | <<?php echo wp_kses_post( $person_title_tag ); ?> class="premium-testimonial-person-name"> |
| 1659 | <span <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_testimonial_person_name' ) ); ?>> |
| 1660 | <?php echo wp_kses_post( $settings['premium_testimonial_person_name'] ); ?> |
| 1661 | </span> |
| 1662 | </<?php echo wp_kses_post( $person_title_tag ); ?>> |
| 1663 | |
| 1664 | <?php if ( ! empty( $settings['premium_testimonial_company_name'] ) ) : ?> |
| 1665 | <<?php echo wp_kses_post( $job_tag ); ?> class="premium-testimonial-job"> |
| 1666 | <?php if ( 'yes' === $settings['premium_testimonial_company_link_switcher'] ) : ?> |
| 1667 | <a <?php echo wp_kses_post( $this->get_render_attribute_string( 'link' ) ); ?>> |
| 1668 | <span <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_testimonial_company_name' ) ); ?>> |
| 1669 | <?php echo wp_kses_post( $settings['premium_testimonial_company_name'] ); ?> |
| 1670 | </span> |
| 1671 | </a> |
| 1672 | <?php else : ?> |
| 1673 | <span class="premium-testimonial-company-link" <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_testimonial_company_name' ) ); ?>> |
| 1674 | <?php echo wp_kses_post( $settings['premium_testimonial_company_name'] ); ?> |
| 1675 | </span> |
| 1676 | <?php endif; ?> |
| 1677 | </<?php echo wp_kses_post( $job_tag ); ?>> |
| 1678 | <?php endif; ?> |
| 1679 | </div> |
| 1680 | |
| 1681 | <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?> |
| 1682 | </div> |
| 1683 | <?php endif; ?> |
| 1684 | |
| 1685 | </div> |
| 1686 | |
| 1687 | <?php if ( in_array( $settings['skin'], array( 'skin1', 'skin3' ), true ) ) : ?> |
| 1688 | <div class="premium-testimonial-lower-quote"> |
| 1689 | <?php $this->render_quote_icon(); ?> |
| 1690 | </div> |
| 1691 | <?php endif; ?> |
| 1692 | </div> |
| 1693 | |
| 1694 | <?php else : ?> |
| 1695 | |
| 1696 | <?php if ( 'skin4' === $settings['skin'] ) : ?> |
| 1697 | <div class="premium-testimonial-upper-quote"> |
| 1698 | <?php $this->render_quote_icon(); ?> |
| 1699 | </div> |
| 1700 | <?php endif; ?> |
| 1701 | |
| 1702 | <?php |
| 1703 | foreach ( $testimonials as $index => $testimonial ) : |
| 1704 | |
| 1705 | if ( 'yes' === $show_image ) { |
| 1706 | $testionial_image_html = $this->get_author_image( $testimonial ); |
| 1707 | } |
| 1708 | |
| 1709 | if ( 'yes' === $testimonial['link_switcher'] ) { |
| 1710 | |
| 1711 | $this->add_render_attribute( 'link_' . $index, 'class', 'premium-testimonial-company-link' ); |
| 1712 | $this->add_link_attributes( 'link_' . $index, $testimonial['link'] ); |
| 1713 | } |
| 1714 | |
| 1715 | ?> |
| 1716 | |
| 1717 | <div class="premium-testimonial-container"> |
| 1718 | |
| 1719 | <?php if ( ! in_array( $settings['skin'], array( 'skin3', 'skin4' ), true ) ) : ?> |
| 1720 | <div class="premium-testimonial-upper-quote"> |
| 1721 | <?php $this->render_quote_icon(); ?> |
| 1722 | </div> |
| 1723 | <?php endif; ?> |
| 1724 | |
| 1725 | <div class="premium-testimonial-content-wrapper"> |
| 1726 | |
| 1727 | <?php if ( ! empty( $testimonial['heading'] ) ) : ?> |
| 1728 | <div class="premium-testimonial-heading"> |
| 1729 | <p <?php echo wp_kses_post( $this->get_render_attribute_string( 'heading' ) ); ?>> |
| 1730 | <?php echo wp_kses_post( $testimonial['heading'] ); ?> |
| 1731 | </p> |
| 1732 | </div> |
| 1733 | <?php endif; ?> |
| 1734 | |
| 1735 | <div class="premium-testimonial-text-wrapper"> |
| 1736 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_testimonial_content' ) ); ?>> |
| 1737 | <?php echo $this->parse_text_editor( $testimonial['content'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 1738 | </div> |
| 1739 | </div> |
| 1740 | |
| 1741 | <?php if ( ! empty( $testimonial['rating'] ) ) : ?> |
| 1742 | <div class="premium-testimonial__rating-wrapper"> |
| 1743 | <?php echo Helper_Functions::render_rating_stars( $testimonial['rating'], $settings['fill'], $settings['empty'], $settings['star_size'] ); ?> |
| 1744 | </div> |
| 1745 | <?php endif; ?> |
| 1746 | |
| 1747 | <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?> |
| 1748 | <div class="premium-testimonial__img-info"> |
| 1749 | <?php endif; ?> |
| 1750 | |
| 1751 | <?php if ( 'skin4' !== $settings['skin'] ) : ?> |
| 1752 | <?php if ( ! empty( $testionial_image_html ) ) : ?> |
| 1753 | <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'img_wrap' ) ); ?>> |
| 1754 | <?php echo wp_kses_post( $testionial_image_html ); ?> |
| 1755 | </div> |
| 1756 | <?php endif; ?> |
| 1757 | <?php endif; ?> |
| 1758 | |
| 1759 | <div class="premium-testimonial-author-info"> |
| 1760 | <<?php echo wp_kses_post( $person_title_tag ); ?> class="premium-testimonial-person-name"> |
| 1761 | <span <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_testimonial_person_name' ) ); ?>> |
| 1762 | <?php echo wp_kses_post( $testimonial['person_name'] ); ?> |
| 1763 | </span> |
| 1764 | </<?php echo wp_kses_post( $person_title_tag ); ?>> |
| 1765 | |
| 1766 | <?php if ( ! empty( $testimonial['company_name'] ) ) : ?> |
| 1767 | <<?php echo wp_kses_post( $job_tag ); ?> class="premium-testimonial-job"> |
| 1768 | <?php if ( 'yes' === $testimonial['link_switcher'] ) : ?> |
| 1769 | <a <?php echo wp_kses_post( $this->get_render_attribute_string( 'link_' . $index ) ); ?>> |
| 1770 | <span <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_testimonial_company_name' ) ); ?>> |
| 1771 | <?php echo wp_kses_post( $testimonial['company_name'] ); ?> |
| 1772 | </span> |
| 1773 | </a> |
| 1774 | <?php else : ?> |
| 1775 | <span class="premium-testimonial-company-link" <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_testimonial_company_name' ) ); ?>> |
| 1776 | <?php echo wp_kses_post( $testimonial['company_name'] ); ?> |
| 1777 | </span> |
| 1778 | <?php endif; ?> |
| 1779 | </<?php echo wp_kses_post( $job_tag ); ?>> |
| 1780 | <?php endif; ?> |
| 1781 | </div> |
| 1782 | |
| 1783 | <?php if ( ! in_array( $settings['skin'], array( 'skin1', 'skin4' ), true ) ) : ?> |
| 1784 | </div> |
| 1785 | <?php endif; ?> |
| 1786 | |
| 1787 | </div> |
| 1788 | |
| 1789 | <?php if ( in_array( $settings['skin'], array( 'skin1', 'skin3' ), true ) ) : ?> |
| 1790 | <div class="premium-testimonial-lower-quote"> |
| 1791 | <?php $this->render_quote_icon(); ?> |
| 1792 | </div> |
| 1793 | <?php endif; ?> |
| 1794 | |
| 1795 | </div> |
| 1796 | |
| 1797 | <?php endforeach; ?> |
| 1798 | <?php endif; ?> |
| 1799 | |
| 1800 | |
| 1801 | </div> |
| 1802 | <?php |
| 1803 | } |
| 1804 | |
| 1805 | /** |
| 1806 | * Render Quote Icon |
| 1807 | * |
| 1808 | * @since 4.10.13 |
| 1809 | * @access protected |
| 1810 | */ |
| 1811 | protected function render_quote_icon() { |
| 1812 | |
| 1813 | $settings = $this->get_settings_for_display(); |
| 1814 | |
| 1815 | if ( 'rounded' === $settings['icon_style'] ) { |
| 1816 | |
| 1817 | $svg_html = '<svg id="Layer_1" class="premium-testimonial-quote" xmlns="http://www.w3.org/2000/svg" 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>'; |
| 1818 | |
| 1819 | } else { |
| 1820 | |
| 1821 | $svg_html = '<svg id="Layer_1" class="premium-testimonial-quote" xmlns="http://www.w3.org/2000/svg" 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>'; |
| 1822 | } |
| 1823 | |
| 1824 | echo $svg_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 1825 | } |
| 1826 | |
| 1827 | /** |
| 1828 | * Get Author Image |
| 1829 | * |
| 1830 | * @since 4.10.13 |
| 1831 | * @access protected |
| 1832 | */ |
| 1833 | protected function get_author_image( $testimonial ) { |
| 1834 | |
| 1835 | $testionial_image_html = ''; |
| 1836 | if ( ! empty( $testimonial['person_image']['url'] ) ) { |
| 1837 | |
| 1838 | $image_src = $testimonial['person_image']['url']; |
| 1839 | $image_id = attachment_url_to_postid( $image_src ); |
| 1840 | |
| 1841 | $settings['image_data'] = Helper_Functions::get_image_data( $image_id, $testimonial['person_image']['url'], 'thumbnail' ); |
| 1842 | $testionial_image_html = Group_Control_Image_Size::get_attachment_image_html( $settings, 'thumbnail', 'image_data' ); |
| 1843 | |
| 1844 | } |
| 1845 | |
| 1846 | return $testionial_image_html; |
| 1847 | } |
| 1848 | } |
| 1849 |