| 1 |
<?php |
| 2 |
|
| 3 |
namespace Borderless\Widgets; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 6 |
|
| 7 |
use Elementor\Widget_Base; |
| 8 |
use Elementor\Controls_Manager; |
| 9 |
use Elementor\Group_Control_Image_Size; |
| 10 |
use \Elementor\Group_Control_Border; |
| 11 |
use \Elementor\Group_Control_Typography; |
| 12 |
use \Elementor\Group_Control_Background; |
| 13 |
use \Elementor\Group_Control_Css_Filter; |
| 14 |
use \Elementor\Group_Control_Box_Shadow; |
| 15 |
use \Elementor\Icons_Manager; |
| 16 |
use Elementor\Repeater; |
| 17 |
use Elementor\Utils; |
| 18 |
|
| 19 |
class Testimonial extends Widget_Base { |
| 20 |
|
| 21 |
public function get_name() { |
| 22 |
return 'borderless-testimonial'; |
| 23 |
} |
| 24 |
|
| 25 |
public function get_title() { |
| 26 |
return esc_html__( 'Testimonial', 'borderless'); |
| 27 |
} |
| 28 |
|
| 29 |
public function get_icon() { |
| 30 |
return 'fas fa-quote-left'; |
| 31 |
} |
| 32 |
|
| 33 |
public function get_categories() { |
| 34 |
return [ 'borderless' ]; |
| 35 |
} |
| 36 |
|
| 37 |
public function get_keywords() |
| 38 |
{ |
| 39 |
return [ |
| 40 |
'testimonial', |
| 41 |
'testimony', |
| 42 |
'review', |
| 43 |
'endorsement', |
| 44 |
'recommendation', |
| 45 |
'reference', |
| 46 |
'appreciation', |
| 47 |
'feedback', |
| 48 |
'star rating', |
| 49 |
'social proof', |
| 50 |
'borderless', |
| 51 |
'borderless testimonial', |
| 52 |
'borderless testimonials', |
| 53 |
]; |
| 54 |
} |
| 55 |
|
| 56 |
public function get_custom_help_url() |
| 57 |
{ |
| 58 |
return 'https://wpborderless.com/'; |
| 59 |
} |
| 60 |
|
| 61 |
public function get_style_depends() |
| 62 |
{ |
| 63 |
return [ |
| 64 |
'font-awesome-5', |
| 65 |
]; |
| 66 |
} |
| 67 |
|
| 68 |
protected function _register_controls() { |
| 69 |
|
| 70 |
|
| 71 |
/*-----------------------------------------------------------------------------------*/ |
| 72 |
/* *. Avatar |
| 73 |
/*-----------------------------------------------------------------------------------*/ |
| 74 |
|
| 75 |
$this->start_controls_section( |
| 76 |
'borderless_section_testimonial_picture', |
| 77 |
[ |
| 78 |
'label' => esc_html__( 'Picture', 'borderless' ), |
| 79 |
'tab' => Controls_Manager::TAB_CONTENT, |
| 80 |
] |
| 81 |
); |
| 82 |
|
| 83 |
$this->add_control( |
| 84 |
'borderless_testimonial_picture', |
| 85 |
[ |
| 86 |
'label' => __( 'Upload Picture', 'borderless' ), |
| 87 |
'type' => Controls_Manager::MEDIA, |
| 88 |
'default' => [ |
| 89 |
'url' => Utils::get_placeholder_image_src(), |
| 90 |
], |
| 91 |
] |
| 92 |
); |
| 93 |
|
| 94 |
$this->add_group_control( |
| 95 |
Group_Control_Image_Size::get_type(), |
| 96 |
[ |
| 97 |
'name' => 'borderless_testimonial_picture', |
| 98 |
'default' => 'large', |
| 99 |
'separator' => 'none', |
| 100 |
] |
| 101 |
); |
| 102 |
|
| 103 |
$this->add_responsive_control( |
| 104 |
'borderless_testimonial_picture_style', |
| 105 |
[ |
| 106 |
'label' => __( 'Object Fit', 'borderless' ), |
| 107 |
'type' => Controls_Manager::SELECT, |
| 108 |
'condition' => [ |
| 109 |
'height[size]!' => '', |
| 110 |
], |
| 111 |
'options' => [ |
| 112 |
'' => __( 'Default', 'borderless' ), |
| 113 |
'fill' => __( 'Fill', 'borderless' ), |
| 114 |
'cover' => __( 'Cover', 'borderless' ), |
| 115 |
'contain' => __( 'Contain', 'borderless' ), |
| 116 |
], |
| 117 |
'default' => '', |
| 118 |
'selectors' => [ |
| 119 |
'{{WRAPPER}} .borderless-elementor-testimonial-picture figure img' => 'object-fit: {{VALUE}};', |
| 120 |
], |
| 121 |
] |
| 122 |
); |
| 123 |
|
| 124 |
$this->end_controls_section(); |
| 125 |
|
| 126 |
|
| 127 |
/*-----------------------------------------------------------------------------------*/ |
| 128 |
/* *. Content |
| 129 |
/*-----------------------------------------------------------------------------------*/ |
| 130 |
|
| 131 |
$this->start_controls_section( |
| 132 |
'borderless_section_testimonial_content', |
| 133 |
[ |
| 134 |
'label' => esc_html__( 'Content', 'borderless') |
| 135 |
] |
| 136 |
); |
| 137 |
|
| 138 |
$this->add_control( |
| 139 |
'borderless_testimonial_name', |
| 140 |
[ |
| 141 |
'label' => esc_html__( 'Name', 'borderless'), |
| 142 |
'type' => Controls_Manager::TEXT, |
| 143 |
'dynamic' => [ |
| 144 |
'active' => true, |
| 145 |
], |
| 146 |
'default' => esc_html__( 'John Doe', 'borderless'), |
| 147 |
] |
| 148 |
); |
| 149 |
|
| 150 |
$this->add_control( |
| 151 |
'borderless_testimonial_job', |
| 152 |
[ |
| 153 |
'label' => esc_html__( 'Job Position', 'borderless'), |
| 154 |
'type' => Controls_Manager::TEXT, |
| 155 |
'dynamic' => [ |
| 156 |
'active' => true, |
| 157 |
], |
| 158 |
'default' => esc_html__( 'Full Stack Web Developer', 'borderless'), |
| 159 |
] |
| 160 |
); |
| 161 |
|
| 162 |
$this->add_control( |
| 163 |
'borderless_testimonial_description', |
| 164 |
[ |
| 165 |
'label' => esc_html__( 'Description', 'borderless'), |
| 166 |
'type' => Controls_Manager::TEXTAREA, |
| 167 |
'dynamic' => [ |
| 168 |
'active' => true, |
| 169 |
], |
| 170 |
'default' => esc_html__( 'Add team member description here. Remove the text if not necessary.', 'borderless'), |
| 171 |
] |
| 172 |
); |
| 173 |
|
| 174 |
$this->add_control( |
| 175 |
'borderless_testimonial_enable_rating', |
| 176 |
[ |
| 177 |
'label' => esc_html__( 'Display Rating?', 'borderless'), |
| 178 |
'type' => Controls_Manager::SWITCHER, |
| 179 |
'default' => 'yes', |
| 180 |
] |
| 181 |
); |
| 182 |
|
| 183 |
|
| 184 |
$this->add_control( |
| 185 |
'borderless_testimonial_rating_number', |
| 186 |
[ |
| 187 |
'label' => __( 'Rating Number', 'borderless'), |
| 188 |
'type' => Controls_Manager::SELECT, |
| 189 |
'default' => 'rating-five', |
| 190 |
'options' => [ |
| 191 |
'rating-one' => __( '1', 'borderless'), |
| 192 |
'rating-two' => __( '2', 'borderless'), |
| 193 |
'rating-three' => __( '3', 'borderless'), |
| 194 |
'rating-four' => __( '4', 'borderless'), |
| 195 |
'rating-five' => __( '5', 'borderless'), |
| 196 |
], |
| 197 |
'condition' => [ |
| 198 |
'borderless_testimonial_enable_rating' => 'yes', |
| 199 |
], |
| 200 |
] |
| 201 |
); |
| 202 |
|
| 203 |
$this->end_controls_section(); |
| 204 |
|
| 205 |
/*-----------------------------------------------------------------------------------*/ |
| 206 |
/* *. Testimonial - Style |
| 207 |
/*-----------------------------------------------------------------------------------*/ |
| 208 |
|
| 209 |
$this->start_controls_section( |
| 210 |
'borderless_section_testimonial_general_styles', |
| 211 |
[ |
| 212 |
'label' => esc_html__( 'General', 'borderless'), |
| 213 |
'tab' => Controls_Manager::TAB_STYLE |
| 214 |
] |
| 215 |
); |
| 216 |
|
| 217 |
$this->add_control( |
| 218 |
'borderless_section_testimonial_general_background', |
| 219 |
[ |
| 220 |
'label' => esc_html__( 'Background Color', 'borderless'), |
| 221 |
'type' => Controls_Manager::COLOR, |
| 222 |
'default' => '', |
| 223 |
'selectors' => [ |
| 224 |
'{{WRAPPER}} .borderless-elementor-testimonial' => 'background-color: {{VALUE}};', |
| 225 |
], |
| 226 |
] |
| 227 |
); |
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
$start = is_rtl() ? 'end' : 'start'; |
| 232 |
$end = is_rtl() ? 'start' : 'end'; |
| 233 |
|
| 234 |
$this->add_responsive_control( |
| 235 |
'borderless_section_testimonial_general_align', |
| 236 |
[ |
| 237 |
'label' => __( 'Alignment', 'borderless' ), |
| 238 |
'type' => Controls_Manager::CHOOSE, |
| 239 |
'options' => [ |
| 240 |
'left' => [ |
| 241 |
'title' => __( 'Left', 'borderless' ), |
| 242 |
'icon' => 'eicon-text-align-left', |
| 243 |
], |
| 244 |
'center' => [ |
| 245 |
'title' => __( 'Center', 'borderless' ), |
| 246 |
'icon' => 'eicon-text-align-center', |
| 247 |
], |
| 248 |
'right' => [ |
| 249 |
'title' => __( 'Right', 'borderless' ), |
| 250 |
'icon' => 'eicon-text-align-right', |
| 251 |
], |
| 252 |
], |
| 253 |
'prefix_class' => 'e-grid-align-', |
| 254 |
'default' => 'center', |
| 255 |
'selectors' => [ |
| 256 |
'{{WRAPPER}} .borderless-elementor-testimonial' => 'text-align: {{VALUE}}', |
| 257 |
], |
| 258 |
] |
| 259 |
); |
| 260 |
|
| 261 |
$this->add_responsive_control( |
| 262 |
'borderless_section_testimonial_general_margin', |
| 263 |
[ |
| 264 |
'label' => esc_html__( 'Margin', 'borderless'), |
| 265 |
'type' => Controls_Manager::DIMENSIONS, |
| 266 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 267 |
'selectors' => [ |
| 268 |
'{{WRAPPER}} .borderless-elementor-testimonial' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 269 |
], |
| 270 |
] |
| 271 |
); |
| 272 |
|
| 273 |
$this->add_responsive_control( |
| 274 |
'borderless_section_testimonial_general_padding', |
| 275 |
[ |
| 276 |
'label' => esc_html__( 'Padding', 'borderless'), |
| 277 |
'type' => Controls_Manager::DIMENSIONS, |
| 278 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 279 |
'selectors' => [ |
| 280 |
'{{WRAPPER}} .borderless-elementor-testimonial' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 281 |
], |
| 282 |
] |
| 283 |
); |
| 284 |
|
| 285 |
$this->add_group_control( |
| 286 |
Group_Control_Border::get_type(), |
| 287 |
[ |
| 288 |
'name' => 'borderless_section_testimonial_general_border', |
| 289 |
'label' => esc_html__( 'Border', 'borderless'), |
| 290 |
'selector' => '{{WRAPPER}} .borderless-elementor-testimonial', |
| 291 |
] |
| 292 |
); |
| 293 |
|
| 294 |
$this->add_control( |
| 295 |
'borderless_section_testimonial_general_border_radius', |
| 296 |
[ |
| 297 |
'label' => esc_html__( 'Border Radius', 'borderless'), |
| 298 |
'type' => Controls_Manager::DIMENSIONS, |
| 299 |
'selectors' => [ |
| 300 |
'{{WRAPPER}} .borderless-elementor-testimonial' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 301 |
], |
| 302 |
] |
| 303 |
); |
| 304 |
|
| 305 |
$this->end_controls_section(); |
| 306 |
|
| 307 |
|
| 308 |
/*-----------------------------------------------------------------------------------*/ |
| 309 |
/* *. Avatar - Style |
| 310 |
/*-----------------------------------------------------------------------------------*/ |
| 311 |
|
| 312 |
$this->start_controls_section( |
| 313 |
'borderless_section_testimonial_image_styles', |
| 314 |
[ |
| 315 |
'label' => esc_html__( 'Picture', 'borderless'), |
| 316 |
'tab' => Controls_Manager::TAB_STYLE |
| 317 |
] |
| 318 |
); |
| 319 |
|
| 320 |
$this->add_responsive_control( |
| 321 |
'borderless_testimonial_image_width', |
| 322 |
[ |
| 323 |
'label' => esc_html__( 'Width', 'borderless'), |
| 324 |
'type' => Controls_Manager::SLIDER, |
| 325 |
'default' => [ |
| 326 |
'unit' => '%', |
| 327 |
], |
| 328 |
'tablet_default' => [ |
| 329 |
'unit' => '%', |
| 330 |
], |
| 331 |
'mobile_default' => [ |
| 332 |
'unit' => '%', |
| 333 |
], |
| 334 |
'size_units' => [ '%', 'px', 'vw' ], |
| 335 |
'range' => [ |
| 336 |
'%' => [ |
| 337 |
'min' => 1, |
| 338 |
'max' => 100, |
| 339 |
], |
| 340 |
'px' => [ |
| 341 |
'min' => 1, |
| 342 |
'max' => 1000, |
| 343 |
], |
| 344 |
'vw' => [ |
| 345 |
'min' => 1, |
| 346 |
'max' => 100, |
| 347 |
], |
| 348 |
], |
| 349 |
'selectors' => [ |
| 350 |
'{{WRAPPER}} .borderless-elementor-testimonial-picture figure img' => 'width:{{SIZE}}{{UNIT}};', |
| 351 |
], |
| 352 |
] |
| 353 |
); |
| 354 |
|
| 355 |
do_action('borderless/testimonial_circle_controls', $this); |
| 356 |
|
| 357 |
$this->add_responsive_control( |
| 358 |
'borderless_testimonial_image_max_width', |
| 359 |
[ |
| 360 |
'label' => __( 'Max Width', 'borderless' ), |
| 361 |
'type' => Controls_Manager::SLIDER, |
| 362 |
'default' => [ |
| 363 |
'unit' => '%', |
| 364 |
], |
| 365 |
'tablet_default' => [ |
| 366 |
'unit' => '%', |
| 367 |
], |
| 368 |
'mobile_default' => [ |
| 369 |
'unit' => '%', |
| 370 |
], |
| 371 |
'size_units' => [ '%', 'px', 'vw' ], |
| 372 |
'range' => [ |
| 373 |
'%' => [ |
| 374 |
'min' => 1, |
| 375 |
'max' => 100, |
| 376 |
], |
| 377 |
'px' => [ |
| 378 |
'min' => 1, |
| 379 |
'max' => 1000, |
| 380 |
], |
| 381 |
'vw' => [ |
| 382 |
'min' => 1, |
| 383 |
'max' => 100, |
| 384 |
], |
| 385 |
], |
| 386 |
'selectors' => [ |
| 387 |
'{{WRAPPER}} .borderless-elementor-testimonial-picture figure img' => 'max-width:{{SIZE}}{{UNIT}};', |
| 388 |
], |
| 389 |
] |
| 390 |
); |
| 391 |
|
| 392 |
$this->add_responsive_control( |
| 393 |
'borderless_testimonial_image_height', |
| 394 |
[ |
| 395 |
'label' => __( 'Height', 'borderless' ), |
| 396 |
'type' => Controls_Manager::SLIDER, |
| 397 |
'default' => [ |
| 398 |
'unit' => 'px', |
| 399 |
], |
| 400 |
'tablet_default' => [ |
| 401 |
'unit' => 'px', |
| 402 |
], |
| 403 |
'mobile_default' => [ |
| 404 |
'unit' => 'px', |
| 405 |
], |
| 406 |
'size_units' => [ 'px', 'vh' ], |
| 407 |
'range' => [ |
| 408 |
'px' => [ |
| 409 |
'min' => 1, |
| 410 |
'max' => 500, |
| 411 |
], |
| 412 |
'vh' => [ |
| 413 |
'min' => 1, |
| 414 |
'max' => 100, |
| 415 |
], |
| 416 |
], |
| 417 |
'selectors' => [ |
| 418 |
'{{WRAPPER}} .borderless-elementor-testimonial-picture figure img' => 'height: {{SIZE}}{{UNIT}};', |
| 419 |
], |
| 420 |
] |
| 421 |
); |
| 422 |
|
| 423 |
$this->add_responsive_control( |
| 424 |
'borderless_testimonial_image_margin', |
| 425 |
[ |
| 426 |
'label' => esc_html__( 'Margin', 'borderless'), |
| 427 |
'type' => Controls_Manager::DIMENSIONS, |
| 428 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 429 |
'selectors' => [ |
| 430 |
'{{WRAPPER}} .borderless-elementor-testimonial-picture figure img' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 431 |
], |
| 432 |
] |
| 433 |
); |
| 434 |
|
| 435 |
$this->add_responsive_control( |
| 436 |
'borderless_testimonial_image_padding', |
| 437 |
[ |
| 438 |
'label' => esc_html__( 'Padding', 'borderless'), |
| 439 |
'type' => Controls_Manager::DIMENSIONS, |
| 440 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 441 |
'selectors' => [ |
| 442 |
'{{WRAPPER}} .borderless-elementor-testimonial-picture figure img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 443 |
], |
| 444 |
] |
| 445 |
); |
| 446 |
|
| 447 |
$this->add_responsive_control( |
| 448 |
'borderless_testimonial_image_object_fit', |
| 449 |
[ |
| 450 |
'label' => __( 'Object Fit', 'borderless' ), |
| 451 |
'type' => Controls_Manager::SELECT, |
| 452 |
'condition' => [ |
| 453 |
'height[size]!' => '', |
| 454 |
], |
| 455 |
'options' => [ |
| 456 |
'' => __( 'Default', 'borderless' ), |
| 457 |
'fill' => __( 'Fill', 'borderless' ), |
| 458 |
'cover' => __( 'Cover', 'borderless' ), |
| 459 |
'contain' => __( 'Contain', 'borderless' ), |
| 460 |
], |
| 461 |
'default' => '', |
| 462 |
'selectors' => [ |
| 463 |
'{{WRAPPER}} .borderless-elementor-testimonial-picture figure img' => 'object-fit: {{VALUE}};', |
| 464 |
], |
| 465 |
] |
| 466 |
); |
| 467 |
|
| 468 |
$this->add_control( |
| 469 |
'borderless_testimonial_image_separator_panel_style', |
| 470 |
[ |
| 471 |
'type' => Controls_Manager::DIVIDER, |
| 472 |
'style' => 'thick', |
| 473 |
] |
| 474 |
); |
| 475 |
|
| 476 |
$this->start_controls_tabs( 'borderless_testimonial_image_effects' ); |
| 477 |
|
| 478 |
$this->start_controls_tab( 'normal', |
| 479 |
[ |
| 480 |
'label' => __( 'Normal', 'borderless' ), |
| 481 |
] |
| 482 |
); |
| 483 |
|
| 484 |
$this->add_control( |
| 485 |
'borderless_testimonial_image_opacity', |
| 486 |
[ |
| 487 |
'label' => __( 'Opacity', 'borderless' ), |
| 488 |
'type' => Controls_Manager::SLIDER, |
| 489 |
'range' => [ |
| 490 |
'px' => [ |
| 491 |
'max' => 1, |
| 492 |
'min' => 0.10, |
| 493 |
'step' => 0.01, |
| 494 |
], |
| 495 |
], |
| 496 |
'selectors' => [ |
| 497 |
'{{WRAPPER}} .borderless-elementor-testimonial-picture figure img' => 'opacity: {{SIZE}};', |
| 498 |
], |
| 499 |
] |
| 500 |
); |
| 501 |
|
| 502 |
$this->add_group_control( |
| 503 |
Group_Control_Css_Filter::get_type(), |
| 504 |
[ |
| 505 |
'name' => 'borderless_testimonial_image_css_filters', |
| 506 |
'selector' => '{{WRAPPER}} .borderless-elementor-testimonial-picture figure img', |
| 507 |
] |
| 508 |
); |
| 509 |
|
| 510 |
$this->end_controls_tab(); |
| 511 |
|
| 512 |
$this->start_controls_tab( 'hover', |
| 513 |
[ |
| 514 |
'label' => __( 'Hover', 'borderless' ), |
| 515 |
] |
| 516 |
); |
| 517 |
|
| 518 |
$this->add_control( |
| 519 |
'borderless_testimonial_image_opacity_hover', |
| 520 |
[ |
| 521 |
'label' => __( 'Opacity', 'borderless' ), |
| 522 |
'type' => Controls_Manager::SLIDER, |
| 523 |
'range' => [ |
| 524 |
'px' => [ |
| 525 |
'max' => 1, |
| 526 |
'min' => 0.10, |
| 527 |
'step' => 0.01, |
| 528 |
], |
| 529 |
], |
| 530 |
'selectors' => [ |
| 531 |
'{{WRAPPER}} .borderless-elementor-testimonial-social-profiles figure:hover img' => 'opacity: {{SIZE}};', |
| 532 |
], |
| 533 |
] |
| 534 |
); |
| 535 |
|
| 536 |
$this->add_group_control( |
| 537 |
Group_Control_Css_Filter::get_type(), |
| 538 |
[ |
| 539 |
'name' => 'borderless_testimonial_image_css_filters_hover', |
| 540 |
'selector' => '{{WRAPPER}} .borderless-elementor-testimonial-social-profiles figure:hover img', |
| 541 |
] |
| 542 |
); |
| 543 |
|
| 544 |
$this->add_control( |
| 545 |
'borderless_testimonial_image_background_hover_transition', |
| 546 |
[ |
| 547 |
'label' => __( 'Transition Duration', 'borderless' ), |
| 548 |
'type' => Controls_Manager::SLIDER, |
| 549 |
'range' => [ |
| 550 |
'px' => [ |
| 551 |
'max' => 3, |
| 552 |
'step' => 0.1, |
| 553 |
], |
| 554 |
], |
| 555 |
'selectors' => [ |
| 556 |
'{{WRAPPER}} .borderless-elementor-testimonial-picture figure img' => 'transition-duration: {{SIZE}}s', |
| 557 |
], |
| 558 |
] |
| 559 |
); |
| 560 |
|
| 561 |
$this->add_control( |
| 562 |
'borderless_testimonial_image_hover_animation', |
| 563 |
[ |
| 564 |
'label' => __( 'Hover Animation', 'borderless' ), |
| 565 |
'type' => Controls_Manager::HOVER_ANIMATION, |
| 566 |
] |
| 567 |
); |
| 568 |
|
| 569 |
$this->end_controls_tab(); |
| 570 |
|
| 571 |
$this->end_controls_tabs(); |
| 572 |
|
| 573 |
$this->add_group_control( |
| 574 |
Group_Control_Border::get_type(), |
| 575 |
[ |
| 576 |
'name' => 'borderless_testimonial_image_border', |
| 577 |
'selector' => '{{WRAPPER}} .borderless-elementor-testimonial-picture figure img', |
| 578 |
'separator' => 'before', |
| 579 |
] |
| 580 |
); |
| 581 |
|
| 582 |
$this->add_responsive_control( |
| 583 |
'borderless_testimonial_image_border_radius', |
| 584 |
[ |
| 585 |
'label' => __( 'Border Radius', 'borderless' ), |
| 586 |
'type' => Controls_Manager::DIMENSIONS, |
| 587 |
'size_units' => [ 'px', '%' ], |
| 588 |
'selectors' => [ |
| 589 |
'{{WRAPPER}} .borderless-elementor-testimonial-picture figure img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 590 |
], |
| 591 |
] |
| 592 |
); |
| 593 |
|
| 594 |
$this->add_group_control( |
| 595 |
Group_Control_Box_Shadow::get_type(), |
| 596 |
[ |
| 597 |
'name' => 'borderless_testimonial_image_box_shadow', |
| 598 |
'exclude' => [ |
| 599 |
'box_shadow_position', |
| 600 |
], |
| 601 |
'selector' => '{{WRAPPER}} .borderless-elementor-testimonial-picture figure img', |
| 602 |
] |
| 603 |
); |
| 604 |
|
| 605 |
$this->end_controls_section(); |
| 606 |
|
| 607 |
|
| 608 |
/*-----------------------------------------------------------------------------------*/ |
| 609 |
/* *. Content - Style |
| 610 |
/*-----------------------------------------------------------------------------------*/ |
| 611 |
|
| 612 |
$this->start_controls_section( |
| 613 |
'borderless_section_testimonial_content_style', |
| 614 |
[ |
| 615 |
'label' => esc_html__( 'Content', 'borderless'), |
| 616 |
'tab' => Controls_Manager::TAB_STYLE |
| 617 |
] |
| 618 |
); |
| 619 |
|
| 620 |
$this->add_control( |
| 621 |
'borderless_section_testimonial_content_heading_style', |
| 622 |
[ |
| 623 |
'label' => __( 'Content Card', 'borderless'), |
| 624 |
'type' => Controls_Manager::HEADING, |
| 625 |
'separator' => 'before' |
| 626 |
] |
| 627 |
); |
| 628 |
|
| 629 |
$this->add_control( |
| 630 |
'borderless_section_testimonial_content__height', |
| 631 |
[ |
| 632 |
'label' => esc_html__( 'Height', 'borderless'), |
| 633 |
'type' => Controls_Manager::SLIDER, |
| 634 |
'size_units' => [ 'px', 'em' ], |
| 635 |
'range' => [ |
| 636 |
'px' => [ |
| 637 |
'min' => 0, |
| 638 |
'max' => 500, |
| 639 |
], |
| 640 |
'em' => [ |
| 641 |
'min' => 0, |
| 642 |
'max' => 200 |
| 643 |
] |
| 644 |
], |
| 645 |
'default' => [ |
| 646 |
'unit' => 'px', |
| 647 |
'size' => 'auto' |
| 648 |
], |
| 649 |
'selectors' => [ |
| 650 |
'{{WRAPPER}} .borderless-elementor-testimonial-content' => 'min-height: {{SIZE}}{{UNIT}};', |
| 651 |
], |
| 652 |
] |
| 653 |
); |
| 654 |
|
| 655 |
$this->add_control( |
| 656 |
'borderless_section_testimonial_content_background', |
| 657 |
[ |
| 658 |
'label' => esc_html__( 'Content Background Color', 'borderless'), |
| 659 |
'type' => Controls_Manager::COLOR, |
| 660 |
'default' => '', |
| 661 |
'selectors' => [ |
| 662 |
'{{WRAPPER}} .borderless-elementor-testimonial-content' => 'background-color: {{VALUE}};', |
| 663 |
], |
| 664 |
] |
| 665 |
); |
| 666 |
|
| 667 |
|
| 668 |
|
| 669 |
$start = is_rtl() ? 'end' : 'start'; |
| 670 |
$end = is_rtl() ? 'start' : 'end'; |
| 671 |
|
| 672 |
$this->add_responsive_control( |
| 673 |
'borderless_section_testimonial_content_align', |
| 674 |
[ |
| 675 |
'label' => __( 'Alignment', 'borderless' ), |
| 676 |
'type' => Controls_Manager::CHOOSE, |
| 677 |
'options' => [ |
| 678 |
'left' => [ |
| 679 |
'title' => __( 'Left', 'borderless' ), |
| 680 |
'icon' => 'eicon-text-align-left', |
| 681 |
], |
| 682 |
'center' => [ |
| 683 |
'title' => __( 'Center', 'borderless' ), |
| 684 |
'icon' => 'eicon-text-align-center', |
| 685 |
], |
| 686 |
'right' => [ |
| 687 |
'title' => __( 'Right', 'borderless' ), |
| 688 |
'icon' => 'eicon-text-align-right', |
| 689 |
], |
| 690 |
], |
| 691 |
'prefix_class' => 'e-grid-align-', |
| 692 |
'default' => 'center', |
| 693 |
'selectors' => [ |
| 694 |
'{{WRAPPER}} .borderless-elementor-testimonial-content' => 'text-align: {{VALUE}}', |
| 695 |
], |
| 696 |
] |
| 697 |
); |
| 698 |
|
| 699 |
$this->add_responsive_control( |
| 700 |
'borderless_section_testimonial_content_margin', |
| 701 |
[ |
| 702 |
'label' => esc_html__( 'Margin', 'borderless'), |
| 703 |
'type' => Controls_Manager::DIMENSIONS, |
| 704 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 705 |
'selectors' => [ |
| 706 |
'{{WRAPPER}} .borderless-elementor-testimonial-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 707 |
], |
| 708 |
] |
| 709 |
); |
| 710 |
|
| 711 |
$this->add_responsive_control( |
| 712 |
'borderless_section_testimonial_content_padding', |
| 713 |
[ |
| 714 |
'label' => esc_html__( 'Padding', 'borderless'), |
| 715 |
'type' => Controls_Manager::DIMENSIONS, |
| 716 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 717 |
'selectors' => [ |
| 718 |
'{{WRAPPER}} .borderless-elementor-testimonial-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 719 |
], |
| 720 |
] |
| 721 |
); |
| 722 |
|
| 723 |
$this->add_group_control( |
| 724 |
Group_Control_Border::get_type(), |
| 725 |
[ |
| 726 |
'name' => 'borderless_section_testimonial_content_border', |
| 727 |
'label' => esc_html__( 'Border', 'borderless'), |
| 728 |
'selector' => '{{WRAPPER}} .borderless-elementor-testimonial-content', |
| 729 |
] |
| 730 |
); |
| 731 |
|
| 732 |
$this->add_control( |
| 733 |
'borderless_section_testimonial_content_radius', |
| 734 |
[ |
| 735 |
'label' => esc_html__( 'Border Radius', 'borderless'), |
| 736 |
'type' => Controls_Manager::DIMENSIONS, |
| 737 |
'selectors' => [ |
| 738 |
'{{WRAPPER}} .borderless-elementor-testimonial-content' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 739 |
], |
| 740 |
] |
| 741 |
); |
| 742 |
|
| 743 |
$this->end_controls_section(); |
| 744 |
|
| 745 |
/*-----------------------------------------------------------------------------------*/ |
| 746 |
/* *. Quotation - Style |
| 747 |
/*-----------------------------------------------------------------------------------*/ |
| 748 |
|
| 749 |
$this->start_controls_section( |
| 750 |
'borderless_section_testimonial_quotation_style', |
| 751 |
[ |
| 752 |
'label' => esc_html__( 'Quotation', 'borderless'), |
| 753 |
'tab' => Controls_Manager::TAB_STYLE |
| 754 |
] |
| 755 |
); |
| 756 |
|
| 757 |
$this->add_group_control( |
| 758 |
Group_Control_Typography::get_type(), |
| 759 |
[ |
| 760 |
'name' => 'borderless_testimonial_quotation_typography', |
| 761 |
'selector' => '{{WRAPPER}} .borderless-elementor-testimonial-quote', |
| 762 |
] |
| 763 |
); |
| 764 |
|
| 765 |
$this->add_control( |
| 766 |
'borderless_section_testimonial_quotation_color', |
| 767 |
[ |
| 768 |
'label' => esc_html__( 'Color', 'borderless'), |
| 769 |
'type' => Controls_Manager::COLOR, |
| 770 |
'default' => 'rgba(0,0,0,0.15)', |
| 771 |
'selectors' => [ |
| 772 |
'{{WRAPPER}} .borderless-elementor-testimonial-quote' => 'color: {{VALUE}};', |
| 773 |
], |
| 774 |
] |
| 775 |
); |
| 776 |
|
| 777 |
$this->add_responsive_control( |
| 778 |
'borderless_section_testimonial_content_position', |
| 779 |
[ |
| 780 |
'label' => esc_html__( 'Position', 'borderless'), |
| 781 |
'type' => Controls_Manager::DIMENSIONS, |
| 782 |
'size_units' => [ 'px', 'em', '%', 'rem' ], |
| 783 |
'selectors' => [ |
| 784 |
'{{WRAPPER}} .borderless-elementor-testimonial-quote' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 785 |
], |
| 786 |
] |
| 787 |
); |
| 788 |
|
| 789 |
$this->end_controls_section(); |
| 790 |
|
| 791 |
} |
| 792 |
|
| 793 |
protected function borderless_elementor_testimonial_rating() { |
| 794 |
$settings = $this->get_settings_for_display('borderless_testimonial_enable_rating'); |
| 795 |
|
| 796 |
if ( $settings == 'yes' ) : |
| 797 |
ob_start(); |
| 798 |
?> |
| 799 |
<ul class="borderless-elementor-testimonial-star-rating"> |
| 800 |
<li><i class="fas fa-star" aria-hidden="true"></i></li> |
| 801 |
<li><i class="fas fa-star" aria-hidden="true"></i></li> |
| 802 |
<li><i class="fas fa-star" aria-hidden="true"></i></li> |
| 803 |
<li><i class="fas fa-star" aria-hidden="true"></i></li> |
| 804 |
<li><i class="fas fa-star" aria-hidden="true"></i></li> |
| 805 |
</ul> |
| 806 |
<?php |
| 807 |
echo ob_get_clean(); |
| 808 |
endif; |
| 809 |
} |
| 810 |
|
| 811 |
protected function borderless_elementor_testimonial_quote() { |
| 812 |
echo '<span class="borderless-elementor-testimonial-quote"></span>'; |
| 813 |
} |
| 814 |
|
| 815 |
protected function render() { |
| 816 |
|
| 817 |
$settings = $this->get_settings_for_display(); |
| 818 |
$rating = $this->get_settings_for_display('borderless_testimonial_enable_rating'); |
| 819 |
|
| 820 |
$this->add_render_attribute( |
| 821 |
'borderless_testimonial_wrap', |
| 822 |
[ |
| 823 |
'id' => 'borderless-testimonial-'.esc_attr($this->get_id()), |
| 824 |
'class' => [ |
| 825 |
'borderless-elementor-testimonial', |
| 826 |
] |
| 827 |
] |
| 828 |
); |
| 829 |
|
| 830 |
if ( $rating == 'yes' ) |
| 831 |
$this->add_render_attribute('borderless_testimonial_wrap', 'class', $this->get_settings('borderless_testimonial_rating_number')); |
| 832 |
|
| 833 |
?> |
| 834 |
|
| 835 |
<div <?php echo $this->get_render_attribute_string('borderless_testimonial_wrap'); ?>> |
| 836 |
|
| 837 |
<?php if ( !empty( $settings['borderless_testimonial_picture']['url'] ) ) { |
| 838 |
echo' |
| 839 |
<div class="borderless-elementor-testimonial-picture"> |
| 840 |
<figure> |
| 841 |
<img src="'.$settings['borderless_testimonial_picture']['url'].'"> |
| 842 |
</figure> |
| 843 |
</div> |
| 844 |
'; |
| 845 |
} |
| 846 |
|
| 847 |
echo'<div class="borderless-elementor-testimonial-content">'; |
| 848 |
|
| 849 |
if ( ! empty( $settings['borderless_testimonial_description'] ) ) { |
| 850 |
echo'<p class="borderless-elementor-testimonial-description">'.$settings['borderless_testimonial_description'].'</p>'; |
| 851 |
} |
| 852 |
|
| 853 |
$this->borderless_elementor_testimonial_rating( $settings ); |
| 854 |
|
| 855 |
if ( ! empty( $settings['borderless_testimonial_name'] ) ) { |
| 856 |
echo'<h5 class="borderless-elementor-testimonial-name">'.$settings['borderless_testimonial_name'].'</h5>'; |
| 857 |
} |
| 858 |
if ( ! empty( $settings['borderless_testimonial_job'] ) ) { |
| 859 |
echo'<p class="borderless-elementor-testimonial-job">'.$settings['borderless_testimonial_job'].'</p>'; |
| 860 |
} |
| 861 |
echo'</div>'; |
| 862 |
$this->borderless_elementor_testimonial_quote(); |
| 863 |
echo'</div>'; |
| 864 |
|
| 865 |
} |
| 866 |
|
| 867 |
protected function _content_template() { |
| 868 |
|
| 869 |
} |
| 870 |
|
| 871 |
|
| 872 |
} |