templates
4 months ago
Accordion.php
9 months ago
Alerts_Box.php
9 months ago
Blog_Grid.php
6 months ago
Cheat_Sheet.php
6 months ago
Counter.php
6 months ago
Dynamic_Faq.php
1 month ago
Icon_Box.php
6 months ago
Integrations.php
6 months ago
List_Item.php
9 months ago
Tabs.php
6 months ago
Team_Carousel.php
6 months ago
Testimonial.php
6 months ago
Timeline.php
9 months ago
Video_Playlist.php
6 months ago
Video_Popup.php
6 months ago
Testimonial.php
1335 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SPEL\Widgets; |
| 4 | |
| 5 | use Elementor\Repeater; |
| 6 | use Elementor\Utils; |
| 7 | use Elementor\Widget_Base; |
| 8 | use Elementor\Controls_Manager; |
| 9 | use Elementor\Group_Control_Border; |
| 10 | use Elementor\Group_Control_Typography; |
| 11 | use Elementor\Group_Control_Background; |
| 12 | |
| 13 | // Exit if accessed directly |
| 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | exit; |
| 16 | } |
| 17 | |
| 18 | |
| 19 | /** |
| 20 | * Class Testimonial |
| 21 | * |
| 22 | * @package spider\Widgets |
| 23 | */ |
| 24 | class Testimonial extends Widget_Base { |
| 25 | |
| 26 | public function get_name() { |
| 27 | return 'docy_testimonial'; // ID of the widget (Don't change this name) |
| 28 | } |
| 29 | |
| 30 | public function get_title() { |
| 31 | return esc_html__( 'Testimonials', 'spider-elements' ); |
| 32 | } |
| 33 | |
| 34 | public function get_icon() { |
| 35 | return 'eicon-testimonial-carousel spel-icon'; |
| 36 | } |
| 37 | |
| 38 | public function get_keywords() { |
| 39 | return [ 'spider', 'spider elements', 'testimonial' ]; |
| 40 | } |
| 41 | |
| 42 | public function get_categories() { |
| 43 | return [ 'spider-elements' ]; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Name: get_style_depends() |
| 48 | * Desc: Register the required CSS dependencies for the frontend. |
| 49 | */ |
| 50 | public function get_style_depends() { |
| 51 | return [ 'slick', 'slick-theme', 'swiper', 'spel-dark-mode', 'spel-main' ]; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Name: get_script_depends() |
| 56 | * Desc: Register the required JS dependencies for the frontend. |
| 57 | */ |
| 58 | public function get_script_depends() { |
| 59 | return [ 'slick', 'swiper', 'wow', 'spel-el-widgets' ]; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Name: register_controls() |
| 64 | * Desc: Register controls for these widgets |
| 65 | * Params: no params |
| 66 | * Return: @void |
| 67 | * Since: @1.0.0 |
| 68 | * Package: @spider-elements |
| 69 | * Author: spider-themes |
| 70 | */ |
| 71 | protected function register_controls() { |
| 72 | $this->elementor_content_control(); |
| 73 | $this->elementor_rating_controls(); |
| 74 | $this->elementor_general_style(); |
| 75 | $this->elementor_style_control(); |
| 76 | $this->elementor_style_icon(); |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Name: elementor_content_control() |
| 81 | * Desc: Register the Content Tab output on the Elementor editor. |
| 82 | * Params: no params |
| 83 | * Return: @void |
| 84 | * Since: @1.0.0 |
| 85 | * Package: @spider-elements |
| 86 | * Author: spider-themes |
| 87 | */ |
| 88 | public function elementor_content_control() { |
| 89 | |
| 90 | //========================= Select Style ======================// |
| 91 | $this->start_controls_section( |
| 92 | 'select_style', [ |
| 93 | 'label' => esc_html__( 'Preset Skins', 'spider-elements' ), |
| 94 | ] |
| 95 | ); |
| 96 | |
| 97 | $this->add_control( |
| 98 | 'style', [ |
| 99 | 'label' => esc_html__( 'Testimonials', 'spider-elements' ), |
| 100 | 'type' => Controls_Manager::CHOOSE, |
| 101 | 'options' => [ |
| 102 | '1' => [ |
| 103 | 'icon' => 'testimonial1', |
| 104 | 'title' => esc_html__( '01 : Carousel Testimonials', 'spider-elements' ) |
| 105 | ], |
| 106 | '2' => [ |
| 107 | 'icon' => 'testimonial2', |
| 108 | 'title' => esc_html__( '02 : Carousel Testimonials', 'spider-elements' ), |
| 109 | ], |
| 110 | '3' => [ |
| 111 | 'icon' => 'testimonial6', |
| 112 | 'title' => esc_html__( '03 : Carousel Testimonials', 'spider-elements' ), |
| 113 | ], |
| 114 | '4' => [ |
| 115 | 'icon' => 'testimonial7', |
| 116 | 'title' => esc_html__( '04 : Carousel Testimonials', 'spider-elements' ), |
| 117 | ], |
| 118 | '5' => [ |
| 119 | 'icon' => 'testimonial8', |
| 120 | 'title' => esc_html__( '05 : Carousel Testimonials', 'spider-elements' ), |
| 121 | ], |
| 122 | '6' => [ |
| 123 | 'icon' => 'testimonial9', |
| 124 | 'title' => esc_html__( '06 : Carousel Testimonials', 'spider-elements' ), |
| 125 | ], |
| 126 | '7' => [ |
| 127 | 'icon' => 'testimonial10', |
| 128 | 'title' => esc_html__( '07 : Carousel Testimonials', 'spider-elements' ), |
| 129 | ], |
| 130 | ], |
| 131 | 'default' => '1', |
| 132 | ] |
| 133 | ); |
| 134 | |
| 135 | $this->end_controls_section(); // End Style |
| 136 | |
| 137 | |
| 138 | //============================ Testimonials =========================// |
| 139 | $this->start_controls_section( |
| 140 | 'sec_testimonials', [ |
| 141 | 'label' => esc_html__( 'Testimonials', 'spider-elements' ), |
| 142 | ] |
| 143 | ); |
| 144 | |
| 145 | //=== Testimonials 01 |
| 146 | $testimonial = new Repeater(); |
| 147 | $testimonial->add_control( |
| 148 | 'author_image', [ |
| 149 | 'label' => esc_html__( 'Author Image', 'spider-elements' ), |
| 150 | 'type' => Controls_Manager::MEDIA, |
| 151 | 'default' => [ |
| 152 | 'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 153 | ], |
| 154 | ] |
| 155 | ); |
| 156 | |
| 157 | $testimonial->add_control( |
| 158 | 'name', [ |
| 159 | 'label' => esc_html__( 'Name', 'spider-elements' ), |
| 160 | 'type' => Controls_Manager::TEXT, |
| 161 | 'default' => esc_html__( 'Mark Tony', 'spider-elements' ), |
| 162 | ] |
| 163 | ); |
| 164 | |
| 165 | $testimonial->add_control( |
| 166 | 'designation', [ |
| 167 | 'label' => esc_html__( 'Designation', 'spider-elements' ), |
| 168 | 'type' => Controls_Manager::TEXT, |
| 169 | 'default' => esc_html__( 'Software Developer', 'spider-elements' ), |
| 170 | ] |
| 171 | ); |
| 172 | |
| 173 | $testimonial->add_control( |
| 174 | 'content', [ |
| 175 | 'label' => esc_html__( 'Review Content', 'spider-elements' ), |
| 176 | 'type' => Controls_Manager::WYSIWYG, |
| 177 | ] |
| 178 | ); |
| 179 | |
| 180 | $testimonial->add_control( |
| 181 | 'signature', [ |
| 182 | 'label' => esc_html__( 'Signature', 'spider-elements' ), |
| 183 | 'type' => Controls_Manager::MEDIA, |
| 184 | //'description' => __( '<strong>Note: </strong>This field is applicable for Preset 01', 'spider-elements' ), |
| 185 | ] |
| 186 | ); |
| 187 | |
| 188 | $this->add_control( |
| 189 | 'testimonials', [ |
| 190 | 'label' => esc_html__( 'Testimonials', 'spider-elements' ), |
| 191 | 'type' => Controls_Manager::REPEATER, |
| 192 | 'fields' => $testimonial->get_controls(), |
| 193 | 'title_field' => '{{{ name }}}', |
| 194 | 'prevent_empty' => false, |
| 195 | 'default' => [ |
| 196 | [ |
| 197 | 'name' => esc_html__( 'Mark Tony', 'spider-elements' ), |
| 198 | 'designation' => esc_html__( 'Software Developer', 'spider-elements' ), |
| 199 | 'content' => esc_html__( 'Hendrerit laoreet incidunt molestie eum placeat, neque ridiculus? Maecenas incididunt aperiam tempora cumque quos?”', |
| 200 | 'spider-elements' ), |
| 201 | ], |
| 202 | [ |
| 203 | 'name' => esc_html__( 'St-rued David', 'spider-elements' ), |
| 204 | 'designation' => esc_html__( 'App Developer', 'spider-elements' ), |
| 205 | 'content' => esc_html__( 'Hendrerit laoreet incidunt molestie eum placeat, neque ridiculus? Maecenas incididunt aperiam tempora cumque quos?”', |
| 206 | 'spider-elements' ), |
| 207 | ], |
| 208 | [ |
| 209 | 'name' => esc_html__( 'Mark Tony', 'spider-elements' ), |
| 210 | 'designation' => esc_html__( 'UI/UX Designer', 'spider-elements' ), |
| 211 | 'content' => esc_html__( 'Hendrerit laoreet incidunt molestie eum placeat, neque ridiculus? Maecenas incididunt aperiam tempora cumque quos?”', |
| 212 | 'spider-elements' ), |
| 213 | ], |
| 214 | ], |
| 215 | 'condition' => [ |
| 216 | 'style' => '1' |
| 217 | ] |
| 218 | ] |
| 219 | ); // End Testimonials 01 |
| 220 | |
| 221 | |
| 222 | //=== Testimonials 02 |
| 223 | $testimonial2 = new Repeater(); |
| 224 | $testimonial2->add_control( |
| 225 | 'author_image', [ |
| 226 | 'label' => esc_html__( 'Author Image', 'spider-elements' ), |
| 227 | 'type' => Controls_Manager::MEDIA, |
| 228 | 'default' => [ |
| 229 | 'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 230 | ], |
| 231 | ] |
| 232 | ); |
| 233 | |
| 234 | $testimonial2->add_control( |
| 235 | 'name', [ |
| 236 | 'label' => esc_html__( 'Name', 'spider-elements' ), |
| 237 | 'type' => Controls_Manager::TEXT, |
| 238 | 'default' => esc_html__( 'Mark Tony', 'spider-elements' ), |
| 239 | ] |
| 240 | ); |
| 241 | |
| 242 | $testimonial2->add_control( |
| 243 | 'designation', [ |
| 244 | 'label' => esc_html__( 'Designation', 'spider-elements' ), |
| 245 | 'type' => Controls_Manager::TEXT, |
| 246 | 'default' => esc_html__( 'Software Developer', 'spider-elements' ), |
| 247 | ] |
| 248 | ); |
| 249 | |
| 250 | $testimonial2->add_control( |
| 251 | 'content', [ |
| 252 | 'label' => esc_html__( 'Review Content', 'spider-elements' ), |
| 253 | 'type' => Controls_Manager::WYSIWYG, |
| 254 | ] |
| 255 | ); |
| 256 | |
| 257 | $this->add_control( |
| 258 | 'testimonials2', [ |
| 259 | 'label' => esc_html__( 'Testimonials', 'spider-elements' ), |
| 260 | 'type' => Controls_Manager::REPEATER, |
| 261 | 'fields' => $testimonial2->get_controls(), |
| 262 | 'title_field' => '{{{ name }}}', |
| 263 | 'prevent_empty' => false, |
| 264 | 'default' => [ |
| 265 | [ |
| 266 | 'name' => esc_html__( 'Mark Tony', 'spider-elements' ), |
| 267 | 'designation' => esc_html__( 'Software Developer', 'spider-elements' ), |
| 268 | 'content' => esc_html__( 'Hendrerit laoreet incidunt molestie eum placeat, neque ridiculus? Maecenas incididunt aperiam tempora cumque quos?”', |
| 269 | 'spider-elements' ), |
| 270 | ], |
| 271 | [ |
| 272 | 'name' => esc_html__( 'Mark Tony', 'spider-elements' ), |
| 273 | 'designation' => esc_html__( 'App Developer', 'spider-elements' ), |
| 274 | 'content' => esc_html__( 'Hendrerit laoreet incidunt molestie eum placeat, neque ridiculus? Maecenas incididunt aperiam tempora cumque quos?”', |
| 275 | 'spider-elements' ), |
| 276 | ], |
| 277 | [ |
| 278 | 'name' => esc_html__( 'Mark Tony', 'spider-elements' ), |
| 279 | 'designation' => esc_html__( 'UI/UX Designer', 'spider-elements' ), |
| 280 | 'content' => esc_html__( 'Hendrerit laoreet incidunt molestie eum placeat, neque ridiculus? Maecenas incididunt aperiam tempora cumque quos?”', |
| 281 | 'spider-elements' ), |
| 282 | ], |
| 283 | ], |
| 284 | 'condition' => [ |
| 285 | 'style' => '2' |
| 286 | ] |
| 287 | ] |
| 288 | ); //End Testimonials 02 |
| 289 | |
| 290 | //=== Testimonials 06 |
| 291 | $testimonial6 = new Repeater(); |
| 292 | $testimonial6->add_control( |
| 293 | 'author_rating', |
| 294 | [ |
| 295 | 'label' => esc_html__( 'Rating', 'spider-elements' ), |
| 296 | 'type' => \Elementor\Controls_Manager::NUMBER, |
| 297 | 'min' => 0, |
| 298 | 'max' => 10, |
| 299 | 'step' => 0.1, |
| 300 | 'default' => 5, |
| 301 | 'dynamic' => [ |
| 302 | 'active' => true, |
| 303 | ], |
| 304 | ] |
| 305 | ); |
| 306 | |
| 307 | $testimonial6->add_control( |
| 308 | 'author_rating_title', |
| 309 | [ |
| 310 | 'label' => esc_html__( 'Title', 'spider-elements' ), |
| 311 | 'type' => \Elementor\Controls_Manager::TEXT, |
| 312 | 'separator' => 'before', |
| 313 | 'default' => esc_html__( '4.8 Awesome', 'spider-elements' ), |
| 314 | ] |
| 315 | ); |
| 316 | |
| 317 | $testimonial6->add_control( |
| 318 | 'company_image', [ |
| 319 | 'label' => esc_html__( 'Company Image', 'spider-elements' ), |
| 320 | 'type' => Controls_Manager::MEDIA, |
| 321 | 'default' => [ |
| 322 | 'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 323 | ], |
| 324 | ] |
| 325 | ); |
| 326 | |
| 327 | $testimonial6->add_control( |
| 328 | 'review_content', [ |
| 329 | 'label' => esc_html__( 'Testimonial Text', 'spider-elements' ), |
| 330 | 'type' => Controls_Manager::TEXTAREA, |
| 331 | ] |
| 332 | ); |
| 333 | $testimonial6->add_control( |
| 334 | 'author_name', [ |
| 335 | 'label' => esc_html__( 'Author Name', 'spider-elements' ), |
| 336 | 'type' => Controls_Manager::TEXT, |
| 337 | 'default' => esc_html__( 'Karina', 'spider-elements' ), |
| 338 | ] |
| 339 | ); |
| 340 | |
| 341 | $testimonial6->add_control( |
| 342 | 'author_position', [ |
| 343 | 'label' => esc_html__( 'Author Position', 'spider-elements' ), |
| 344 | 'type' => Controls_Manager::TEXT, |
| 345 | 'default' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 346 | ] |
| 347 | ); |
| 348 | |
| 349 | $testimonial6->add_control( |
| 350 | 'author_image', [ |
| 351 | 'label' => esc_html__( 'Author Image', 'spider-elements' ), |
| 352 | 'description'=> esc_html__('This will only work for Style 7', 'spider-elements'), |
| 353 | 'type' => Controls_Manager::MEDIA, |
| 354 | 'default' => [ |
| 355 | 'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 356 | ], |
| 357 | ] |
| 358 | ); |
| 359 | |
| 360 | |
| 361 | $this->add_control( |
| 362 | 'testimonials6', [ |
| 363 | 'label' => esc_html__( 'Testimonials', 'spider-elements' ), |
| 364 | 'type' => Controls_Manager::REPEATER, |
| 365 | 'fields' => $testimonial6->get_controls(), |
| 366 | 'title_field' => '{{{ name }}}', |
| 367 | 'prevent_empty' => false, |
| 368 | 'default' => [ |
| 369 | [ |
| 370 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 371 | 'author_position' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 372 | 'review_content' => esc_html__( '“Seattle opera simplifies Performance planning with deski eSignature.”', 'spider-elements' ), |
| 373 | ], |
| 374 | [ |
| 375 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 376 | 'author_position' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 377 | 'review_content' => esc_html__( '“Seattle opera simplifies Performance planning with deski eSignature.”', 'spider-elements' ), |
| 378 | ], |
| 379 | [ |
| 380 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 381 | 'author_position' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 382 | 'review_content' => esc_html__( '“Seattle opera simplifies Performance planning with deski eSignature.”', 'spider-elements' ), |
| 383 | ], |
| 384 | ], |
| 385 | 'condition' => [ |
| 386 | 'style' => [ '3', '4', '6' ] |
| 387 | ] |
| 388 | ] |
| 389 | ); //End Testimonials 06 |
| 390 | |
| 391 | //=== Testimonials 08 |
| 392 | $testimonial8 = new Repeater(); |
| 393 | $testimonial8->add_control( |
| 394 | 'review_content', [ |
| 395 | 'label' => esc_html__( 'Contents', 'spider-elements' ), |
| 396 | 'type' => Controls_Manager::WYSIWYG, |
| 397 | ] |
| 398 | ); |
| 399 | |
| 400 | $testimonial8->add_control( |
| 401 | 'author_name', [ |
| 402 | 'label' => esc_html__( 'Author Name', 'spider-elements' ), |
| 403 | 'type' => Controls_Manager::TEXT, |
| 404 | 'default' => esc_html__( 'Karina', 'spider-elements' ), |
| 405 | ] |
| 406 | ); |
| 407 | $testimonial8->add_control( |
| 408 | 'author_position', [ |
| 409 | 'label' => esc_html__( 'Author Position', 'spider-elements' ), |
| 410 | 'type' => Controls_Manager::TEXT, |
| 411 | 'default' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 412 | ] |
| 413 | ); |
| 414 | $testimonial8->add_control( |
| 415 | 'author_image', [ |
| 416 | 'label' => esc_html__( 'Author Image', 'spider-elements' ), |
| 417 | 'type' => Controls_Manager::MEDIA, |
| 418 | 'default' => [ |
| 419 | 'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 420 | ], |
| 421 | ] |
| 422 | ); |
| 423 | |
| 424 | $this->add_control( |
| 425 | 'testimonials8', [ |
| 426 | 'label' => esc_html__( 'Testimonials', 'spider-elements' ), |
| 427 | 'type' => Controls_Manager::REPEATER, |
| 428 | 'fields' => $testimonial8->get_controls(), |
| 429 | 'title_field' => '{{{ name }}}', |
| 430 | 'prevent_empty' => false, |
| 431 | 'default' => [ |
| 432 | [ |
| 433 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 434 | 'author_position' => esc_html__( 'Italy', 'spider-elements' ), |
| 435 | 'review_content' => esc_html__( '“Very easy to set-up. I had no experience with hosting before signing up with Jobi but they have made everything seem simple.”', |
| 436 | 'spider-elements' ), |
| 437 | ], |
| 438 | [ |
| 439 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 440 | 'author_position' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 441 | 'review_content' => esc_html__( '“Very easy to set-up. I had no experience with hosting before signing up with Jobi but they have made everything seem simple.”', |
| 442 | 'spider-elements' ), |
| 443 | ], |
| 444 | [ |
| 445 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 446 | 'author_position' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 447 | 'review_content' => esc_html__( '“Very easy to set-up. I had no experience with hosting before signing up with Jobi but they have made everything seem simple.”', |
| 448 | 'spider-elements' ), |
| 449 | ], |
| 450 | ], |
| 451 | 'condition' => [ |
| 452 | 'style' => [ '5' ] |
| 453 | ] |
| 454 | ] |
| 455 | ); //End Testimonials 08 |
| 456 | |
| 457 | //=== Testimonials 10 |
| 458 | $testimonial10 = new Repeater(); |
| 459 | $testimonial10->add_control( |
| 460 | 'review_content', [ |
| 461 | 'label' => esc_html__( 'Testimonial Text', 'spider-elements' ), |
| 462 | 'type' => Controls_Manager::TEXTAREA, |
| 463 | ] |
| 464 | ); |
| 465 | $testimonial10->add_control( |
| 466 | 'author_name', [ |
| 467 | 'label' => esc_html__( 'Author Name', 'spider-elements' ), |
| 468 | 'type' => Controls_Manager::TEXT, |
| 469 | 'default' => esc_html__( 'Karina', 'spider-elements' ), |
| 470 | ] |
| 471 | ); |
| 472 | $testimonial10->add_control( |
| 473 | 'author_position', [ |
| 474 | 'label' => esc_html__( 'Author Position', 'spider-elements' ), |
| 475 | 'type' => Controls_Manager::TEXT, |
| 476 | 'default' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 477 | ] |
| 478 | ); |
| 479 | $testimonial10->add_control( |
| 480 | 'author_image', [ |
| 481 | 'label' => esc_html__( 'Author Image', 'spider-elements' ), |
| 482 | 'type' => Controls_Manager::MEDIA, |
| 483 | 'default' => [ |
| 484 | 'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 485 | ], |
| 486 | ] |
| 487 | ); |
| 488 | |
| 489 | $this->add_control( |
| 490 | 'testimonials10', [ |
| 491 | 'label' => esc_html__( 'Testimonials', 'spider-elements' ), |
| 492 | 'type' => Controls_Manager::REPEATER, |
| 493 | 'fields' => $testimonial10->get_controls(), |
| 494 | 'title_field' => '{{{ name }}}', |
| 495 | 'prevent_empty' => false, |
| 496 | 'default' => [ |
| 497 | [ |
| 498 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 499 | 'author_position' => esc_html__( 'Italy', 'spider-elements' ), |
| 500 | 'review_content' => esc_html__( '“Very easy to set-up. I had no experience with hosting before signing up with Jobi but they have made everything seem simple.”', |
| 501 | 'spider-elements' ), |
| 502 | ], |
| 503 | [ |
| 504 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 505 | 'author_position' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 506 | 'review_content' => esc_html__( '“Seattle opera simplifies Performance planning with deski eSignature.”', 'spider-elements' ), |
| 507 | ], |
| 508 | [ |
| 509 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 510 | 'author_position' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 511 | 'review_content' => esc_html__( '“Seattle opera simplifies Performance planning with deski eSignature.”', 'spider-elements' ), |
| 512 | ], |
| 513 | ], |
| 514 | 'condition' => [ |
| 515 | 'style' => '7' |
| 516 | ] |
| 517 | ] |
| 518 | ); //End Testimonials 10 |
| 519 | |
| 520 | //=== Testimonials 11 |
| 521 | $testimonial11 = new Repeater(); |
| 522 | $testimonial11->add_control( |
| 523 | 'review_content', [ |
| 524 | 'label' => esc_html__( 'Testimonial Text', 'spider-elements' ), |
| 525 | 'type' => Controls_Manager::TEXTAREA, |
| 526 | ] |
| 527 | ); |
| 528 | $testimonial11->add_control( |
| 529 | 'author_name', [ |
| 530 | 'label' => esc_html__( 'Author Name', 'spider-elements' ), |
| 531 | 'type' => Controls_Manager::TEXT, |
| 532 | 'default' => esc_html__( 'Karina', 'spider-elements' ), |
| 533 | ] |
| 534 | ); |
| 535 | $testimonial11->add_control( |
| 536 | 'author_position', [ |
| 537 | 'label' => esc_html__( 'Author Position', 'spider-elements' ), |
| 538 | 'type' => Controls_Manager::TEXT, |
| 539 | 'default' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 540 | ] |
| 541 | ); |
| 542 | $testimonial11->add_control( |
| 543 | 'author_image', [ |
| 544 | 'label' => esc_html__( 'Author Image', 'spider-elements' ), |
| 545 | 'type' => Controls_Manager::MEDIA, |
| 546 | 'default' => [ |
| 547 | 'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 548 | ], |
| 549 | ] |
| 550 | ); |
| 551 | |
| 552 | $this->add_control( |
| 553 | 'testimonials11', [ |
| 554 | 'label' => esc_html__( 'Testimonials', 'spider-elements' ), |
| 555 | 'type' => Controls_Manager::REPEATER, |
| 556 | 'fields' => $testimonial11->get_controls(), |
| 557 | 'title_field' => '{{{ name }}}', |
| 558 | 'prevent_empty' => false, |
| 559 | 'default' => [ |
| 560 | [ |
| 561 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 562 | 'author_position' => esc_html__( 'Italy', 'spider-elements' ), |
| 563 | 'review_content' => esc_html__( '“Very easy to set-up. I had no experience with hosting before signing up with Jobi but they have made everything seem simple.”', |
| 564 | 'spider-elements' ), |
| 565 | ], |
| 566 | [ |
| 567 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 568 | 'author_position' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 569 | 'review_content' => esc_html__( '“Seattle opera simplifies Performance planning with deski eSignature.”', 'spider-elements' ), |
| 570 | ], |
| 571 | [ |
| 572 | 'author_name' => esc_html__( 'Karina', 'spider-elements' ), |
| 573 | 'author_position' => esc_html__( 'Lead Designer', 'spider-elements' ), |
| 574 | 'review_content' => esc_html__( '“Seattle opera simplifies Performance planning with deski eSignature.”', 'spider-elements' ), |
| 575 | ], |
| 576 | ], |
| 577 | 'condition' => [ |
| 578 | 'style' => '11' |
| 579 | ] |
| 580 | ] |
| 581 | ); //End Testimonials 11 |
| 582 | |
| 583 | |
| 584 | $this->add_control( |
| 585 | 'shape', [ |
| 586 | 'label' => esc_html__( 'Shape', 'spider-elements' ), |
| 587 | 'type' => Controls_Manager::MEDIA, |
| 588 | 'separator' => 'before', |
| 589 | 'condition' => [ |
| 590 | 'style' => '1' |
| 591 | ], |
| 592 | ] |
| 593 | ); |
| 594 | $this->add_control( |
| 595 | 'quote_img', [ |
| 596 | 'label' => esc_html__( 'Quote Image', 'spider-elements' ), |
| 597 | 'type' => Controls_Manager::MEDIA, |
| 598 | 'separator' => 'before', |
| 599 | 'default' => [ |
| 600 | 'url' => \Elementor\Utils::get_placeholder_image_src(), |
| 601 | ], |
| 602 | 'condition' => [ |
| 603 | 'style' => '7' |
| 604 | ], |
| 605 | ] |
| 606 | ); |
| 607 | |
| 608 | $this->end_controls_section(); // End Testimonials |
| 609 | |
| 610 | } |
| 611 | |
| 612 | // Testimonial Repeater |
| 613 | protected function elementor_rating_controls() { |
| 614 | $this->start_controls_section( |
| 615 | 'section_rating', |
| 616 | [ |
| 617 | 'label' => esc_html__( 'Rating', 'spider-elements' ), |
| 618 | 'condition' => [ |
| 619 | 'style' => [ '3', '4', '6' ] |
| 620 | ], |
| 621 | ], |
| 622 | |
| 623 | ); |
| 624 | |
| 625 | $this->add_control( |
| 626 | 'testimonial_ratting_icon', |
| 627 | [ |
| 628 | 'label' => esc_html__( 'Show Rating', 'spider-elements' ), |
| 629 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 630 | 'label_on' => esc_html__( 'Show', 'spider-elements' ), |
| 631 | 'label_off' => esc_html__( 'Hide', 'spider-elements' ), |
| 632 | 'return_value' => 'yes', |
| 633 | 'default' => 'yes', |
| 634 | ] |
| 635 | ); |
| 636 | |
| 637 | |
| 638 | $this->add_control( |
| 639 | 'rating_scale', |
| 640 | [ |
| 641 | 'label' => esc_html__( 'Rating Scale', 'spider-elements' ), |
| 642 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 643 | 'options' => [ |
| 644 | '5' => '0-5', |
| 645 | '10' => '0-10', |
| 646 | ], |
| 647 | 'default' => '5', |
| 648 | 'condition' => [ |
| 649 | 'testimonial_ratting_icon' => [ 'yes' ], |
| 650 | ], |
| 651 | ] |
| 652 | ); |
| 653 | |
| 654 | $this->add_control( |
| 655 | 'star_style', |
| 656 | [ |
| 657 | 'label' => esc_html__( 'Icon', 'spider-elements' ), |
| 658 | 'type' => \Elementor\Controls_Manager::SELECT, |
| 659 | 'options' => [ |
| 660 | 'star_fontawesome' => 'Font Awesome', |
| 661 | 'star_unicode' => 'Unicode', |
| 662 | ], |
| 663 | 'default' => 'star_fontawesome', |
| 664 | 'render_type' => 'template', |
| 665 | 'prefix_class' => 'elementor--star-style-', |
| 666 | 'separator' => 'before', |
| 667 | ] |
| 668 | ); |
| 669 | |
| 670 | $this->add_control( |
| 671 | 'unmarked_star_style', |
| 672 | [ |
| 673 | 'label' => esc_html__( 'Unmarked Style', 'spider-elements' ), |
| 674 | 'type' => \Elementor\Controls_Manager::CHOOSE, |
| 675 | 'options' => [ |
| 676 | 'solid' => [ |
| 677 | 'title' => esc_html__( 'Solid', 'spider-elements' ), |
| 678 | 'icon' => 'eicon-star', |
| 679 | ], |
| 680 | 'outline' => [ |
| 681 | 'title' => esc_html__( 'Outline', 'spider-elements' ), |
| 682 | 'icon' => 'eicon-star-o', |
| 683 | ], |
| 684 | ], |
| 685 | 'default' => 'solid', |
| 686 | ] |
| 687 | ); |
| 688 | |
| 689 | $this->end_controls_section(); |
| 690 | } |
| 691 | |
| 692 | |
| 693 | /** |
| 694 | * Name: elementor_style_control() |
| 695 | * Desc: Register the Style Tab output on the Elementor editor. |
| 696 | * Params: no params |
| 697 | * Return: @void |
| 698 | * Since: @1.0.0 |
| 699 | * Package: @spider-elements |
| 700 | * Author: spider-themes |
| 701 | */ |
| 702 | |
| 703 | public function elementor_general_style() { |
| 704 | $this->start_controls_section( |
| 705 | 'style_item_tabs', [ |
| 706 | 'label' => esc_html__( 'Testimonial Item', 'spider-elements' ), |
| 707 | 'tab' => Controls_Manager::TAB_STYLE, |
| 708 | 'condition' => [ |
| 709 | 'style' => [ '3', '4', '6', '7' ] |
| 710 | ] |
| 711 | ] |
| 712 | ); |
| 713 | |
| 714 | $this->start_controls_tabs( |
| 715 | 'style_testimonial_item_tabs' |
| 716 | ); |
| 717 | |
| 718 | //=== Normal testimonial |
| 719 | $this->start_controls_tab( |
| 720 | 'style_normal', |
| 721 | [ |
| 722 | 'label' => esc_html__( 'Normal', 'spider-elements' ), |
| 723 | ] |
| 724 | ); |
| 725 | |
| 726 | $this->add_group_control( |
| 727 | Group_Control_Background::get_type(), |
| 728 | [ |
| 729 | 'name' => 'testimonial_item_background', |
| 730 | 'types' => [ 'classic', 'gradient' ], |
| 731 | 'selector' => '{{WRAPPER}} .feedback-block-one, |
| 732 | {{WRAPPER}} .testimonial-item, |
| 733 | {{WRAPPER}} .feedback-section-four .bg-wrapper ', |
| 734 | ] |
| 735 | ); |
| 736 | |
| 737 | $this->add_group_control( |
| 738 | \Elementor\Group_Control_Border::get_type(), |
| 739 | [ |
| 740 | 'name' => 'item_border', |
| 741 | 'label' => esc_html__( 'Border', 'spider-elements' ), |
| 742 | 'selector' => '{{WRAPPER}} .feedback-block-one, |
| 743 | {{WRAPPER}} .testimonial-item, |
| 744 | {{WRAPPER}} .feedback-section-four .bg-wrapper |
| 745 | ', |
| 746 | ] |
| 747 | ); |
| 748 | |
| 749 | $this->add_responsive_control( |
| 750 | 'item_border_radius', |
| 751 | [ |
| 752 | 'label' => esc_html__( 'Border Radius', 'spider-elements' ), |
| 753 | 'type' => Controls_Manager::DIMENSIONS, |
| 754 | 'size_units' => [ 'px', '%', 'em' ], |
| 755 | 'selectors' => [ |
| 756 | '{{WRAPPER}} .feedback-block-one' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 757 | '{{WRAPPER}} .testimonial-item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 758 | '{{WRAPPER}} .feedback-section-four .bg-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 759 | ], |
| 760 | ] |
| 761 | ); |
| 762 | |
| 763 | $this->add_responsive_control( |
| 764 | 'testimonial_item_mar', |
| 765 | [ |
| 766 | 'label' => esc_html__( 'Margin', 'spider-elements' ), |
| 767 | 'type' => Controls_Manager::DIMENSIONS, |
| 768 | 'size_units' => [ 'px', '%', 'em' ], |
| 769 | 'selectors' => [ |
| 770 | '{{WRAPPER}} .feedback-slider-two .item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 771 | ], |
| 772 | 'condition' => [ |
| 773 | 'style' => '6' |
| 774 | ] |
| 775 | ] |
| 776 | ); |
| 777 | |
| 778 | $this->add_responsive_control( |
| 779 | 'testimonial_item_pad', |
| 780 | [ |
| 781 | 'label' => esc_html__( 'Padding', 'spider-elements' ), |
| 782 | 'type' => Controls_Manager::DIMENSIONS, |
| 783 | 'size_units' => [ 'px', '%', 'em' ], |
| 784 | 'selectors' => [ |
| 785 | '{{WRAPPER}} .feedback-block-one' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 786 | '{{WRAPPER}} .testimonial-item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 787 | '{{WRAPPER}} .feedback-section-four .bg-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 788 | ], |
| 789 | ] |
| 790 | ); |
| 791 | |
| 792 | $this->end_controls_tab(); //End Normal Testimonial |
| 793 | |
| 794 | |
| 795 | //=== Hover Testimonial |
| 796 | $this->start_controls_tab( |
| 797 | 'testimonial_item_hover', [ |
| 798 | 'label' => esc_html__( 'Hover', 'spider-elements' ), |
| 799 | ] |
| 800 | ); |
| 801 | |
| 802 | $this->add_group_control( |
| 803 | Group_Control_Background::get_type(), |
| 804 | [ |
| 805 | 'name' => 'item_hover_background', |
| 806 | 'types' => [ 'classic', 'gradient' ], |
| 807 | 'selector' => '{{WRAPPER}} .feedback-block-one:hover, |
| 808 | {{WRAPPER}} .feedback-section-four .bg-wrapper:hover', |
| 809 | ] |
| 810 | ); |
| 811 | |
| 812 | $this->add_control( |
| 813 | 'relative_hover_color', |
| 814 | [ |
| 815 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 816 | 'type' => Controls_Manager::COLOR, |
| 817 | 'selectors' => [ |
| 818 | '{{WRAPPER}} .feedback-section-four:hover .bg-wrapper p' => 'color: {{VALUE}};', |
| 819 | ], |
| 820 | 'condition' => [ |
| 821 | 'style' => '7' |
| 822 | ] |
| 823 | ] |
| 824 | ); |
| 825 | |
| 826 | $this->add_control( |
| 827 | 'author_hover_color', |
| 828 | [ |
| 829 | 'label' => esc_html__( 'Name Color', 'spider-elements' ), |
| 830 | 'type' => Controls_Manager::COLOR, |
| 831 | 'selectors' => [ |
| 832 | '{{WRAPPER}} .feedback-section-four:hover .bg-wrapper .name' => 'color: {{VALUE}};', |
| 833 | ], |
| 834 | 'condition' => [ |
| 835 | 'style' => '7' |
| 836 | ] |
| 837 | ] |
| 838 | ); |
| 839 | |
| 840 | $this->add_control( |
| 841 | 'testimonial_item_hover_border', [ |
| 842 | 'label' => esc_html__( 'Border Color', 'spider-elements' ), |
| 843 | 'type' => Controls_Manager::COLOR, |
| 844 | 'selectors' => [ |
| 845 | '{{WRAPPER}} .feedback-block-one:hover' => 'border-color: {{VALUE}};', |
| 846 | '{{WRAPPER}} .feedback-section-four .bg-wrapper:hover' => 'border-color: {{VALUE}};', |
| 847 | ], |
| 848 | ] |
| 849 | ); |
| 850 | $this->end_controls_tab(); // End testimonial hover Tab |
| 851 | |
| 852 | $this->end_controls_tabs(); // End Accordion icon Normal/Active/ State |
| 853 | $this->end_controls_section(); // End Contents Style |
| 854 | |
| 855 | |
| 856 | //========================= Arrow Icons =======================// |
| 857 | $this->start_controls_section( |
| 858 | 'arrow_icons_sec', [ |
| 859 | 'label' => esc_html__( 'Arrow Icon', 'spider-elements' ), |
| 860 | 'condition' => [ |
| 861 | 'style' => [ '3', '4', '5', '7' ] |
| 862 | ] |
| 863 | ] |
| 864 | ); |
| 865 | |
| 866 | $this->add_control( |
| 867 | 'prev_arrow_icon', [ |
| 868 | 'label' => esc_html__( 'Prev Icon', 'spider-elements' ), |
| 869 | 'type' => \Elementor\Controls_Manager::ICONS, |
| 870 | 'default' => [ |
| 871 | 'value' => 'arrow_carrot-left', |
| 872 | 'library' => 'ElegantIcons' |
| 873 | ], |
| 874 | ] |
| 875 | ); |
| 876 | |
| 877 | $this->add_control( |
| 878 | 'next_arrow_icon', [ |
| 879 | 'label' => esc_html__( 'Next Icon', 'spider-elements' ), |
| 880 | 'type' => \Elementor\Controls_Manager::ICONS, |
| 881 | 'default' => [ |
| 882 | 'value' => 'arrow_carrot-right', |
| 883 | 'library' => 'ElegantIcons' |
| 884 | ], |
| 885 | ] |
| 886 | ); |
| 887 | |
| 888 | $this->end_controls_section(); //End Arrow Icons |
| 889 | |
| 890 | } |
| 891 | |
| 892 | |
| 893 | public function elementor_style_control() { |
| 894 | //========================= Contents =========================// |
| 895 | $this->start_controls_section( |
| 896 | 'style_content_sec', [ |
| 897 | 'label' => esc_html__( 'Contents', 'spider-elements' ), |
| 898 | 'tab' => Controls_Manager::TAB_STYLE, |
| 899 | ] |
| 900 | ); |
| 901 | |
| 902 | //=== Author Name |
| 903 | $this->add_control( |
| 904 | 'author_name_options', [ |
| 905 | 'label' => esc_html__( 'Author Name', 'spider-elements' ), |
| 906 | 'type' => Controls_Manager::HEADING, |
| 907 | 'separator' => 'before', |
| 908 | ] |
| 909 | ); |
| 910 | |
| 911 | $this->add_group_control( |
| 912 | Group_Control_Typography::get_type(), [ |
| 913 | 'name' => 'author_name_typo', |
| 914 | 'selector' => '{{WRAPPER}} .se_name, |
| 915 | {{WRAPPER}} .feedback-block-one .name, |
| 916 | {{WRAPPER}} #feedBack_carousel .name, |
| 917 | {{WRAPPER}} .feedback-section-four .bg-wrapper .name', |
| 918 | ] |
| 919 | ); |
| 920 | |
| 921 | $this->add_control( |
| 922 | 'author_name_color', [ |
| 923 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 924 | 'type' => Controls_Manager::COLOR, |
| 925 | 'selectors' => [ |
| 926 | '{{WRAPPER}} .se_name' => 'color: {{VALUE}};', |
| 927 | '{{WRAPPER}} .feedback-block-one .name' => 'color: {{VALUE}};', |
| 928 | '{{WRAPPER}} #feedBack_carousel .name' => 'color: {{VALUE}};', |
| 929 | '{{WRAPPER}} .feedback-section-four .bg-wrapper .name' => 'color: {{VALUE}};', |
| 930 | ], |
| 931 | ] |
| 932 | ); |
| 933 | //End Author Name |
| 934 | |
| 935 | //=== Review Content |
| 936 | $this->add_control( |
| 937 | 'review_content_options', [ |
| 938 | 'label' => esc_html__( 'Review Content', 'spider-elements' ), |
| 939 | 'type' => Controls_Manager::HEADING, |
| 940 | 'separator' => 'before', |
| 941 | ] |
| 942 | ); |
| 943 | |
| 944 | $this->add_group_control( |
| 945 | Group_Control_Typography::get_type(), [ |
| 946 | 'name' => 'review_text_typo', |
| 947 | 'selector' => '{{WRAPPER}} .se_review_content p, |
| 948 | {{WRAPPER}} .se_review_content, |
| 949 | {{WRAPPER}} .feedback-block-one h3, |
| 950 | {{WRAPPER}} #feedBack_carousel .carousel-inner p, |
| 951 | {{WRAPPER}} .spel_review_content, |
| 952 | {{WRAPPER}} .feedback-section-four .bg-wrapper p', |
| 953 | ] |
| 954 | ); |
| 955 | |
| 956 | $this->add_control( |
| 957 | 'review_content_color', [ |
| 958 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 959 | 'type' => Controls_Manager::COLOR, |
| 960 | 'selectors' => [ |
| 961 | '{{WRAPPER}} .se_review_content p' => 'color: {{VALUE}};', |
| 962 | '{{WRAPPER}} .se_review_content' => 'color: {{VALUE}};', |
| 963 | '{{WRAPPER}} .feedback-block-one h3' => 'color: {{VALUE}};', |
| 964 | '{{WRAPPER}} #feedBack_carousel .carousel-inner p' => 'color: {{VALUE}};', |
| 965 | '{{WRAPPER}} .feedback-section-four .bg-wrapper p' => 'color: {{VALUE}};', |
| 966 | '{{WRAPPER}} .spel_review_content' => 'color: {{VALUE}};', |
| 967 | ], |
| 968 | ] |
| 969 | ); |
| 970 | |
| 971 | $this->add_responsive_control( |
| 972 | 'Content_margin', |
| 973 | [ |
| 974 | 'label' => esc_html__( 'Margin', 'spider-elements' ), |
| 975 | 'type' => Controls_Manager::DIMENSIONS, |
| 976 | 'size_units' => [ 'px', '%', 'em' ], |
| 977 | 'selectors' => [ |
| 978 | '{{WRAPPER}} .feedback-block-two h3' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 979 | '{{WRAPPER}} .feedback-block-one h3' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 980 | '{{WRAPPER}} .feedback-block-three h3' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 981 | '{{WRAPPER}} .testimonial-slider-inner .testimonial-item p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 982 | ], |
| 983 | 'condition' => [ |
| 984 | 'style' => [ '3', '4', '6' ] |
| 985 | ] |
| 986 | ] |
| 987 | );//End Review Content |
| 988 | |
| 989 | //=== Designation |
| 990 | $this->add_control( |
| 991 | 'designation_options', [ |
| 992 | 'label' => esc_html__( 'Designation', 'spider-elements' ), |
| 993 | 'type' => Controls_Manager::HEADING, |
| 994 | 'separator' => 'before', |
| 995 | 'condition' => [ |
| 996 | 'style' => [ '1', '2', '6', ] |
| 997 | ] |
| 998 | ] |
| 999 | ); |
| 1000 | |
| 1001 | $this->add_group_control( |
| 1002 | Group_Control_Typography::get_type(), [ |
| 1003 | 'name' => 'designation_typo', |
| 1004 | 'selector' => '{{WRAPPER}} .se_designation, |
| 1005 | {{WRAPPER}} .feedback-block-two .block-footer span', |
| 1006 | 'condition' => [ |
| 1007 | 'style' => [ '1', '2','6', '11' ] |
| 1008 | ] |
| 1009 | ] |
| 1010 | ); |
| 1011 | |
| 1012 | $this->add_control( |
| 1013 | 'designation_color', [ |
| 1014 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 1015 | 'type' => Controls_Manager::COLOR, |
| 1016 | 'selectors' => [ |
| 1017 | '{{WRAPPER}} .se_designation' => 'color: {{VALUE}};', |
| 1018 | '{{WRAPPER}} .feedback-block-two .block-footer span' => 'color: {{VALUE}};', |
| 1019 | ], |
| 1020 | 'condition' => [ |
| 1021 | 'style' => [ '1', '2', '6', ] |
| 1022 | ] |
| 1023 | ] |
| 1024 | ); |
| 1025 | //End Designation |
| 1026 | |
| 1027 | $this->end_controls_section(); |
| 1028 | |
| 1029 | //========================= Contents =========================// |
| 1030 | $this->start_controls_section( |
| 1031 | 'style_rating_sec', [ |
| 1032 | 'label' => esc_html__( 'Rating', 'spider-elements' ), |
| 1033 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1034 | 'condition' => [ |
| 1035 | 'style' => [ '3', '4', '6' ] |
| 1036 | ] |
| 1037 | ] |
| 1038 | ); |
| 1039 | |
| 1040 | $this->add_group_control( |
| 1041 | Group_Control_Typography::get_type(), [ |
| 1042 | 'name' => 'rating_title_typo', |
| 1043 | 'selector' => '{{WRAPPER}} .feedback-block-one .review .text-md, |
| 1044 | {{WRAPPER}} .feedback-block-two .review .text-md, |
| 1045 | {{WRAPPER}} .feedback-block-three .review .text-md', |
| 1046 | 'condition' => [ |
| 1047 | 'style' => [ '3', '4', '6' ] |
| 1048 | ] |
| 1049 | ] |
| 1050 | ); |
| 1051 | |
| 1052 | $this->add_control( |
| 1053 | 'rating_title_color', [ |
| 1054 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 1055 | 'type' => Controls_Manager::COLOR, |
| 1056 | 'selectors' => [ |
| 1057 | '{{WRAPPER}} .feedback-block-one .review .text-md' => 'color: {{VALUE}};', |
| 1058 | '{{WRAPPER}} .feedback-block-two .review .text-md' => 'color: {{VALUE}};', |
| 1059 | '{{WRAPPER}} .feedback-block-three .review .text-md' => 'color: {{VALUE}};', |
| 1060 | ], |
| 1061 | 'condition' => [ |
| 1062 | 'style' => [ '3', '4', '6' ] |
| 1063 | ] |
| 1064 | ] |
| 1065 | ); |
| 1066 | |
| 1067 | $this->add_responsive_control( |
| 1068 | 'rating_pad', |
| 1069 | [ |
| 1070 | 'label' => esc_html__( 'Padding', 'spider-elements' ), |
| 1071 | 'type' => Controls_Manager::DIMENSIONS, |
| 1072 | 'size_units' => [ 'px', '%', 'em' ], |
| 1073 | 'selectors' => [ |
| 1074 | '{{WRAPPER}} .feedback-block-one .review' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1075 | ], |
| 1076 | 'condition' => [ |
| 1077 | 'style' => [ '3' ], |
| 1078 | 'style!' => [ '4', '6' ] |
| 1079 | ] |
| 1080 | ] |
| 1081 | ); |
| 1082 | |
| 1083 | $this->add_group_control( |
| 1084 | \Elementor\Group_Control_Border::get_type(), |
| 1085 | [ |
| 1086 | 'name' => 'review_border', |
| 1087 | 'label' => esc_html__( 'Top Border', 'spider-elements' ), |
| 1088 | 'selector' => '{{WRAPPER}} .feedback-block-one .review', |
| 1089 | 'condition' => [ |
| 1090 | 'style' => [ '3' ], |
| 1091 | 'style!' => [ '4', '6' ] |
| 1092 | ] |
| 1093 | ] |
| 1094 | ); |
| 1095 | |
| 1096 | $this->add_control( |
| 1097 | 'rating_star_color', [ |
| 1098 | 'label' => esc_html__( 'Star Color', 'spider-elements' ), |
| 1099 | 'type' => Controls_Manager::COLOR, |
| 1100 | 'selectors' => [ |
| 1101 | '{{WRAPPER}} .feedback-block-one .star-rating i::before' => 'color: {{VALUE}};', |
| 1102 | '{{WRAPPER}} .feedback-block-three .star-rating i:before' => 'color: {{VALUE}};', |
| 1103 | ], |
| 1104 | 'condition' => [ |
| 1105 | 'style' => [ '3', '4', '6' ] |
| 1106 | ] |
| 1107 | ] |
| 1108 | ); |
| 1109 | |
| 1110 | $this->end_controls_section(); |
| 1111 | |
| 1112 | } |
| 1113 | |
| 1114 | // start testimonial style 3, 6, 7 icon section======// |
| 1115 | public function elementor_style_icon() { |
| 1116 | //========================= Contents =========================// |
| 1117 | $this->start_controls_section( |
| 1118 | 'testimonial_arrow_style_section', [ |
| 1119 | 'label' => esc_html__( 'Arrow Icon', 'spider-elements' ), |
| 1120 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1121 | 'condition' => [ |
| 1122 | 'style' => [ '3', '4' ] |
| 1123 | ] |
| 1124 | ] |
| 1125 | ); |
| 1126 | |
| 1127 | $this->add_responsive_control( |
| 1128 | 'arrow_icon_size', |
| 1129 | [ |
| 1130 | 'label' => esc_html__( 'Size', 'spider-elements' ), |
| 1131 | 'type' => Controls_Manager::SLIDER, |
| 1132 | 'size_units' => [ 'px', '%' ], |
| 1133 | 'range' => [ |
| 1134 | 'px' => [ |
| 1135 | 'min' => 6, |
| 1136 | 'max' => 100, |
| 1137 | ], |
| 1138 | ], |
| 1139 | 'selectors' => [ |
| 1140 | '{{WRAPPER}} .testimonial_area_nine .navigation .swiper-button-prev:after' => 'font-size: {{SIZE}}{{UNIT}}', |
| 1141 | '{{WRAPPER}} .testimonial_area_nine .navigation .swiper-button-next:after' => 'font-size: {{SIZE}}{{UNIT}}', |
| 1142 | '{{WRAPPER}} .feedback_section_one .slick-arrow-one li i' => 'font-size: {{SIZE}}{{UNIT}}', |
| 1143 | '{{WRAPPER}} .feedback-section-seven .slick-arrow-one li i' => 'font-size: {{SIZE}}{{UNIT}}', |
| 1144 | ], |
| 1145 | ] |
| 1146 | ); |
| 1147 | |
| 1148 | $this->add_responsive_control( |
| 1149 | 'arrow_icon_gaps', |
| 1150 | [ |
| 1151 | 'label' => esc_html__( 'Gap', 'spider-elements' ), |
| 1152 | 'type' => \Elementor\Controls_Manager::SLIDER, |
| 1153 | 'description' => esc_html__( 'Set the gap between icon.', 'spider-elements' ), |
| 1154 | 'range' => [ |
| 1155 | 'px' => [ |
| 1156 | 'min' => 0, |
| 1157 | 'max' => 100, |
| 1158 | 'step' => 1, |
| 1159 | ], |
| 1160 | ], |
| 1161 | 'selectors' => [ |
| 1162 | '{{WRAPPER}} .feedback-section-seven .slick-arrow-one' => 'column-gap: {{SIZE}}{{UNIT}};', |
| 1163 | '{{WRAPPER}} .feedback_section_one .slick-arrow-one' => 'column-gap: {{SIZE}}{{UNIT}};', |
| 1164 | ], |
| 1165 | 'condition' => [ |
| 1166 | 'style' => [ '3', '4' ] |
| 1167 | ] |
| 1168 | ] |
| 1169 | ); |
| 1170 | |
| 1171 | //testimonial arrow icon normal/hover style tabs |
| 1172 | $this->start_controls_tabs( |
| 1173 | 'testimonial_arrow_icon_style_tabs' |
| 1174 | ); |
| 1175 | |
| 1176 | $this->start_controls_tab( |
| 1177 | 'arrow_icon_normal_style', |
| 1178 | [ |
| 1179 | 'label' => esc_html__( 'Normal', 'spider-elements' ), |
| 1180 | ] |
| 1181 | ); |
| 1182 | |
| 1183 | $this->add_control( |
| 1184 | 'icon_color', |
| 1185 | [ |
| 1186 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 1187 | 'type' => Controls_Manager::COLOR, |
| 1188 | 'selectors' => [ |
| 1189 | '{{WRAPPER}} .testimonial_area_nine .navigation .swiper-button-prev:after, .testimonial_area_nine .navigation .swiper-button-next:after' => 'color: {{VALUE}}', |
| 1190 | '{{WRAPPER}} .feedback_section_one .slick-arrow-one li i' => 'color: {{VALUE}}', |
| 1191 | '{{WRAPPER}} .feedback-section-seven .slick-arrow-one li i' => 'color: {{VALUE}}', |
| 1192 | ], |
| 1193 | ] |
| 1194 | ); |
| 1195 | |
| 1196 | $this->add_control( |
| 1197 | 'icon_bg_color', |
| 1198 | [ |
| 1199 | 'label' => esc_html__( 'Background', 'spider-elements' ), |
| 1200 | 'type' => Controls_Manager::COLOR, |
| 1201 | 'selectors' => [ |
| 1202 | '{{WRAPPER}} .testimonial_area_nine .navigation .swiper-button-prev' => 'background: {{VALUE}}', |
| 1203 | '{{WRAPPER}} .testimonial_area_nine .navigation .swiper-button-next' => 'background: {{VALUE}}', |
| 1204 | '{{WRAPPER}} .feedback_section_one .slick-arrow-one li' => 'background: {{VALUE}}', |
| 1205 | '{{WRAPPER}} .feedback-section-seven .slick-arrow-one li' => 'background: {{VALUE}}', |
| 1206 | ], |
| 1207 | ] |
| 1208 | ); |
| 1209 | |
| 1210 | $this->end_controls_tab(); //end normal tab |
| 1211 | |
| 1212 | //testimonial arrow icon hover style |
| 1213 | $this->start_controls_tab( |
| 1214 | 'arrow_icon_hover_style', |
| 1215 | [ |
| 1216 | 'label' => esc_html__( 'Hover', 'spider-elements' ), |
| 1217 | ] |
| 1218 | ); |
| 1219 | |
| 1220 | $this->add_control( |
| 1221 | 'icon_hover_color', |
| 1222 | [ |
| 1223 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 1224 | 'type' => Controls_Manager::COLOR, |
| 1225 | 'selectors' => [ |
| 1226 | '{{WRAPPER}} .testimonial_area_nine .navigation .swiper-button-prev:hover:after, .testimonial_area_nine .navigation .swiper-button-next:hover:after' => 'color: {{VALUE}}', |
| 1227 | '{{WRAPPER}} .feedback_section_one .slick-arrow-one li:hover i' => 'color: {{VALUE}}', |
| 1228 | '{{WRAPPER}} .feedback-section-seven .slick-arrow-one li:hover i' => 'color: {{VALUE}}', |
| 1229 | ], |
| 1230 | ] |
| 1231 | ); |
| 1232 | |
| 1233 | $this->add_control( |
| 1234 | 'icon_bg_hover_color', |
| 1235 | [ |
| 1236 | 'label' => esc_html__( 'Background', 'spider-elements' ), |
| 1237 | 'type' => Controls_Manager::COLOR, |
| 1238 | 'selectors' => [ |
| 1239 | '{{WRAPPER}} .testimonial_area_nine .navigation .swiper-button-prev:hover' => 'background: {{VALUE}}', |
| 1240 | '{{WRAPPER}} .feedback-section-seven .slick-arrow-one li:hover ' => 'background: {{VALUE}}', |
| 1241 | ], |
| 1242 | ] |
| 1243 | ); |
| 1244 | |
| 1245 | $this->end_controls_tab(); // end arrow icon hover style |
| 1246 | $this->end_controls_tabs(); // end icon normal and hover tabs style |
| 1247 | $this->end_controls_section(); //end rrow icon section |
| 1248 | } |
| 1249 | // end testimonial style 3, 6, 7 icon style tab============// |
| 1250 | |
| 1251 | |
| 1252 | /** |
| 1253 | * Print the actual stars and calculate their filling. |
| 1254 | * |
| 1255 | * Rating type is float to allow stars-count to be a fraction. |
| 1256 | * Floored-rating type is int, to represent the rounded-down stars count. |
| 1257 | * In the `for` loop, the index type is float to allow comparing with the rating value. |
| 1258 | * |
| 1259 | * @since 2.3.0 |
| 1260 | * @access protected |
| 1261 | */ |
| 1262 | protected function render_stars( $icon, $dat = 0 ) { |
| 1263 | $rating_data = $this->get_rating( $dat ); |
| 1264 | $rating = (float) $rating_data[0]; |
| 1265 | $floored_rating = floor( $rating ); |
| 1266 | $stars_html = ''; |
| 1267 | |
| 1268 | // Detect if icon is an HTML tag or just a class name |
| 1269 | $is_html_icon = strpos( $icon, '<' ) !== false; |
| 1270 | |
| 1271 | for ( $stars = 1.0; $stars <= $rating_data[1]; $stars ++ ) { |
| 1272 | $star_class = ''; |
| 1273 | if ( $stars <= $floored_rating ) { |
| 1274 | $star_class = 'elementor-star-full'; |
| 1275 | } elseif ( $floored_rating + 1 === $stars && $rating !== $floored_rating ) { |
| 1276 | $star_class = 'elementor-star-' . ( $rating - $floored_rating ) * 10; |
| 1277 | } else { |
| 1278 | $star_class = 'elementor-star-empty'; |
| 1279 | } |
| 1280 | |
| 1281 | // If the icon is HTML, output it directly |
| 1282 | if ( $is_html_icon ) { |
| 1283 | $stars_html .= '<i class="' . $star_class . '">' . $icon . '</i>'; |
| 1284 | } else { |
| 1285 | // If icon is a class name, use it as a class |
| 1286 | if ( strpos( $icon, '&#' ) === 0 ) { |
| 1287 | // Unicode icon, output as content |
| 1288 | $stars_html .= '<i class="' . $star_class . '">' . html_entity_decode( $icon ) . '</i>'; |
| 1289 | } else { |
| 1290 | $stars_html .= '<i class="' . $star_class . ' ' . esc_attr( $icon ) . '"></i>'; |
| 1291 | } |
| 1292 | } |
| 1293 | } |
| 1294 | |
| 1295 | return $stars_html; |
| 1296 | } |
| 1297 | |
| 1298 | /** |
| 1299 | * @since 2.3.0 |
| 1300 | * @access protected |
| 1301 | */ |
| 1302 | protected function get_rating( $ratting ) { |
| 1303 | $settings = $this->get_settings_for_display(); |
| 1304 | $rating_scale = (int) $settings['rating_scale']; |
| 1305 | $rating = (float) $ratting > $rating_scale ? $rating_scale : $ratting; |
| 1306 | |
| 1307 | return [ $rating, $rating_scale ]; |
| 1308 | } |
| 1309 | |
| 1310 | /** |
| 1311 | * Name: elementor_render() |
| 1312 | * Desc: Render the widget output on the frontend. |
| 1313 | * Params: no params |
| 1314 | * Return: @void |
| 1315 | * Since: @1.0.0 |
| 1316 | * Package: @spider-elements |
| 1317 | * Author: spider-themes |
| 1318 | */ |
| 1319 | protected function render() { |
| 1320 | $settings = $this->get_settings_for_display(); |
| 1321 | extract( $settings ); //extract all settings array to variables converted to name of key |
| 1322 | $icon = ''; |
| 1323 | |
| 1324 | $testimonial_id = $this->get_id(); |
| 1325 | |
| 1326 | //======================== Template Parts ==========================// |
| 1327 | // Whitelist valid style values to prevent Local File Inclusion |
| 1328 | $allowed_styles = array( '1', '2', '3', '4', '5', '6', '7' ); |
| 1329 | $style = isset( $settings['style'] ) && in_array( $settings['style'], $allowed_styles, true ) ? $settings['style'] : '1'; |
| 1330 | include __DIR__ . "/templates/testimonials/testimonial-{$style}.php"; |
| 1331 | |
| 1332 | } |
| 1333 | } |
| 1334 | |
| 1335 |