dep
3 weeks ago
premium-banner.php
1 day ago
premium-blog.php
2 weeks ago
premium-button.php
2 weeks ago
premium-carousel.php
2 weeks ago
premium-contactform.php
2 weeks ago
premium-countdown.php
2 weeks ago
premium-counter.php
2 weeks ago
premium-dual-header.php
2 weeks ago
premium-fancytext.php
2 weeks ago
premium-grid.php
2 weeks ago
premium-icon-list.php
2 weeks ago
premium-image-button.php
2 weeks ago
premium-image-scroll.php
2 weeks ago
premium-image-separator.php
2 weeks ago
premium-lottie.php
2 weeks ago
premium-maps.php
2 days ago
premium-media-wheel.php
2 weeks ago
premium-mobile-menu.php
2 weeks ago
premium-modalbox.php
2 days ago
premium-nav-menu.php
2 weeks ago
premium-notifications.php
2 weeks ago
premium-person.php
2 weeks ago
premium-pinterest-feed.php
2 weeks ago
premium-post-ticker.php
2 weeks ago
premium-pricing-table.php
2 days ago
premium-progressbar.php
2 weeks ago
premium-search-form.php
2 days ago
premium-svg-drawer.php
2 weeks ago
premium-tcloud.php
2 weeks ago
premium-testimonials.php
2 weeks ago
premium-textual-showcase.php
2 weeks ago
premium-tiktok-feed.php
2 weeks ago
premium-title.php
2 days ago
premium-videobox.php
2 weeks ago
premium-vscroll.php
2 weeks ago
premium-weather.php
2 weeks ago
premium-world-clock.php
2 weeks ago
premium-media-wheel.php
3133 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Advanced AMedia Carousel. |
| 4 | */ |
| 5 | |
| 6 | namespace PremiumAddons\Widgets; |
| 7 | |
| 8 | // Elementor Classes. |
| 9 | use Elementor\Utils; |
| 10 | use Elementor\Embed; |
| 11 | use Elementor\Repeater; |
| 12 | use Elementor\Plugin; |
| 13 | use Elementor\Widget_Base; |
| 14 | use Elementor\Icons_Manager; |
| 15 | use Elementor\Control_Media; |
| 16 | use Elementor\Controls_Manager; |
| 17 | use Elementor\Group_Control_Border; |
| 18 | use Elementor\Group_Control_Css_Filter; |
| 19 | use Elementor\Group_Control_Typography; |
| 20 | use Elementor\Group_Control_Box_Shadow; |
| 21 | use Elementor\Group_Control_Text_Shadow; |
| 22 | use Elementor\Core\Kits\Documents\Tabs\Global_Colors; |
| 23 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 24 | use Elementor\Modules\DynamicTags\Module as TagsModule; |
| 25 | |
| 26 | // PremiumAddons Classes. |
| 27 | use PremiumAddons\Includes\Helper_Functions; |
| 28 | use PremiumAddons\Includes\Controls\Premium_Post_Filter; |
| 29 | use PremiumAddons\Includes\Controls\Premium_Background; |
| 30 | |
| 31 | if ( ! defined( 'ABSPATH' ) ) { |
| 32 | exit; // If this file is called directly, abort. |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Class Premium_Media_wheel |
| 37 | */ |
| 38 | class Premium_Media_Wheel extends Widget_Base { |
| 39 | |
| 40 | /** |
| 41 | * Check for Self Hosted Videos |
| 42 | * |
| 43 | * @var bool |
| 44 | */ |
| 45 | private static $check_self_hosted = false; |
| 46 | |
| 47 | /** |
| 48 | * Check Premium Addons Pro Version. |
| 49 | * |
| 50 | * @var bool $papro_activated |
| 51 | */ |
| 52 | private $papro_activated; |
| 53 | |
| 54 | /** |
| 55 | * Retrieve Widget Name. |
| 56 | * |
| 57 | * @since 1.0.0 |
| 58 | * @access public |
| 59 | */ |
| 60 | public function get_name() { |
| 61 | return 'premium-media-wheel'; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Retrieve Widget Title. |
| 66 | * |
| 67 | * @since 1.0.0 |
| 68 | * @access public |
| 69 | */ |
| 70 | public function get_title() { |
| 71 | return __( 'Advanced Carousel', 'premium-addons-for-elementor' ); |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Retrieve Widget Icon. |
| 76 | * |
| 77 | * @since 1.0.0 |
| 78 | * @access public |
| 79 | */ |
| 80 | public function get_icon() { |
| 81 | return 'pa-media-wheel'; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Retrieve Widget Categories. |
| 86 | * |
| 87 | * @since 1.5.1 |
| 88 | * @access public |
| 89 | * |
| 90 | * @return array Widget categories. |
| 91 | */ |
| 92 | public function get_categories() { |
| 93 | return array( 'premium-elements' ); |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Retrieve Widget Dependent CSS. |
| 98 | * |
| 99 | * @since 1.0.0 |
| 100 | * @access public |
| 101 | * |
| 102 | * @return array CSS script handles. |
| 103 | */ |
| 104 | public function get_style_depends() { |
| 105 | return array( |
| 106 | 'pa-prettyphoto', |
| 107 | 'pa-image-effects', |
| 108 | 'pa-flipster', |
| 109 | 'premium-addons', |
| 110 | ); |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Retrieve Widget Dependent JS. |
| 115 | * |
| 116 | * @since 1.0.0 |
| 117 | * @access public |
| 118 | * |
| 119 | * @return array JS script handles. |
| 120 | */ |
| 121 | public function get_script_depends() { |
| 122 | |
| 123 | $is_edit = Helper_Functions::is_edit_mode(); |
| 124 | |
| 125 | $scripts = array(); |
| 126 | |
| 127 | if ( $is_edit ) { |
| 128 | |
| 129 | $scripts = array_merge( $scripts, array( 'pa-tweenmax', 'mousewheel-js', 'pa-flipster', 'prettyPhoto-js' ) ); |
| 130 | |
| 131 | } else { |
| 132 | $settings = $this->get_settings(); |
| 133 | |
| 134 | if ( 'infinite' === $settings['media_wheel_animation'] ) { |
| 135 | $scripts[] = 'pa-tweenmax'; |
| 136 | } else { |
| 137 | $scripts[] = 'pa-flipster'; |
| 138 | } |
| 139 | |
| 140 | if ( 'yes' === $settings['media_wheel_scroll'] ) { |
| 141 | $scripts[] = 'mousewheel-js'; |
| 142 | } |
| 143 | |
| 144 | if ( 'yes' === $settings['media_light_box'] ) { |
| 145 | $scripts[] = 'prettyPhoto-js'; |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | $scripts[] = 'premium-addons'; |
| 150 | |
| 151 | return $scripts; |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Retrieve Widget Keywords. |
| 156 | * |
| 157 | * @access public |
| 158 | * |
| 159 | * @return array JS script handles. |
| 160 | */ |
| 161 | public function get_keywords() { |
| 162 | return array( 'youtube', 'premium advanced carousel', 'vimeo', 'self', 'hosted', 'scroll', 'image scroll', 'carousel', 'flip', 'coverflow', 'media' ); |
| 163 | } |
| 164 | |
| 165 | protected function is_dynamic_content(): bool { |
| 166 | |
| 167 | $is_edit = Plugin::instance()->editor->is_edit_mode(); |
| 168 | |
| 169 | if ( $is_edit ) { |
| 170 | return false; |
| 171 | } |
| 172 | |
| 173 | $items = $this->get_settings( 'media_wheel_repeater' ); |
| 174 | $is_dynamic_content = false; |
| 175 | |
| 176 | if ( ! empty( $items ) ) { |
| 177 | foreach ( $items as $item ) { |
| 178 | if ( 'template' === $item['pa_media_type'] || 'id' === $item['pa_media_type'] ) { |
| 179 | $is_dynamic_content = true; |
| 180 | break; |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | return $is_dynamic_content; |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * Retrieve Widget Support URL. |
| 190 | * |
| 191 | * @access public |
| 192 | * |
| 193 | * @return string support URL. |
| 194 | */ |
| 195 | public function get_custom_help_url() { |
| 196 | return 'https://premiumaddons.com/support/'; |
| 197 | } |
| 198 | |
| 199 | public function has_widget_inner_wrapper(): bool { |
| 200 | return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' ); |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * Widget preview refresh button. |
| 205 | * |
| 206 | * @since 1.0.0 |
| 207 | * @access public |
| 208 | */ |
| 209 | public function is_reload_preview_required() { |
| 210 | return true; |
| 211 | } |
| 212 | |
| 213 | /** |
| 214 | * Register Advanced Media Carousel controls. |
| 215 | * |
| 216 | * @since 1.0.0 |
| 217 | * @access protected |
| 218 | */ |
| 219 | protected function register_controls() { |
| 220 | |
| 221 | $this->add_items_controls(); |
| 222 | $this->add_advanced_controls(); |
| 223 | $this->add_light_box_controls(); |
| 224 | $this->register_docs_controls(); |
| 225 | |
| 226 | Helper_Functions::register_papro_promotion_controls( $this, 'adv-carousel' ); |
| 227 | |
| 228 | // style controls. |
| 229 | $this->add_img_style_controls(); |
| 230 | $this->add_icon_style_controls(); |
| 231 | $this->add_info_style_controls(); |
| 232 | $this->add_items_style_controls(); |
| 233 | $this->add_navigation_style(); |
| 234 | $this->add_light_box_icon_style(); |
| 235 | $this->add_light_box_style(); |
| 236 | } |
| 237 | |
| 238 | private function add_items_controls() { |
| 239 | |
| 240 | $this->start_controls_section( |
| 241 | 'item_section', |
| 242 | array( |
| 243 | 'label' => __( 'Items', 'premium-addons-for-elementor' ), |
| 244 | ) |
| 245 | ); |
| 246 | |
| 247 | $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-advanced-carousel-widget/', 'adv-carousel', 'wp-editor', 'demo' ); |
| 248 | Helper_Functions::add_templates_controls( $this, 'advanced-carousel', $demo ); |
| 249 | |
| 250 | $repeater = new Repeater(); |
| 251 | |
| 252 | $repeater->add_control( |
| 253 | 'item_name', |
| 254 | array( |
| 255 | 'label' => __( 'Item Name', 'premium-addons-for-elementor' ), |
| 256 | 'type' => Controls_Manager::TEXT, |
| 257 | 'description' => __( 'Use this option to give a unique name to this item', 'premium-addons-for-elementor' ), |
| 258 | 'separator' => 'after', |
| 259 | 'ai' => array( |
| 260 | 'active' => false, |
| 261 | ), |
| 262 | ) |
| 263 | ); |
| 264 | |
| 265 | $repeater->add_control( |
| 266 | 'pa_media_type', |
| 267 | array( |
| 268 | 'label' => __( 'Media Type', 'premium-addons-for-elementor' ), |
| 269 | 'type' => Controls_Manager::SELECT, |
| 270 | 'default' => 'image', |
| 271 | 'options' => array( |
| 272 | 'image' => __( 'Image', 'premium-addons-for-elementor' ), |
| 273 | 'video' => __( 'Video', 'premium-addons-for-elementor' ), |
| 274 | 'template' => __( 'Elementor Template', 'premium-addons-for-elementor' ), |
| 275 | 'id' => __( 'Container ID', 'premium-addons-for-elementor' ), |
| 276 | ), |
| 277 | ) |
| 278 | ); |
| 279 | |
| 280 | $repeater->add_control( |
| 281 | 'container_id', |
| 282 | array( |
| 283 | 'label' => __( 'Container ID', 'premium-addons-for-elementor' ), |
| 284 | 'type' => Controls_Manager::TEXT, |
| 285 | 'description' => __( 'Enter the CSS ID of the container you want to use as a media item.', 'premium-addons-for-elementor' ), |
| 286 | 'condition' => array( |
| 287 | 'pa_media_type' => 'id', |
| 288 | ), |
| 289 | 'ai' => array( |
| 290 | 'active' => false, |
| 291 | ), |
| 292 | ) |
| 293 | ); |
| 294 | |
| 295 | $repeater->add_control( |
| 296 | 'container_id_notice', |
| 297 | array( |
| 298 | 'raw' => __( 'Use this to create slides from containers on this page. For example container-1. Please make sure the container is added before the carousel on the page.', 'premium-addons-for-elementor' ), |
| 299 | 'type' => Controls_Manager::RAW_HTML, |
| 300 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 301 | 'condition' => array( |
| 302 | 'pa_media_type' => 'id', |
| 303 | ), |
| 304 | ) |
| 305 | ); |
| 306 | |
| 307 | $repeater->add_control( |
| 308 | 'media_wheel_img', |
| 309 | array( |
| 310 | 'label' => __( 'Choose Image', 'premium-addons-for-elementor' ), |
| 311 | 'type' => Controls_Manager::MEDIA, |
| 312 | 'dynamic' => array( 'active' => true ), |
| 313 | 'default' => array( |
| 314 | 'url' => Utils::get_placeholder_image_src(), |
| 315 | ), |
| 316 | 'condition' => array( |
| 317 | 'pa_media_type' => array( 'video', 'image' ), |
| 318 | ), |
| 319 | ) |
| 320 | ); |
| 321 | |
| 322 | $repeater->add_control( |
| 323 | 'mw_image_fit', |
| 324 | array( |
| 325 | 'label' => __( 'Image Fit', 'premium-addons-for-elementor' ), |
| 326 | 'type' => Controls_Manager::SELECT, |
| 327 | 'options' => array( |
| 328 | 'cover' => __( 'Cover', 'premium-addons-for-elementor' ), |
| 329 | 'fill' => __( 'Fill', 'premium-addons-for-elementor' ), |
| 330 | 'contain' => __( 'Contain', 'premium-addons-for-elementor' ), |
| 331 | ), |
| 332 | 'default' => 'cover', |
| 333 | 'selectors' => array( |
| 334 | '{{WRAPPER}} {{CURRENT_ITEM}} img.premium-adv-carousel__item-img, {{WRAPPER}} {{CURRENT_ITEM}} .premium-adv-carousel__item-img img, {{WRAPPER}} {{CURRENT_ITEM}} .vid-overlay' => 'object-fit: {{VALUE}}', |
| 335 | ), |
| 336 | 'condition' => array( |
| 337 | 'pa_media_type' => array( 'video', 'image' ), |
| 338 | ), |
| 339 | ) |
| 340 | ); |
| 341 | |
| 342 | $repeater->add_control( |
| 343 | 'mw_image_obj_pos', |
| 344 | array( |
| 345 | 'label' => __( 'Image Position', 'premium-addons-for-elementor' ), |
| 346 | 'type' => Controls_Manager::SELECT, |
| 347 | 'options' => array( |
| 348 | '' => __( 'Default', 'premium-addons-for-elementor' ), |
| 349 | 'center center' => __( 'Center Center', 'premium-addons-for-elementor' ), |
| 350 | 'center left' => __( 'Center Left', 'premium-addons-for-elementor' ), |
| 351 | 'center right' => __( 'Center Right', 'premium-addons-for-elementor' ), |
| 352 | 'top center' => __( 'Top Center', 'premium-addons-for-elementor' ), |
| 353 | 'top left' => __( 'Top Left', 'premium-addons-for-elementor' ), |
| 354 | 'top right' => __( 'Top Right', 'premium-addons-for-elementor' ), |
| 355 | 'bottom center' => __( 'Bottom Center', 'premium-addons-for-elementor' ), |
| 356 | 'bottom left' => __( 'Bottom Left', 'premium-addons-for-elementor' ), |
| 357 | 'bottom right' => __( 'Bottom Right', 'premium-addons-for-elementor' ), |
| 358 | 'initial' => __( 'Custom', 'premium-addons-for-elementor' ), |
| 359 | ), |
| 360 | 'default' => '', |
| 361 | 'selectors' => array( |
| 362 | '{{WRAPPER}} {{CURRENT_ITEM}} img.premium-adv-carousel__item-img, {{WRAPPER}} {{CURRENT_ITEM}} .premium-adv-carousel__item-img img, {{WRAPPER}} {{CURRENT_ITEM}} .vid-overlay' => 'object-position: {{VALUE}}', |
| 363 | ), |
| 364 | 'condition' => array( |
| 365 | 'pa_media_type' => array( 'video', 'image' ), |
| 366 | ), |
| 367 | ) |
| 368 | ); |
| 369 | |
| 370 | $repeater->add_responsive_control( |
| 371 | 'mw_image_obj_pos_x', |
| 372 | array( |
| 373 | 'label' => __( 'X Position', 'premium-addons-for-elementor' ), |
| 374 | 'type' => Controls_Manager::SLIDER, |
| 375 | 'size_units' => array( 'px', '%' ), |
| 376 | 'range' => array( |
| 377 | 'px' => array( |
| 378 | 'min' => -800, |
| 379 | 'max' => 800, |
| 380 | ), |
| 381 | '%' => array( |
| 382 | 'min' => -100, |
| 383 | 'max' => 100, |
| 384 | ), |
| 385 | ), |
| 386 | 'default' => array( |
| 387 | 'size' => 0, |
| 388 | ), |
| 389 | 'tablet_default' => array( |
| 390 | 'size' => 0, |
| 391 | ), |
| 392 | 'mobile_default' => array( |
| 393 | 'size' => 0, |
| 394 | ), |
| 395 | 'selectors' => array( |
| 396 | '{{WRAPPER}} {{CURRENT_ITEM}} img.premium-adv-carousel__item-img, {{WRAPPER}} {{CURRENT_ITEM}} .premium-adv-carousel__item-img img, {{WRAPPER}} {{CURRENT_ITEM}} .vid-overlay' => 'object-position: {{SIZE}}{{UNIT}} {{mw_image_obj_pos_y.SIZE}}{{mw_image_obj_pos_y.UNIT}};', |
| 397 | ), |
| 398 | 'condition' => array( |
| 399 | 'pa_media_type!' => 'template', |
| 400 | 'mw_image_obj_pos' => 'initial', |
| 401 | ), |
| 402 | ) |
| 403 | ); |
| 404 | |
| 405 | $repeater->add_responsive_control( |
| 406 | 'mw_image_obj_pos_y', |
| 407 | array( |
| 408 | 'label' => __( 'Y Position', 'premium-addons-for-elementor' ), |
| 409 | 'type' => Controls_Manager::SLIDER, |
| 410 | 'size_units' => array( 'px', '%' ), |
| 411 | 'range' => array( |
| 412 | 'px' => array( |
| 413 | 'min' => -800, |
| 414 | 'max' => 800, |
| 415 | ), |
| 416 | '%' => array( |
| 417 | 'min' => -100, |
| 418 | 'max' => 100, |
| 419 | ), |
| 420 | ), |
| 421 | 'default' => array( |
| 422 | 'size' => 0, |
| 423 | ), |
| 424 | 'tablet_default' => array( |
| 425 | 'size' => 0, |
| 426 | ), |
| 427 | 'mobile_default' => array( |
| 428 | 'size' => 0, |
| 429 | ), |
| 430 | 'selectors' => array( |
| 431 | '{{WRAPPER}} {{CURRENT_ITEM}} img.premium-adv-carousel__item-img, {{WRAPPER}} {{CURRENT_ITEM}} .premium-adv-carousel__item-img img, {{WRAPPER}} {{CURRENT_ITEM}} .vid-overlay' => 'object-position: {{mw_image_obj_pos_x.SIZE}}{{mw_image_obj_pos_x.UNIT}} {{SIZE}}{{UNIT}};', |
| 432 | ), |
| 433 | 'condition' => array( |
| 434 | 'pa_media_type!' => 'template', |
| 435 | 'mw_image_obj_pos' => 'initial', |
| 436 | ), |
| 437 | ) |
| 438 | ); |
| 439 | |
| 440 | $repeater->add_control( |
| 441 | 'media_wheel_video_type', |
| 442 | array( |
| 443 | 'label' => __( 'Type', 'premium-addons-for-elementor' ), |
| 444 | 'type' => Controls_Manager::SELECT, |
| 445 | 'options' => array( |
| 446 | 'youtube' => __( 'YouTube', 'premium-addons-for-elementor' ), |
| 447 | 'vimeo' => __( 'Vimeo', 'premium-addons-for-elementor' ), |
| 448 | 'hosted' => __( 'Self Hosted', 'premium-addons-for-elementor' ), |
| 449 | ), |
| 450 | 'label_block' => true, |
| 451 | 'default' => 'youtube', |
| 452 | 'condition' => array( |
| 453 | 'pa_media_type' => 'video', |
| 454 | ), |
| 455 | ) |
| 456 | ); |
| 457 | |
| 458 | $repeater->add_control( |
| 459 | 'media_wheel_video_link', |
| 460 | array( |
| 461 | 'label' => __( 'Video Link', 'premium-addons-for-elementor' ), |
| 462 | 'type' => Controls_Manager::TEXT, |
| 463 | 'label_block' => true, |
| 464 | 'dynamic' => array( |
| 465 | 'active' => true, |
| 466 | 'categories' => array( |
| 467 | TagsModule::POST_META_CATEGORY, |
| 468 | TagsModule::URL_CATEGORY, |
| 469 | ), |
| 470 | ), |
| 471 | 'condition' => array( |
| 472 | 'pa_media_type' => 'video', |
| 473 | 'media_wheel_video_type!' => 'hosted', |
| 474 | ), |
| 475 | ) |
| 476 | ); |
| 477 | |
| 478 | $repeater->add_control( |
| 479 | 'media_wheel_video_self', |
| 480 | array( |
| 481 | 'label' => __( 'Select Video', 'premium-addons-for-elementor' ), |
| 482 | 'type' => Controls_Manager::MEDIA, |
| 483 | 'dynamic' => array( |
| 484 | 'active' => true, |
| 485 | 'categories' => array( |
| 486 | TagsModule::POST_META_CATEGORY, |
| 487 | TagsModule::URL_CATEGORY, |
| 488 | ), |
| 489 | ), |
| 490 | 'media_type' => 'video', |
| 491 | 'condition' => array( |
| 492 | 'pa_media_type' => 'video', |
| 493 | 'media_wheel_video_type' => 'hosted', |
| 494 | ), |
| 495 | ) |
| 496 | ); |
| 497 | |
| 498 | $repeater->add_control( |
| 499 | 'media_wheel_video_self_link', |
| 500 | array( |
| 501 | 'label' => __( 'Remote Video Link', 'premium-addons-for-elementor' ), |
| 502 | 'type' => Controls_Manager::TEXT, |
| 503 | 'dynamic' => array( |
| 504 | 'active' => true, |
| 505 | ), |
| 506 | 'label_block' => true, |
| 507 | 'condition' => array( |
| 508 | 'pa_media_type' => 'video', |
| 509 | 'media_wheel_video_type' => 'hosted', |
| 510 | ), |
| 511 | ) |
| 512 | ); |
| 513 | |
| 514 | $repeater->add_responsive_control( |
| 515 | 'mw_hosted_vid_fit', |
| 516 | array( |
| 517 | 'label' => __( 'Video Fit', 'premium-addons-for-elementor' ), |
| 518 | 'type' => Controls_Manager::SELECT, |
| 519 | 'options' => array( |
| 520 | 'cover' => __( 'Cover', 'premium-addons-for-elementor' ), |
| 521 | 'fill' => __( 'Fill', 'premium-addons-for-elementor' ), |
| 522 | 'contain' => __( 'Contain', 'premium-addons-for-elementor' ), |
| 523 | ), |
| 524 | 'default' => 'cover', |
| 525 | 'selectors' => array( |
| 526 | '{{WRAPPER}} {{CURRENT_ITEM}} .premium-adv-carousel__video-wrap video' => 'object-fit: {{VALUE}}', |
| 527 | ), |
| 528 | 'condition' => array( |
| 529 | 'pa_media_type' => 'video', |
| 530 | 'media_wheel_video_type' => 'hosted', |
| 531 | ), |
| 532 | ) |
| 533 | ); |
| 534 | |
| 535 | $repeater->add_control( |
| 536 | 'media_wheel_yt_thumbnail_size', |
| 537 | array( |
| 538 | 'label' => __( 'Thumbnail Size', 'premium-addons-for-elementor' ), |
| 539 | 'type' => Controls_Manager::SELECT, |
| 540 | 'options' => array( |
| 541 | 'maxresdefault' => __( 'Maximum Resolution', 'premium-addons-for-elementor' ), |
| 542 | 'hqdefault' => __( 'High Quality', 'premium-addons-for-elementor' ), |
| 543 | 'mqdefault' => __( 'Medium Quality', 'premium-addons-for-elementor' ), |
| 544 | 'sddefault' => __( 'Standard Quality', 'premium-addons-for-elementor' ), |
| 545 | ), |
| 546 | 'default' => 'maxresdefault', |
| 547 | 'condition' => array( |
| 548 | 'pa_media_type' => 'video', |
| 549 | 'media_wheel_video_type' => 'youtube', |
| 550 | ), |
| 551 | 'render_type' => 'template', |
| 552 | ) |
| 553 | ); |
| 554 | |
| 555 | $repeater->add_control( |
| 556 | 'media_wheel_video_controls', |
| 557 | array( |
| 558 | 'label' => __( 'Controls', 'premium-addons-for-elementor' ), |
| 559 | 'type' => Controls_Manager::SWITCHER, |
| 560 | 'condition' => array( |
| 561 | 'pa_media_type' => 'video', |
| 562 | ), |
| 563 | ) |
| 564 | ); |
| 565 | |
| 566 | $repeater->add_control( |
| 567 | 'media_wheel_video_mute', |
| 568 | array( |
| 569 | 'label' => __( 'Mute', 'premium-addons-for-elementor' ), |
| 570 | 'type' => Controls_Manager::SWITCHER, |
| 571 | 'default' => 'yes', |
| 572 | 'condition' => array( |
| 573 | 'pa_media_type' => 'video', |
| 574 | ), |
| 575 | ) |
| 576 | ); |
| 577 | |
| 578 | $repeater->add_control( |
| 579 | 'media_wheel_video_loop', |
| 580 | array( |
| 581 | 'label' => __( 'Loop', 'premium-addons-for-elementor' ), |
| 582 | 'type' => Controls_Manager::SWITCHER, |
| 583 | 'return_value' => 'true', |
| 584 | 'condition' => array( |
| 585 | 'pa_media_type' => 'video', |
| 586 | 'media_wheel_video_type' => 'hosted', |
| 587 | ), |
| 588 | ) |
| 589 | ); |
| 590 | |
| 591 | $repeater->add_control( |
| 592 | 'media_wheel_video_icon_switcher', |
| 593 | array( |
| 594 | 'label' => __( 'Show Play Icon', 'premium-addons-for-elementor' ), |
| 595 | 'type' => Controls_Manager::SWITCHER, |
| 596 | 'default' => 'yes', |
| 597 | 'condition' => array( |
| 598 | 'pa_media_type' => 'video', |
| 599 | ), |
| 600 | |
| 601 | ) |
| 602 | ); |
| 603 | |
| 604 | $repeater->add_control( |
| 605 | 'media_wheel_videos_icon', |
| 606 | array( |
| 607 | 'label' => __( 'Video Play Icon', 'premium-addons-for-elementor' ), |
| 608 | 'type' => Controls_Manager::ICONS, |
| 609 | 'default' => array( |
| 610 | 'library' => 'fa-solid', |
| 611 | 'value' => 'fas fa-play', |
| 612 | ), |
| 613 | 'condition' => array( |
| 614 | 'media_wheel_video_icon_switcher' => 'yes', |
| 615 | 'pa_media_type' => 'video', |
| 616 | ), |
| 617 | ) |
| 618 | ); |
| 619 | |
| 620 | $repeater->add_responsive_control( |
| 621 | 'media_wheel_vIcon_size', |
| 622 | array( |
| 623 | 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ), |
| 624 | 'type' => Controls_Manager::SLIDER, |
| 625 | 'size_units' => array( 'px' ), |
| 626 | 'range' => array( |
| 627 | 'px' => array( |
| 628 | 'min' => 0, |
| 629 | 'max' => 500, |
| 630 | 'step' => 1, |
| 631 | ), |
| 632 | ), |
| 633 | 'default' => array( |
| 634 | 'unit' => 'px', |
| 635 | 'size' => 25, |
| 636 | ), |
| 637 | 'selectors' => array( |
| 638 | '{{WRAPPER}} {{CURRENT_ITEM}} .pa-media-icons-wrapper .premium-adv-carousel__video-icon i' => 'font-size: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}}', |
| 639 | '{{WRAPPER}} {{CURRENT_ITEM}} .pa-media-icons-wrapper .premium-adv-carousel__video-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}', |
| 640 | ), |
| 641 | 'condition' => array( |
| 642 | 'pa_media_type' => 'video', |
| 643 | 'media_wheel_video_icon_switcher' => 'yes', |
| 644 | ), |
| 645 | ) |
| 646 | ); |
| 647 | |
| 648 | $repeater->add_control( |
| 649 | 'media_wheel_vIcon_color', |
| 650 | array( |
| 651 | 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ), |
| 652 | 'type' => Controls_Manager::COLOR, |
| 653 | 'selectors' => array( |
| 654 | '{{WRAPPER}} {{CURRENT_ITEM}} .pa-media-icons-wrapper .premium-adv-carousel__video-icon i' => 'color: {{VALUE}}', |
| 655 | '{{WRAPPER}} {{CURRENT_ITEM}} .pa-media-icons-wrapper .premium-adv-carousel__video-icon svg' => 'fill: {{VALUE}}', |
| 656 | ), |
| 657 | 'condition' => array( |
| 658 | 'pa_media_type' => 'video', |
| 659 | 'media_wheel_video_icon_switcher' => 'yes', |
| 660 | ), |
| 661 | ) |
| 662 | ); |
| 663 | |
| 664 | $repeater->add_control( |
| 665 | 'live_temp_content', |
| 666 | array( |
| 667 | 'label' => __( 'Template Title', 'premium-addons-for-elementor' ), |
| 668 | 'type' => Controls_Manager::TEXT, |
| 669 | 'label_block' => true, |
| 670 | 'classes' => 'premium-live-temp-title control-hidden', |
| 671 | 'condition' => array( |
| 672 | 'pa_media_type' => 'template', |
| 673 | ), |
| 674 | ) |
| 675 | ); |
| 676 | |
| 677 | $repeater->add_control( |
| 678 | 'section_template_live', |
| 679 | array( |
| 680 | 'type' => Controls_Manager::BUTTON, |
| 681 | 'label_block' => true, |
| 682 | 'button_type' => 'default papro-btn-block', |
| 683 | 'text' => __( 'Create / Edit Template', 'premium-addons-for-elementor' ), |
| 684 | 'event' => 'createLiveTemp', |
| 685 | 'condition' => array( |
| 686 | 'pa_media_type' => 'template', |
| 687 | ), |
| 688 | ) |
| 689 | ); |
| 690 | |
| 691 | $repeater->add_control( |
| 692 | 'section_template', |
| 693 | array( |
| 694 | 'label' => __( 'Elementor Template', 'premium-addons-for-elementor' ), |
| 695 | 'type' => Premium_Post_Filter::TYPE, |
| 696 | 'label_block' => true, |
| 697 | 'multiple' => false, |
| 698 | 'source' => 'elementor_library', |
| 699 | 'condition' => array( |
| 700 | 'pa_media_type' => 'template', |
| 701 | ), |
| 702 | ) |
| 703 | ); |
| 704 | |
| 705 | $repeater->add_control( |
| 706 | 'media_wheel_link_switcher', |
| 707 | array( |
| 708 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 709 | 'type' => Controls_Manager::SWITCHER, |
| 710 | 'separator' => 'before', |
| 711 | 'condition' => array( |
| 712 | 'pa_media_type!' => 'video', |
| 713 | ), |
| 714 | ) |
| 715 | ); |
| 716 | |
| 717 | $repeater->add_control( |
| 718 | 'media_wheel_link_new_tab', |
| 719 | array( |
| 720 | 'label' => __( 'Open In New Tab', 'premium-addons-for-elementor' ), |
| 721 | 'type' => Controls_Manager::SWITCHER, |
| 722 | 'condition' => array( |
| 723 | 'pa_media_type!' => 'video', |
| 724 | 'media_wheel_link_switcher' => 'yes', |
| 725 | ), |
| 726 | ) |
| 727 | ); |
| 728 | |
| 729 | $repeater->add_control( |
| 730 | 'media_wheel_link_type', |
| 731 | array( |
| 732 | 'label' => __( 'Link Type', 'premium-addons-for-elementor' ), |
| 733 | 'type' => Controls_Manager::SELECT, |
| 734 | 'options' => array( |
| 735 | 'url' => __( 'URL', 'premium-addons-for-elementor' ), |
| 736 | 'link' => __( 'Existing Page', 'premium-addons-for-elementor' ), |
| 737 | ), |
| 738 | 'default' => 'url', |
| 739 | 'label_block' => true, |
| 740 | 'condition' => array( |
| 741 | 'media_wheel_link_switcher' => 'yes', |
| 742 | 'pa_media_type!' => 'video', |
| 743 | ), |
| 744 | ) |
| 745 | ); |
| 746 | |
| 747 | $repeater->add_control( |
| 748 | 'media_wheel_custom_link', |
| 749 | array( |
| 750 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 751 | 'type' => Controls_Manager::URL, |
| 752 | 'dynamic' => array( 'active' => true ), |
| 753 | 'default' => array( |
| 754 | 'url' => '#', |
| 755 | ), |
| 756 | 'placeholder' => 'https://premiumaddons.com/', |
| 757 | 'label_block' => true, |
| 758 | 'condition' => array( |
| 759 | 'media_wheel_link_switcher' => 'yes', |
| 760 | 'media_wheel_link_type' => 'url', |
| 761 | 'pa_media_type!' => 'video', |
| 762 | ), |
| 763 | ) |
| 764 | ); |
| 765 | |
| 766 | $repeater->add_control( |
| 767 | 'media_wheel_existing_link', |
| 768 | array( |
| 769 | 'label' => __( 'Existing Page', 'premium-addons-for-elementor' ), |
| 770 | 'type' => Premium_Post_Filter::TYPE, |
| 771 | 'label_block' => true, |
| 772 | 'multiple' => false, |
| 773 | 'source' => array( 'post', 'page' ), |
| 774 | 'condition' => array( |
| 775 | 'media_wheel_link_switcher' => 'yes', |
| 776 | 'media_wheel_link_type' => 'link', |
| 777 | 'pa_media_type!' => 'video', |
| 778 | ), |
| 779 | ) |
| 780 | ); |
| 781 | |
| 782 | $repeater->add_control( |
| 783 | 'media_info', |
| 784 | array( |
| 785 | 'label' => __( 'Media Info', 'premium-addons-for-elementor' ), |
| 786 | 'type' => Controls_Manager::SWITCHER, |
| 787 | 'separator' => 'before', |
| 788 | 'condition' => array( |
| 789 | 'pa_media_type' => array( 'image', 'video' ), |
| 790 | ), |
| 791 | ) |
| 792 | ); |
| 793 | |
| 794 | $repeater->add_control( |
| 795 | 'media_title', |
| 796 | array( |
| 797 | 'label' => __( 'Title', 'premium-addons-for-elementor' ), |
| 798 | 'type' => Controls_Manager::TEXT, |
| 799 | 'dynamic' => array( 'active' => true ), |
| 800 | 'default' => 'Premium Addons', |
| 801 | 'label_block' => true, |
| 802 | 'condition' => array( |
| 803 | 'media_info' => 'yes', |
| 804 | 'pa_media_type' => array( 'image', 'video' ), |
| 805 | ), |
| 806 | ) |
| 807 | ); |
| 808 | |
| 809 | $repeater->add_control( |
| 810 | 'media_desc', |
| 811 | array( |
| 812 | 'label' => __( 'Description', 'premium-addons-for-elementor' ), |
| 813 | 'type' => Controls_Manager::TEXTAREA, |
| 814 | 'dynamic' => array( 'active' => true ), |
| 815 | 'label_block' => true, |
| 816 | 'condition' => array( |
| 817 | 'media_info' => 'yes', |
| 818 | 'pa_media_type' => array( 'image', 'video' ), |
| 819 | ), |
| 820 | ) |
| 821 | ); |
| 822 | |
| 823 | $repeater->add_responsive_control( |
| 824 | 'media_wheel_item_width', |
| 825 | array( |
| 826 | 'label' => __( 'Width', 'premium-addons-for-elementor' ), |
| 827 | 'type' => Controls_Manager::SLIDER, |
| 828 | 'size_units' => array( 'px', '%', 'em' ), |
| 829 | 'separator' => 'before', |
| 830 | 'range' => array( |
| 831 | 'px' => array( |
| 832 | 'min' => 0, |
| 833 | 'max' => 1000, |
| 834 | 'step' => 1, |
| 835 | ), |
| 836 | ), |
| 837 | 'selectors' => array( |
| 838 | '{{WRAPPER}}.premium-adv-carousel__infinite {{CURRENT_ITEM}}.premium-adv-carousel__item' => 'width: {{SIZE}}{{UNIT}}', |
| 839 | ), |
| 840 | ) |
| 841 | ); |
| 842 | |
| 843 | $repeater->add_responsive_control( |
| 844 | 'media_wheel_item_height', |
| 845 | array( |
| 846 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 847 | 'type' => Controls_Manager::SLIDER, |
| 848 | 'size_units' => array( 'px', '%', 'em', 'custom' ), |
| 849 | 'range' => array( |
| 850 | 'px' => array( |
| 851 | 'min' => 0, |
| 852 | 'max' => 1000, |
| 853 | 'step' => 1, |
| 854 | ), |
| 855 | ), |
| 856 | 'selectors' => array( |
| 857 | '{{WRAPPER}}.premium-adv-carousel__infinite {{CURRENT_ITEM}}.premium-adv-carousel__item .premium-adv-carousel__media-wrap' => 'height: {{SIZE}}{{UNIT}}', |
| 858 | ), |
| 859 | ) |
| 860 | ); |
| 861 | |
| 862 | $repeater->add_control( |
| 863 | 'media_items_notice', |
| 864 | array( |
| 865 | 'type' => Controls_Manager::RAW_HTML, |
| 866 | 'raw' => __( 'Note:The above <b>Width and Height</b> controls will only work if the animation type is set to <b>Infinite</b> to override the global settings.', 'premium-addons-for-elementor' ), |
| 867 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info', |
| 868 | ) |
| 869 | ); |
| 870 | |
| 871 | $repeater->add_group_control( |
| 872 | Premium_Background::get_type(), |
| 873 | array( |
| 874 | 'name' => 'media_wheel_card_bg_color', |
| 875 | 'types' => array( 'classic', 'gradient' ), |
| 876 | 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}}.premium-adv-carousel__item', |
| 877 | ) |
| 878 | ); |
| 879 | |
| 880 | $repeater->add_control( |
| 881 | 'media_wheel_item_border_radius', |
| 882 | array( |
| 883 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 884 | 'type' => Controls_Manager::DIMENSIONS, |
| 885 | 'size_units' => array( 'px', '%' ), |
| 886 | 'selectors' => array( |
| 887 | '{{WRAPPER}} {{CURRENT_ITEM}}.premium-adv-carousel__item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 888 | ), |
| 889 | ) |
| 890 | ); |
| 891 | |
| 892 | $repeater->add_responsive_control( |
| 893 | 'media_wheel_item_margin', |
| 894 | array( |
| 895 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 896 | 'type' => Controls_Manager::DIMENSIONS, |
| 897 | 'size_units' => array( 'px' ), |
| 898 | 'range' => array( |
| 899 | 'px' => array( |
| 900 | 'min' => 0, |
| 901 | 'max' => 500, |
| 902 | 'step' => 1, |
| 903 | ), |
| 904 | ), |
| 905 | 'default' => array( |
| 906 | 'unit' => 'px', |
| 907 | 'size' => 0, |
| 908 | ), |
| 909 | 'selectors' => array( |
| 910 | '{{WRAPPER}} {{CURRENT_ITEM}}.premium-adv-carousel__item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 911 | ), |
| 912 | ) |
| 913 | ); |
| 914 | |
| 915 | $repeater->add_responsive_control( |
| 916 | 'media_wheel_item_padding', |
| 917 | array( |
| 918 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 919 | 'type' => Controls_Manager::DIMENSIONS, |
| 920 | 'size_units' => array( 'px' ), |
| 921 | 'range' => array( |
| 922 | 'px' => array( |
| 923 | 'min' => 0, |
| 924 | 'max' => 500, |
| 925 | 'step' => 1, |
| 926 | ), |
| 927 | ), |
| 928 | 'default' => array( |
| 929 | 'unit' => 'px', |
| 930 | 'size' => 0, |
| 931 | ), |
| 932 | 'selectors' => array( |
| 933 | '{{WRAPPER}} {{CURRENT_ITEM}}.premium-adv-carousel__item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 934 | ), |
| 935 | ) |
| 936 | ); |
| 937 | |
| 938 | $this->add_control( |
| 939 | 'media_wheel_repeater', |
| 940 | array( |
| 941 | 'label' => __( 'Carousel Cards', 'premium-addons-for-elementor' ), |
| 942 | 'type' => Controls_Manager::REPEATER, |
| 943 | 'fields' => $repeater->get_controls(), |
| 944 | 'render_type' => 'template', |
| 945 | 'default' => array( |
| 946 | array( |
| 947 | 'pa_media_type' => 'image', |
| 948 | ), |
| 949 | array( |
| 950 | 'pa_media_type' => 'image', |
| 951 | ), |
| 952 | array( |
| 953 | 'pa_media_type' => 'image', |
| 954 | ), |
| 955 | array( |
| 956 | 'pa_media_type' => 'image', |
| 957 | ), |
| 958 | array( |
| 959 | 'pa_media_type' => 'image', |
| 960 | ), |
| 961 | ), |
| 962 | 'title_field' => '<# if ( "" != item_name ) { #> {{{ item_name }}} <# } else { #> {{{ pa_media_type }}} <# } #>', |
| 963 | ) |
| 964 | ); |
| 965 | |
| 966 | $this->add_responsive_control( |
| 967 | 'media_wheel_item_width_gen', |
| 968 | array( |
| 969 | 'label' => __( 'Width', 'premium-addons-for-elementor' ), |
| 970 | 'type' => Controls_Manager::SLIDER, |
| 971 | 'size_units' => array( 'px', '%', 'em' ), |
| 972 | 'separator' => 'before', |
| 973 | 'range' => array( |
| 974 | 'px' => array( |
| 975 | 'min' => 0, |
| 976 | 'max' => 1000, |
| 977 | 'step' => 1, |
| 978 | ), |
| 979 | ), |
| 980 | 'selectors' => array( |
| 981 | '{{WRAPPER}} .premium-adv-carousel__item' => 'width: {{SIZE}}{{UNIT}}', |
| 982 | ), |
| 983 | ) |
| 984 | ); |
| 985 | |
| 986 | $this->add_responsive_control( |
| 987 | 'media_wheel_item_height_gen', |
| 988 | array( |
| 989 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 990 | 'type' => Controls_Manager::SLIDER, |
| 991 | 'size_units' => array( 'px', '%', 'em', 'custom' ), |
| 992 | 'range' => array( |
| 993 | 'px' => array( |
| 994 | 'min' => 0, |
| 995 | 'max' => 1000, |
| 996 | 'step' => 1, |
| 997 | ), |
| 998 | ), |
| 999 | 'selectors' => array( |
| 1000 | '{{WRAPPER}} .premium-adv-carousel__item .premium-adv-carousel__media-wrap' => 'height: {{SIZE}}{{UNIT}}', |
| 1001 | ), |
| 1002 | ) |
| 1003 | ); |
| 1004 | |
| 1005 | $this->add_responsive_control( |
| 1006 | 'pa_media_alignment', |
| 1007 | array( |
| 1008 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 1009 | 'type' => Controls_Manager::CHOOSE, |
| 1010 | 'options' => array( |
| 1011 | 'flex-start' => array( |
| 1012 | 'title' => __( 'Start', 'premium-addons-for-elementor' ), |
| 1013 | 'icon' => 'eicon-h-align-left', |
| 1014 | ), |
| 1015 | 'center' => array( |
| 1016 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 1017 | 'icon' => 'eicon-h-align-center', |
| 1018 | ), |
| 1019 | 'flex-end' => array( |
| 1020 | 'title' => __( 'End', 'premium-addons-for-elementor' ), |
| 1021 | 'icon' => 'eicon-h-align-right', |
| 1022 | ), |
| 1023 | ), |
| 1024 | 'default' => 'flex-start', |
| 1025 | 'toggle' => false, |
| 1026 | 'selectors' => array( |
| 1027 | '{{WRAPPER}} .premium-adv-carousel__items' => 'align-items: {{VALUE}}', |
| 1028 | ), |
| 1029 | 'condition' => array( |
| 1030 | 'media_wheel_animation' => 'infinite', |
| 1031 | ), |
| 1032 | ) |
| 1033 | ); |
| 1034 | |
| 1035 | $this->add_responsive_control( |
| 1036 | 'pa_media_spacing', |
| 1037 | array( |
| 1038 | 'label' => __( 'Spacing', 'premium-addons-for-elementor' ), |
| 1039 | 'type' => Controls_Manager::SLIDER, |
| 1040 | 'size_units' => array( 'px' ), |
| 1041 | 'render_type' => 'template', |
| 1042 | 'range' => array( |
| 1043 | 'px' => array( |
| 1044 | 'min' => 0, |
| 1045 | 'max' => 500, |
| 1046 | 'step' => 1, |
| 1047 | ), |
| 1048 | ), |
| 1049 | 'default' => array( |
| 1050 | 'unit' => 'px', |
| 1051 | 'size' => 5, |
| 1052 | ), |
| 1053 | 'selectors' => array( |
| 1054 | '{{WRAPPER}}.premium-adv-carousel__horizontal .premium-adv-carousel__items' => 'column-gap: {{SIZE}}{{UNIT}}', |
| 1055 | '{{WRAPPER}}.premium-adv-carousel__vertical .premium-adv-carousel__items' => 'row-gap: {{SIZE}}{{UNIT}}', |
| 1056 | '{{WRAPPER}}.premium-adv-carousel__infinite' => '--pa-wheel-spacing: {{SIZE}}', |
| 1057 | ), |
| 1058 | 'condition' => array( |
| 1059 | 'media_wheel_animation' => 'infinite', |
| 1060 | ), |
| 1061 | ) |
| 1062 | ); |
| 1063 | |
| 1064 | $this->end_controls_section(); |
| 1065 | } |
| 1066 | |
| 1067 | private function add_advanced_controls() { |
| 1068 | |
| 1069 | $this->papro_activated = Helper_Functions::check_papro_version(); |
| 1070 | |
| 1071 | $this->start_controls_section( |
| 1072 | 'advanced_settings_section', |
| 1073 | array( |
| 1074 | 'label' => __( 'Advanced Settings', 'premium-addons-for-elementor' ), |
| 1075 | ) |
| 1076 | ); |
| 1077 | |
| 1078 | $this->add_control( |
| 1079 | 'media_wheel_animation', |
| 1080 | array( |
| 1081 | 'label' => __( 'Animation', 'premium-addons-for-elementor' ), |
| 1082 | 'type' => Controls_Manager::SELECT, |
| 1083 | 'prefix_class' => 'premium-adv-carousel__', |
| 1084 | 'options' => array( |
| 1085 | 'infinite' => __( 'Infinite', 'premium-addons-for-elementor' ), |
| 1086 | 'coverflow' => apply_filters( 'pa_pro_label', __( 'Coverflow (Pro)', 'premium-addons-for-elementor' ) ), |
| 1087 | 'carousel' => apply_filters( 'pa_pro_label', __( 'Flip (Pro)', 'premium-addons-for-elementor' ) ), |
| 1088 | 'flat' => apply_filters( 'pa_pro_label', __( 'Flat (Pro)', 'premium-addons-for-elementor' ) ), |
| 1089 | ), |
| 1090 | 'default' => 'infinite', |
| 1091 | 'render_type' => 'template', |
| 1092 | ) |
| 1093 | ); |
| 1094 | |
| 1095 | $this->add_control( |
| 1096 | 'media_wheel_direction', |
| 1097 | array( |
| 1098 | 'label' => __( 'Layout', 'premium-addons-for-elementor' ), |
| 1099 | 'type' => Controls_Manager::SELECT, |
| 1100 | 'prefix_class' => 'premium-adv-carousel__', |
| 1101 | 'default' => 'horizontal', |
| 1102 | 'options' => array( |
| 1103 | 'horizontal' => __( 'Horizontal', 'premium-addons-for-elementor' ), |
| 1104 | 'vertical' => __( 'Vertical', 'premium-addons-for-elementor' ), |
| 1105 | ), |
| 1106 | 'render_type' => 'template', |
| 1107 | 'condition' => array( |
| 1108 | 'media_wheel_animation' => 'infinite', |
| 1109 | ), |
| 1110 | ) |
| 1111 | ); |
| 1112 | |
| 1113 | $this->add_responsive_control( |
| 1114 | 'media_wheel_height', |
| 1115 | array( |
| 1116 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 1117 | 'type' => Controls_Manager::SLIDER, |
| 1118 | 'size_units' => array( 'px' ), |
| 1119 | 'range' => array( |
| 1120 | 'px' => array( |
| 1121 | 'min' => 0, |
| 1122 | 'max' => 1000, |
| 1123 | 'step' => 1, |
| 1124 | ), |
| 1125 | ), |
| 1126 | 'selectors' => array( |
| 1127 | '{{WRAPPER}} .premium-adv-carousel__inner-container' => 'height: {{SIZE}}{{UNIT}};', |
| 1128 | ), |
| 1129 | 'condition' => array( |
| 1130 | 'media_wheel_animation' => 'infinite', |
| 1131 | ), |
| 1132 | ) |
| 1133 | ); |
| 1134 | |
| 1135 | $this->add_control( |
| 1136 | 'media_wheel_speed', |
| 1137 | array( |
| 1138 | 'label' => __( 'Speed', 'premium-addons-for-elementor' ), |
| 1139 | 'type' => Controls_Manager::NUMBER, |
| 1140 | 'description' => __( 'The smaller the value, the faster the animation.', 'premium-addons-for-elementor' ), |
| 1141 | 'default' => 50, |
| 1142 | 'condition' => array( |
| 1143 | 'media_wheel_animation' => 'infinite', |
| 1144 | ), |
| 1145 | 'selectors' => array( |
| 1146 | '{{WRAPPER}} .premium-adv-carousel__items' => 'animation-duration: calc( {{VALUE}} * 1000ms ) !important', |
| 1147 | ), |
| 1148 | ) |
| 1149 | ); |
| 1150 | |
| 1151 | $this->add_control( |
| 1152 | 'media_wheel_reverse', |
| 1153 | array( |
| 1154 | 'label' => __( 'Animation Direction', 'premium-addons-for-elementor' ), |
| 1155 | 'type' => Controls_Manager::SELECT, |
| 1156 | 'default' => 'normal', |
| 1157 | 'options' => array( |
| 1158 | 'normal' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 1159 | 'reverse' => __( 'Reverse', 'premium-addons-for-elementor' ), |
| 1160 | ), |
| 1161 | 'render_type' => 'template', |
| 1162 | 'selectors' => array( |
| 1163 | '{{WRAPPER}} .premium-adv-carousel__items' => 'animation-direction: {{VALUE}} !important', |
| 1164 | ), |
| 1165 | 'condition' => array( |
| 1166 | 'media_wheel_animation' => 'infinite', |
| 1167 | ), |
| 1168 | ) |
| 1169 | ); |
| 1170 | |
| 1171 | if ( $this->papro_activated ) { |
| 1172 | |
| 1173 | do_action( 'pa_adv_carousel_options', $this ); |
| 1174 | |
| 1175 | } else { |
| 1176 | |
| 1177 | $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'adv-carousel-widget', 'wp-editor', 'get-pro' ); |
| 1178 | |
| 1179 | $this->add_control( |
| 1180 | 'effect_notice', |
| 1181 | array( |
| 1182 | 'type' => Controls_Manager::RAW_HTML, |
| 1183 | '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>', |
| 1184 | 'content_classes' => 'papro-upgrade-notice', |
| 1185 | 'condition' => array( |
| 1186 | 'media_wheel_animation!' => 'infinite', |
| 1187 | ), |
| 1188 | ) |
| 1189 | ); |
| 1190 | |
| 1191 | } |
| 1192 | |
| 1193 | $this->add_control( |
| 1194 | 'media_wheel_scroll', |
| 1195 | array( |
| 1196 | 'label' => __( 'Animate By Mousewheel', 'premium-addons-for-elementor' ), |
| 1197 | 'type' => Controls_Manager::SWITCHER, |
| 1198 | 'default' => 'yes', |
| 1199 | 'condition' => array( |
| 1200 | 'media_wheel_animation!' => 'infinite', |
| 1201 | ), |
| 1202 | ) |
| 1203 | ); |
| 1204 | |
| 1205 | $this->add_control( |
| 1206 | 'pause_on_hover', |
| 1207 | array( |
| 1208 | 'label' => __( 'Pause on Hover', 'premium-addons-for-elementor' ), |
| 1209 | 'type' => Controls_Manager::SWITCHER, |
| 1210 | 'default' => 'yes', |
| 1211 | ) |
| 1212 | ); |
| 1213 | |
| 1214 | if ( $this->papro_activated ) { |
| 1215 | |
| 1216 | do_action( 'pa_adv_carousel_navigation', $this ); |
| 1217 | |
| 1218 | } |
| 1219 | |
| 1220 | $this->add_control( |
| 1221 | 'media_wheel_fading_switcher', |
| 1222 | array( |
| 1223 | 'label' => __( 'Enable Fading Color', 'premium-addons-for-elementor' ), |
| 1224 | 'type' => Controls_Manager::SWITCHER, |
| 1225 | 'condition' => array( |
| 1226 | 'media_wheel_animation' => 'infinite', |
| 1227 | ), |
| 1228 | ) |
| 1229 | ); |
| 1230 | |
| 1231 | $this->add_control( |
| 1232 | 'media_wheel_fading_color', |
| 1233 | array( |
| 1234 | 'label' => __( 'Fading Color', 'premium-addons-for-elementor' ), |
| 1235 | 'type' => Controls_Manager::COLOR, |
| 1236 | 'condition' => array( |
| 1237 | 'media_wheel_animation' => 'infinite', |
| 1238 | 'media_wheel_fading_switcher' => 'yes', |
| 1239 | ), |
| 1240 | 'selectors' => array( |
| 1241 | '{{WRAPPER}}.premium-adv-carousel__vertical .premium-adv-carousel__container:after' => 'background:linear-gradient(to bottom, {{VALUE}}, #F291D800 10%, #F291D800 90%, {{VALUE}}) !important', |
| 1242 | '{{WRAPPER}}.premium-adv-carousel__horizontal .premium-adv-carousel__container:after' => 'background:linear-gradient(to right, {{VALUE}}, #F291D800 10%, #F291D800 90%, {{VALUE}}) !important', |
| 1243 | ), |
| 1244 | ) |
| 1245 | ); |
| 1246 | |
| 1247 | $this->add_control( |
| 1248 | 'render_event', |
| 1249 | array( |
| 1250 | 'label' => __( 'Trigger Animation On', 'premium-addons-for-elementor' ), |
| 1251 | 'type' => Controls_Manager::SELECT, |
| 1252 | 'options' => array( |
| 1253 | 'scroll' => __( 'Scroll', 'premium-addons-for-elementor' ), |
| 1254 | 'load' => __( 'Page Load', 'premium-addons-for-elementor' ), |
| 1255 | ), |
| 1256 | 'default' => 'scroll', |
| 1257 | 'condition' => array( |
| 1258 | 'media_wheel_animation' => 'infinite', |
| 1259 | ), |
| 1260 | ) |
| 1261 | ); |
| 1262 | |
| 1263 | $this->add_control( |
| 1264 | 'autoplay_videos', |
| 1265 | array( |
| 1266 | 'label' => __( 'Auto Play Active Videos', 'premium-addons-for-elementor' ), |
| 1267 | 'type' => Controls_Manager::SWITCHER, |
| 1268 | 'separator' => 'before', |
| 1269 | 'description' => __( 'Enable to automatically play videos when their carousel item becomes active and visible.', 'premium-addons-for-elementor' ), |
| 1270 | 'condition' => array( |
| 1271 | 'media_wheel_animation!' => 'infinite', |
| 1272 | ), |
| 1273 | ) |
| 1274 | ); |
| 1275 | |
| 1276 | $this->end_controls_section(); |
| 1277 | } |
| 1278 | |
| 1279 | private function add_light_box_controls() { |
| 1280 | $this->start_controls_section( |
| 1281 | 'media_lightbox_section', |
| 1282 | array( |
| 1283 | 'label' => __( 'Lightbox', 'premium-addons-for-elementor' ), |
| 1284 | ) |
| 1285 | ); |
| 1286 | |
| 1287 | $this->add_control( |
| 1288 | 'media_light_box', |
| 1289 | array( |
| 1290 | 'label' => __( 'Lightbox', 'premium-addons-for-elementor' ), |
| 1291 | 'type' => Controls_Manager::SWITCHER, |
| 1292 | 'separator' => 'before', |
| 1293 | ) |
| 1294 | ); |
| 1295 | |
| 1296 | $this->add_control( |
| 1297 | 'media_lightbox_type', |
| 1298 | array( |
| 1299 | 'label' => __( 'Lightbox Style', 'premium-addons-for-elementor' ), |
| 1300 | 'type' => Controls_Manager::SELECT, |
| 1301 | 'default' => 'default', |
| 1302 | 'options' => array( |
| 1303 | 'default' => __( 'PrettyPhoto', 'premium-addons-for-elementor' ), |
| 1304 | 'yes' => __( 'Elementor', 'premium-addons-for-elementor' ), |
| 1305 | 'no' => __( 'Other Lightbox Plugin', 'premium-addons-for-elementor' ), |
| 1306 | ), |
| 1307 | 'condition' => array( |
| 1308 | 'media_light_box' => 'yes', |
| 1309 | ), |
| 1310 | ) |
| 1311 | ); |
| 1312 | |
| 1313 | $this->add_control( |
| 1314 | 'lightbox_show_title', |
| 1315 | array( |
| 1316 | 'label' => __( 'Show Image Title', 'premium-addons-for-elementor' ), |
| 1317 | 'type' => Controls_Manager::SWITCHER, |
| 1318 | 'default' => 'yes', |
| 1319 | 'condition' => array( |
| 1320 | 'media_light_box' => 'yes', |
| 1321 | 'media_lightbox_type' => 'yes', |
| 1322 | ), |
| 1323 | ) |
| 1324 | ); |
| 1325 | |
| 1326 | $this->add_control( |
| 1327 | 'media_lightbox_theme', |
| 1328 | array( |
| 1329 | 'label' => __( 'Lightbox Theme', 'premium-addons-for-elementor' ), |
| 1330 | 'type' => Controls_Manager::SELECT, |
| 1331 | 'options' => array( |
| 1332 | 'pp_default' => __( 'Default', 'premium-addons-for-elementor' ), |
| 1333 | 'light_rounded' => __( 'Light Rounded', 'premium-addons-for-elementor' ), |
| 1334 | 'dark_rounded' => __( 'Dark Rounded', 'premium-addons-for-elementor' ), |
| 1335 | 'light_square' => __( 'Light Square', 'premium-addons-for-elementor' ), |
| 1336 | 'dark_square' => __( 'Dark Square', 'premium-addons-for-elementor' ), |
| 1337 | 'facebook' => __( 'Facebook', 'premium-addons-for-elementor' ), |
| 1338 | ), |
| 1339 | 'default' => 'pp_default', |
| 1340 | 'condition' => array( |
| 1341 | 'media_light_box' => 'yes', |
| 1342 | 'media_lightbox_type' => 'default', |
| 1343 | ), |
| 1344 | ) |
| 1345 | ); |
| 1346 | |
| 1347 | $this->add_control( |
| 1348 | 'media_overlay_gallery', |
| 1349 | array( |
| 1350 | 'label' => __( 'Overlay Gallery Images', 'premium-addons-for-elementor' ), |
| 1351 | 'type' => Controls_Manager::SWITCHER, |
| 1352 | 'condition' => array( |
| 1353 | 'media_light_box' => 'yes', |
| 1354 | 'media_lightbox_type' => 'default', |
| 1355 | ), |
| 1356 | ) |
| 1357 | ); |
| 1358 | |
| 1359 | $this->add_control( |
| 1360 | 'media_lightbox_icon', |
| 1361 | array( |
| 1362 | 'label' => __( 'Lightbox Icon', 'premium-addons-for-elementor' ), |
| 1363 | 'type' => Controls_Manager::ICONS, |
| 1364 | 'default' => array( |
| 1365 | 'library' => 'fa-solid', |
| 1366 | 'value' => 'fas fa-search', |
| 1367 | ), |
| 1368 | 'condition' => array( |
| 1369 | 'media_light_box' => 'yes', |
| 1370 | ), |
| 1371 | ) |
| 1372 | ); |
| 1373 | |
| 1374 | $this->end_controls_section(); |
| 1375 | } |
| 1376 | |
| 1377 | private function register_docs_controls() { |
| 1378 | |
| 1379 | $this->start_controls_section( |
| 1380 | 'section_pa_docs', |
| 1381 | array( |
| 1382 | 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ), |
| 1383 | ) |
| 1384 | ); |
| 1385 | |
| 1386 | $doc1_url = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/docs/elementor-advanced-media-carousel-widget/', 'adv-carousel', 'wp-editor', 'get-support' ); |
| 1387 | |
| 1388 | $this->add_control( |
| 1389 | 'doc_1', |
| 1390 | array( |
| 1391 | 'type' => Controls_Manager::RAW_HTML, |
| 1392 | 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc1_url, __( 'Getting started »', 'premium-addons-for-elementor' ) ), |
| 1393 | 'content_classes' => 'editor-pa-doc', |
| 1394 | ) |
| 1395 | ); |
| 1396 | |
| 1397 | Helper_Functions::register_element_feedback_controls( $this ); |
| 1398 | |
| 1399 | $this->end_controls_section(); |
| 1400 | } |
| 1401 | |
| 1402 | private function add_img_style_controls() { |
| 1403 | |
| 1404 | $this->start_controls_section( |
| 1405 | 'media_img_style_sec', |
| 1406 | array( |
| 1407 | 'label' => __( 'Images', 'premium-addons-for-elementor' ), |
| 1408 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1409 | ) |
| 1410 | ); |
| 1411 | |
| 1412 | if ( $this->papro_activated ) { |
| 1413 | do_action( 'pa_image_hover_effects', $this ); |
| 1414 | } |
| 1415 | |
| 1416 | $this->add_group_control( |
| 1417 | Group_Control_Css_Filter::get_type(), |
| 1418 | array( |
| 1419 | 'name' => 'css_filters', |
| 1420 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__vid-overlay, {{WRAPPER}} .premium-adv-carousel__media-wrap img', |
| 1421 | ) |
| 1422 | ); |
| 1423 | |
| 1424 | $this->add_group_control( |
| 1425 | Group_Control_Css_Filter::get_type(), |
| 1426 | array( |
| 1427 | 'label' => __( 'Hover CSS Filters', 'premium-addons-for-elementor' ), |
| 1428 | 'name' => 'hover_css_filters', |
| 1429 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__vid-overlay:hover, {{WRAPPER}} .premium-adv-carousel__media-wrap:hover img', |
| 1430 | ) |
| 1431 | ); |
| 1432 | |
| 1433 | $this->add_control( |
| 1434 | 'media_wheel_img_border_radius', |
| 1435 | array( |
| 1436 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1437 | 'type' => Controls_Manager::SLIDER, |
| 1438 | 'size_units' => array( 'px', '%' ), |
| 1439 | 'range' => array( |
| 1440 | 'px' => array( |
| 1441 | 'min' => 0, |
| 1442 | 'max' => 100, |
| 1443 | 'step' => 1, |
| 1444 | ), |
| 1445 | ), |
| 1446 | 'selectors' => array( |
| 1447 | '{{WRAPPER}} .premium-adv-carousel__media-wrap' => 'border-radius: {{SIZE}}{{UNIT}}', |
| 1448 | ), |
| 1449 | ) |
| 1450 | ); |
| 1451 | |
| 1452 | $this->end_controls_section(); |
| 1453 | } |
| 1454 | |
| 1455 | private function add_icon_style_controls() { |
| 1456 | |
| 1457 | $this->start_controls_section( |
| 1458 | 'media_icon_style_sec', |
| 1459 | array( |
| 1460 | 'label' => __( 'Play Icon', 'premium-addons-for-elementor' ), |
| 1461 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1462 | ) |
| 1463 | ); |
| 1464 | |
| 1465 | $this->add_control( |
| 1466 | 'play_icons_color', |
| 1467 | array( |
| 1468 | 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ), |
| 1469 | 'type' => Controls_Manager::COLOR, |
| 1470 | 'selectors' => array( |
| 1471 | '{{WRAPPER}} .pa-media-icons-wrapper .premium-adv-carousel__video-icon i' => 'color: {{VALUE}}', |
| 1472 | '{{WRAPPER}} .pa-media-icons-wrapper .premium-adv-carousel__video-icon svg' => 'fill: {{VALUE}}', |
| 1473 | ), |
| 1474 | ) |
| 1475 | ); |
| 1476 | |
| 1477 | $this->add_control( |
| 1478 | 'play_icon_bg', |
| 1479 | array( |
| 1480 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1481 | 'type' => Controls_Manager::COLOR, |
| 1482 | 'selectors' => array( |
| 1483 | '{{WRAPPER}} .pa-media-icons-wrapper .premium-adv-carousel__video-icon' => 'background-color: {{VALUE}}', |
| 1484 | ), |
| 1485 | ) |
| 1486 | ); |
| 1487 | |
| 1488 | $this->add_control( |
| 1489 | 'play_icon_rad', |
| 1490 | array( |
| 1491 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1492 | 'type' => Controls_Manager::SLIDER, |
| 1493 | 'size_units' => array( 'px', '%' ), |
| 1494 | 'range' => array( |
| 1495 | 'px' => array( |
| 1496 | 'min' => 0, |
| 1497 | 'max' => 100, |
| 1498 | 'step' => 1, |
| 1499 | ), |
| 1500 | ), |
| 1501 | 'selectors' => array( |
| 1502 | '{{WRAPPER}} .pa-media-icons-wrapper .premium-adv-carousel__video-icon' => 'border-radius: {{SIZE}}{{UNIT}}', |
| 1503 | ), |
| 1504 | ) |
| 1505 | ); |
| 1506 | |
| 1507 | $this->add_responsive_control( |
| 1508 | 'play_icon_padding', |
| 1509 | array( |
| 1510 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1511 | 'type' => Controls_Manager::DIMENSIONS, |
| 1512 | 'size_units' => array( 'px' ), |
| 1513 | 'range' => array( |
| 1514 | 'px' => array( |
| 1515 | 'min' => 0, |
| 1516 | 'max' => 500, |
| 1517 | 'step' => 1, |
| 1518 | ), |
| 1519 | ), |
| 1520 | 'default' => array( |
| 1521 | 'unit' => 'px', |
| 1522 | 'size' => 0, |
| 1523 | ), |
| 1524 | 'selectors' => array( |
| 1525 | '{{WRAPPER}} .pa-media-icons-wrapper .premium-adv-carousel__video-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1526 | ), |
| 1527 | ) |
| 1528 | ); |
| 1529 | |
| 1530 | $this->end_controls_section(); |
| 1531 | } |
| 1532 | |
| 1533 | private function add_info_style_controls() { |
| 1534 | |
| 1535 | $this->start_controls_section( |
| 1536 | 'media_info_style_sec', |
| 1537 | array( |
| 1538 | 'label' => __( 'Media Info', 'premium-addons-for-elementor' ), |
| 1539 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1540 | ) |
| 1541 | ); |
| 1542 | |
| 1543 | $this->add_control( |
| 1544 | 'media_title_style', |
| 1545 | array( |
| 1546 | 'label' => __( 'Title', 'premium-addons-for-elementor' ), |
| 1547 | 'type' => Controls_Manager::HEADING, |
| 1548 | ) |
| 1549 | ); |
| 1550 | |
| 1551 | $this->add_group_control( |
| 1552 | Group_Control_Typography::get_type(), |
| 1553 | array( |
| 1554 | 'name' => 'title_typography', |
| 1555 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__media-title', |
| 1556 | ) |
| 1557 | ); |
| 1558 | |
| 1559 | $this->add_control( |
| 1560 | 'title_color', |
| 1561 | array( |
| 1562 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1563 | 'type' => Controls_Manager::COLOR, |
| 1564 | 'global' => array( |
| 1565 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1566 | ), |
| 1567 | 'selectors' => array( |
| 1568 | '{{WRAPPER}} .premium-adv-carousel__media-title' => 'color: {{VALUE}}', |
| 1569 | ), |
| 1570 | ) |
| 1571 | ); |
| 1572 | |
| 1573 | $this->add_group_control( |
| 1574 | Group_Control_text_Shadow::get_type(), |
| 1575 | array( |
| 1576 | 'name' => 'title_shadow', |
| 1577 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__media-title', |
| 1578 | ) |
| 1579 | ); |
| 1580 | |
| 1581 | $this->add_responsive_control( |
| 1582 | 'title_margin', |
| 1583 | array( |
| 1584 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1585 | 'type' => Controls_Manager::DIMENSIONS, |
| 1586 | 'size_units' => array( 'px', '%', 'em' ), |
| 1587 | 'selectors' => array( |
| 1588 | '{{WRAPPER}} .premium-adv-carousel__media-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1589 | ), |
| 1590 | ) |
| 1591 | ); |
| 1592 | |
| 1593 | $this->add_control( |
| 1594 | 'media_desc_style', |
| 1595 | array( |
| 1596 | 'label' => __( 'Description', 'premium-addons-for-elementor' ), |
| 1597 | 'separator' => 'before', |
| 1598 | 'type' => Controls_Manager::HEADING, |
| 1599 | ) |
| 1600 | ); |
| 1601 | |
| 1602 | $this->add_group_control( |
| 1603 | Group_Control_Typography::get_type(), |
| 1604 | array( |
| 1605 | 'name' => 'desc_typography', |
| 1606 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__media-desc', |
| 1607 | 'fields_options' => array( |
| 1608 | 'letter_spacing' => array( |
| 1609 | 'responsive' => false, |
| 1610 | ), |
| 1611 | 'word_spacing' => array( |
| 1612 | 'responsive' => false, |
| 1613 | ), |
| 1614 | ), |
| 1615 | ) |
| 1616 | ); |
| 1617 | |
| 1618 | $this->add_control( |
| 1619 | 'desc_color', |
| 1620 | array( |
| 1621 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1622 | 'type' => Controls_Manager::COLOR, |
| 1623 | 'global' => array( |
| 1624 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1625 | ), |
| 1626 | 'selectors' => array( |
| 1627 | '{{WRAPPER}} .premium-adv-carousel__media-desc' => 'color: {{VALUE}}', |
| 1628 | ), |
| 1629 | ) |
| 1630 | ); |
| 1631 | |
| 1632 | $this->add_group_control( |
| 1633 | Group_Control_text_Shadow::get_type(), |
| 1634 | array( |
| 1635 | 'name' => 'desc_shadow', |
| 1636 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__media-desc', |
| 1637 | ) |
| 1638 | ); |
| 1639 | |
| 1640 | $this->add_responsive_control( |
| 1641 | 'desc_margin', |
| 1642 | array( |
| 1643 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1644 | 'type' => Controls_Manager::DIMENSIONS, |
| 1645 | 'size_units' => array( 'px', '%', 'em' ), |
| 1646 | 'selectors' => array( |
| 1647 | '{{WRAPPER}} .premium-adv-carousel__media-desc' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1648 | ), |
| 1649 | ) |
| 1650 | ); |
| 1651 | |
| 1652 | $this->add_control( |
| 1653 | 'media_info_gen_style', |
| 1654 | array( |
| 1655 | 'label' => __( 'Container', 'premium-addons-for-elementor' ), |
| 1656 | 'separator' => 'before', |
| 1657 | 'type' => Controls_Manager::HEADING, |
| 1658 | ) |
| 1659 | ); |
| 1660 | |
| 1661 | $this->add_control( |
| 1662 | 'media_info_align', |
| 1663 | array( |
| 1664 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 1665 | 'type' => Controls_Manager::CHOOSE, |
| 1666 | 'options' => array( |
| 1667 | 'left' => array( |
| 1668 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 1669 | 'icon' => 'eicon-text-align-left', |
| 1670 | ), |
| 1671 | 'center' => array( |
| 1672 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 1673 | 'icon' => 'eicon-text-align-center', |
| 1674 | ), |
| 1675 | 'right' => array( |
| 1676 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 1677 | 'icon' => 'eicon-text-align-right', |
| 1678 | ), |
| 1679 | ), |
| 1680 | 'default' => 'flex-start', |
| 1681 | 'toggle' => false, |
| 1682 | 'selectors' => array( |
| 1683 | '{{WRAPPER}} .premium-adv-carousel__media-info-wrap' => 'text-align: {{VALUE}}', |
| 1684 | ), |
| 1685 | ) |
| 1686 | ); |
| 1687 | |
| 1688 | $this->add_control( |
| 1689 | 'media_info_pos', |
| 1690 | array( |
| 1691 | 'label' => __( 'Placement', 'premium-addons-for-elementor' ), |
| 1692 | 'type' => Controls_Manager::CHOOSE, |
| 1693 | 'options' => array( |
| 1694 | 'before' => array( |
| 1695 | 'title' => __( 'Before Image', 'premium-addons-for-elementor' ), |
| 1696 | 'icon' => 'eicon-v-align-top', |
| 1697 | ), |
| 1698 | 'overlay' => array( |
| 1699 | 'title' => __( 'Overlay', 'premium-addons-for-elementor' ), |
| 1700 | 'icon' => 'eicon-copy', |
| 1701 | ), |
| 1702 | 'after' => array( |
| 1703 | 'title' => __( 'After Image', 'premium-addons-for-elementor' ), |
| 1704 | 'icon' => 'eicon-v-align-bottom', |
| 1705 | ), |
| 1706 | ), |
| 1707 | 'default' => 'center', |
| 1708 | 'selectors_dictionary' => array( |
| 1709 | 'before' => 'order:0', |
| 1710 | 'overlay' => 'position: absolute; bottom: 0px; left: 0px; width: 100%', |
| 1711 | 'after' => 'order: 2', |
| 1712 | ), |
| 1713 | 'toggle' => false, |
| 1714 | 'selectors' => array( |
| 1715 | '{{WRAPPER}} .premium-adv-carousel__media-info-wrap' => '{{VALUE}}', |
| 1716 | ), |
| 1717 | ) |
| 1718 | ); |
| 1719 | |
| 1720 | $this->add_control( |
| 1721 | 'media_info_gutter', |
| 1722 | array( |
| 1723 | 'label' => __( 'Position', 'premium-addons-for-elementor' ), |
| 1724 | 'type' => Controls_Manager::SLIDER, |
| 1725 | 'size_units' => array( 'px', '%' ), |
| 1726 | 'range' => array( |
| 1727 | 'px' => array( |
| 1728 | 'min' => 0, |
| 1729 | 'max' => 100, |
| 1730 | 'step' => 1, |
| 1731 | ), |
| 1732 | ), |
| 1733 | 'selectors' => array( |
| 1734 | '{{WRAPPER}} .premium-adv-carousel__media-info-wrap' => 'transform: translateY( {{SIZE}}{{UNIT}} )', |
| 1735 | ), |
| 1736 | 'condition' => array( |
| 1737 | 'media_info_pos' => 'overlay', |
| 1738 | ), |
| 1739 | ) |
| 1740 | ); |
| 1741 | |
| 1742 | $this->add_group_control( |
| 1743 | Premium_Background::get_type(), |
| 1744 | array( |
| 1745 | 'name' => 'media_info_bg', |
| 1746 | 'types' => array( 'classic', 'gradient' ), |
| 1747 | 'selector' => '.premium-adv-carousel__media-info-wrap', |
| 1748 | ) |
| 1749 | ); |
| 1750 | |
| 1751 | $this->add_group_control( |
| 1752 | Group_Control_Border::get_type(), |
| 1753 | array( |
| 1754 | 'name' => 'media_info_border', |
| 1755 | 'label' => __( 'Border', 'premium-addons-for-elementor' ), |
| 1756 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__media-info-wrap', |
| 1757 | ) |
| 1758 | ); |
| 1759 | |
| 1760 | $this->add_control( |
| 1761 | 'media_info_rad', |
| 1762 | array( |
| 1763 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1764 | 'type' => Controls_Manager::SLIDER, |
| 1765 | 'size_units' => array( 'px', '%' ), |
| 1766 | 'range' => array( |
| 1767 | 'px' => array( |
| 1768 | 'min' => 0, |
| 1769 | 'max' => 100, |
| 1770 | 'step' => 1, |
| 1771 | ), |
| 1772 | ), |
| 1773 | 'selectors' => array( |
| 1774 | '{{WRAPPER}} .premium-adv-carousel__media-info-wrap' => 'border-radius: {{SIZE}}{{UNIT}}', |
| 1775 | ), |
| 1776 | ) |
| 1777 | ); |
| 1778 | |
| 1779 | $this->add_responsive_control( |
| 1780 | 'media_info_margin', |
| 1781 | array( |
| 1782 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1783 | 'type' => Controls_Manager::DIMENSIONS, |
| 1784 | 'size_units' => array( 'px', '%', 'em' ), |
| 1785 | 'selectors' => array( |
| 1786 | '{{WRAPPER}} .premium-adv-carousel__media-info-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1787 | ), |
| 1788 | ) |
| 1789 | ); |
| 1790 | |
| 1791 | $this->add_responsive_control( |
| 1792 | 'media_info_padding', |
| 1793 | array( |
| 1794 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1795 | 'type' => Controls_Manager::DIMENSIONS, |
| 1796 | 'size_units' => array( 'px', '%', 'em' ), |
| 1797 | 'selectors' => array( |
| 1798 | '{{WRAPPER}} .premium-adv-carousel__media-info-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1799 | ), |
| 1800 | ) |
| 1801 | ); |
| 1802 | |
| 1803 | $this->end_controls_section(); |
| 1804 | } |
| 1805 | |
| 1806 | private function add_items_style_controls() { |
| 1807 | |
| 1808 | $this->start_controls_section( |
| 1809 | 'media_wheel_items_style_tab', |
| 1810 | array( |
| 1811 | 'label' => __( 'Items', 'premium-addons-for-elementor' ), |
| 1812 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1813 | ) |
| 1814 | ); |
| 1815 | |
| 1816 | $this->add_group_control( |
| 1817 | Group_Control_Css_Filter::get_type(), |
| 1818 | array( |
| 1819 | 'name' => 'item_css_filters', |
| 1820 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__item-outer-wrapper.flipster__item--current', |
| 1821 | 'condition' => array( |
| 1822 | 'media_wheel_animation!' => 'infinite', |
| 1823 | ), |
| 1824 | ) |
| 1825 | ); |
| 1826 | |
| 1827 | $this->add_group_control( |
| 1828 | Group_Control_Box_Shadow::get_type(), |
| 1829 | array( |
| 1830 | 'name' => 'media_wheel_item_shadow', |
| 1831 | 'label' => __( 'Box Shadow', 'premium-addons-for-elementor' ), |
| 1832 | 'selector' => '{{WRAPPER}}.premium-adv-carousel__infinite .premium-adv-carousel__item, {{WRAPPER}}:not(.premium-adv-carousel__infinite) .flipster__item--current .premium-adv-carousel__item', |
| 1833 | ) |
| 1834 | ); |
| 1835 | |
| 1836 | $this->add_group_control( |
| 1837 | Premium_Background::get_type(), |
| 1838 | array( |
| 1839 | 'name' => 'item_bg', |
| 1840 | 'types' => array( 'classic', 'gradient' ), |
| 1841 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__item', |
| 1842 | ) |
| 1843 | ); |
| 1844 | |
| 1845 | $this->add_group_control( |
| 1846 | Group_Control_Border::get_type(), |
| 1847 | array( |
| 1848 | 'name' => 'media_wheel_item_border', |
| 1849 | 'label' => __( 'Border', 'premium-addons-for-elementor' ), |
| 1850 | 'selector' => '{{WRAPPER}}.premium-adv-carousel__infinite .premium-adv-carousel__item, {{WRAPPER}}:not(.premium-adv-carousel__infinite) .flipster__item--current .premium-adv-carousel__item', |
| 1851 | ) |
| 1852 | ); |
| 1853 | |
| 1854 | $this->add_control( |
| 1855 | 'item_border_rad', |
| 1856 | array( |
| 1857 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1858 | 'type' => Controls_Manager::DIMENSIONS, |
| 1859 | 'size_units' => array( 'px', '%' ), |
| 1860 | 'selectors' => array( |
| 1861 | '{{WRAPPER}} .premium-adv-carousel__item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1862 | ), |
| 1863 | ) |
| 1864 | ); |
| 1865 | |
| 1866 | $this->add_responsive_control( |
| 1867 | 'item_padding', |
| 1868 | array( |
| 1869 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1870 | 'type' => Controls_Manager::DIMENSIONS, |
| 1871 | 'size_units' => array( 'px' ), |
| 1872 | 'range' => array( |
| 1873 | 'px' => array( |
| 1874 | 'min' => 0, |
| 1875 | 'max' => 500, |
| 1876 | 'step' => 1, |
| 1877 | ), |
| 1878 | ), |
| 1879 | 'default' => array( |
| 1880 | 'unit' => 'px', |
| 1881 | 'size' => 0, |
| 1882 | ), |
| 1883 | 'selectors' => array( |
| 1884 | '{{WRAPPER}} .premium-adv-carousel__item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1885 | ), |
| 1886 | ) |
| 1887 | ); |
| 1888 | |
| 1889 | $this->add_responsive_control( |
| 1890 | 'item_margin', |
| 1891 | array( |
| 1892 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1893 | 'type' => Controls_Manager::DIMENSIONS, |
| 1894 | 'size_units' => array( 'px' ), |
| 1895 | 'range' => array( |
| 1896 | 'px' => array( |
| 1897 | 'min' => 0, |
| 1898 | 'max' => 500, |
| 1899 | 'step' => 1, |
| 1900 | ), |
| 1901 | ), |
| 1902 | 'default' => array( |
| 1903 | 'unit' => 'px', |
| 1904 | 'size' => 0, |
| 1905 | ), |
| 1906 | 'selectors' => array( |
| 1907 | '{{WRAPPER}} .premium-adv-carousel__item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1908 | ), |
| 1909 | ) |
| 1910 | ); |
| 1911 | |
| 1912 | $this->add_control( |
| 1913 | 'non_active_item_style', |
| 1914 | array( |
| 1915 | 'label' => __( 'Non-active Items', 'premium-addons-for-elementor' ), |
| 1916 | 'type' => Controls_Manager::HEADING, |
| 1917 | 'separator' => 'before', |
| 1918 | 'condition' => array( |
| 1919 | 'media_wheel_animation!' => 'infinite', |
| 1920 | ), |
| 1921 | ) |
| 1922 | ); |
| 1923 | |
| 1924 | $this->add_control( |
| 1925 | 'item_opacity_switched', |
| 1926 | array( |
| 1927 | 'label' => __( 'Opacity', 'premium-addons-for-elementor' ), |
| 1928 | 'type' => Controls_Manager::SLIDER, |
| 1929 | 'size_units' => array( 'px' ), |
| 1930 | 'range' => array( |
| 1931 | 'px' => array( |
| 1932 | 'min' => 0, |
| 1933 | 'max' => 1, |
| 1934 | 'step' => 0.1, |
| 1935 | ), |
| 1936 | ), |
| 1937 | 'selectors' => array( |
| 1938 | '{{WRAPPER}} .premium-adv-carousel__item-outer-wrapper:not(.flipster__item--current)' => 'opacity: {{SIZE}}', |
| 1939 | ), |
| 1940 | 'conditions' => array( |
| 1941 | 'relation' => 'or', |
| 1942 | 'terms' => array( |
| 1943 | array( |
| 1944 | 'name' => 'media_wheel_animation', |
| 1945 | 'operator' => 'in', |
| 1946 | 'value' => array( 'coverflow', 'carousel' ), |
| 1947 | ), |
| 1948 | array( |
| 1949 | 'terms' => array( |
| 1950 | array( |
| 1951 | 'name' => 'media_wheel_animation', |
| 1952 | 'operator' => '===', |
| 1953 | 'value' => 'flat', |
| 1954 | ), |
| 1955 | array( |
| 1956 | 'name' => 'gradual_scale_effect', |
| 1957 | 'operator' => '!==', |
| 1958 | 'value' => 'yes', |
| 1959 | ), |
| 1960 | ), |
| 1961 | ), |
| 1962 | ), |
| 1963 | ), |
| 1964 | ) |
| 1965 | ); |
| 1966 | |
| 1967 | $this->add_group_control( |
| 1968 | Group_Control_Css_Filter::get_type(), |
| 1969 | array( |
| 1970 | 'name' => 'item_css_filters_switched', |
| 1971 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__item-outer-wrapper:not(.flipster__item--current)', |
| 1972 | 'condition' => array( |
| 1973 | 'media_wheel_animation!' => 'infinite', |
| 1974 | ), |
| 1975 | ) |
| 1976 | ); |
| 1977 | |
| 1978 | $this->add_group_control( |
| 1979 | Group_Control_Border::get_type(), |
| 1980 | array( |
| 1981 | 'name' => 'media_wheel_item_border_switched', |
| 1982 | 'label' => __( 'Border', 'premium-addons-for-elementor' ), |
| 1983 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__item-outer-wrapper:not(.flipster__item--current) .premium-adv-carousel__item', |
| 1984 | 'condition' => array( |
| 1985 | 'media_wheel_animation!' => 'infinite', |
| 1986 | ), |
| 1987 | ) |
| 1988 | ); |
| 1989 | |
| 1990 | $this->add_group_control( |
| 1991 | Group_Control_Box_Shadow::get_type(), |
| 1992 | array( |
| 1993 | 'name' => 'media_wheel_item_shadow_switched', |
| 1994 | 'label' => __( 'Box Shadow', 'premium-addons-for-elementor' ), |
| 1995 | 'selector' => '{{WRAPPER}} .premium-adv-carousel__item-outer-wrapper:not(.flipster__item--current) .premium-adv-carousel__item', |
| 1996 | 'condition' => array( |
| 1997 | 'media_wheel_animation!' => 'infinite', |
| 1998 | ), |
| 1999 | ) |
| 2000 | ); |
| 2001 | |
| 2002 | $this->end_controls_section(); |
| 2003 | } |
| 2004 | |
| 2005 | private function add_navigation_style() { |
| 2006 | |
| 2007 | $this->start_controls_section( |
| 2008 | 'pa_nav_style', |
| 2009 | array( |
| 2010 | 'label' => __( 'Arrows', 'premium-addons-for-elementor' ), |
| 2011 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2012 | 'condition' => array( |
| 2013 | 'media_wheel_animation!' => 'infinite', |
| 2014 | 'arrows' => 'yes', |
| 2015 | ), |
| 2016 | ) |
| 2017 | ); |
| 2018 | |
| 2019 | $this->add_responsive_control( |
| 2020 | 'nav_icon_size', |
| 2021 | array( |
| 2022 | 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ), |
| 2023 | 'type' => Controls_Manager::SLIDER, |
| 2024 | 'size_units' => array( 'px', '%', 'em' ), |
| 2025 | 'selectors' => array( |
| 2026 | '{{WRAPPER}} .flipster__button i' => 'font-size: {{SIZE}}{{UNIT}};', |
| 2027 | '{{WRAPPER}} .flipster__button svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 2028 | ), |
| 2029 | ) |
| 2030 | ); |
| 2031 | |
| 2032 | $this->start_controls_tabs( 'nav_colors' ); |
| 2033 | |
| 2034 | $this->start_controls_tab( |
| 2035 | 'pa_nav_nomral', |
| 2036 | array( |
| 2037 | 'label' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 2038 | ) |
| 2039 | ); |
| 2040 | |
| 2041 | $this->add_control( |
| 2042 | 'pa_nav_color', |
| 2043 | array( |
| 2044 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2045 | 'type' => Controls_Manager::COLOR, |
| 2046 | 'global' => array( |
| 2047 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 2048 | ), |
| 2049 | 'selectors' => array( |
| 2050 | '{{WRAPPER}} .flipster__button i' => 'color: {{VALUE}};', |
| 2051 | '{{WRAPPER}} .flipster__button svg, {{WRAPPER}} .flipster__button svg *' => 'fill: {{VALUE}};', |
| 2052 | ), |
| 2053 | ) |
| 2054 | ); |
| 2055 | |
| 2056 | $this->add_control( |
| 2057 | 'pa_nav_opacity', |
| 2058 | array( |
| 2059 | 'label' => __( 'Opacity', 'premium-addons-for-elementor' ), |
| 2060 | 'type' => Controls_Manager::SLIDER, |
| 2061 | 'size_units' => array( 'px' ), |
| 2062 | 'range' => array( |
| 2063 | 'px' => array( |
| 2064 | 'min' => 0, |
| 2065 | 'max' => 1, |
| 2066 | 'step' => 0.1, |
| 2067 | ), |
| 2068 | ), |
| 2069 | 'selectors' => array( |
| 2070 | '{{WRAPPER}} .flipster__button' => 'opacity: {{SIZE}}', |
| 2071 | ), |
| 2072 | ) |
| 2073 | ); |
| 2074 | |
| 2075 | $this->add_control( |
| 2076 | 'pa_nav_bg', |
| 2077 | array( |
| 2078 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2079 | 'type' => Controls_Manager::COLOR, |
| 2080 | 'global' => array( |
| 2081 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 2082 | ), |
| 2083 | 'selectors' => array( |
| 2084 | '{{WRAPPER}} .flipster__button' => 'background-color: {{VALUE}};', |
| 2085 | ), |
| 2086 | ) |
| 2087 | ); |
| 2088 | |
| 2089 | $this->add_group_control( |
| 2090 | Group_Control_Border::get_type(), |
| 2091 | array( |
| 2092 | 'name' => 'pa_nav_border', |
| 2093 | 'selector' => '{{WRAPPER}} .flipster__button', |
| 2094 | ) |
| 2095 | ); |
| 2096 | |
| 2097 | $this->add_control( |
| 2098 | 'pa_nav_border_radius', |
| 2099 | array( |
| 2100 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2101 | 'type' => Controls_Manager::SLIDER, |
| 2102 | 'size_units' => array( 'px', '%', 'em' ), |
| 2103 | 'selectors' => array( |
| 2104 | '{{WRAPPER}} .flipster__button' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2105 | ), |
| 2106 | ) |
| 2107 | ); |
| 2108 | |
| 2109 | $this->end_controls_tab(); |
| 2110 | |
| 2111 | $this->start_controls_tab( |
| 2112 | 'pa_nav_hover', |
| 2113 | array( |
| 2114 | 'label' => __( 'Hover', 'premium-addons-for-elementor' ), |
| 2115 | |
| 2116 | ) |
| 2117 | ); |
| 2118 | |
| 2119 | $this->add_control( |
| 2120 | 'pa_nav_color_hov', |
| 2121 | array( |
| 2122 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2123 | 'type' => Controls_Manager::COLOR, |
| 2124 | 'selectors' => array( |
| 2125 | '{{WRAPPER}} .flipster__button:hover i' => 'color: {{VALUE}};', |
| 2126 | '{{WRAPPER}} .flipster__button:hover svg, {{WRAPPER}} .flipster__button:hover svg *' => 'fill: {{VALUE}};', |
| 2127 | ), |
| 2128 | ) |
| 2129 | ); |
| 2130 | |
| 2131 | $this->add_control( |
| 2132 | 'pa_nav_opacity_hov', |
| 2133 | array( |
| 2134 | 'label' => __( 'Opacity', 'premium-addons-for-elementor' ), |
| 2135 | 'type' => Controls_Manager::SLIDER, |
| 2136 | 'size_units' => array( 'px' ), |
| 2137 | 'range' => array( |
| 2138 | 'px' => array( |
| 2139 | 'min' => 0, |
| 2140 | 'max' => 1, |
| 2141 | 'step' => 0.1, |
| 2142 | ), |
| 2143 | ), |
| 2144 | 'selectors' => array( |
| 2145 | '{{WRAPPER}} .flipster__button:hover' => 'opacity: {{SIZE}}', |
| 2146 | ), |
| 2147 | ) |
| 2148 | ); |
| 2149 | |
| 2150 | $this->add_control( |
| 2151 | 'pa_nav_bg_hov', |
| 2152 | array( |
| 2153 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2154 | 'type' => Controls_Manager::COLOR, |
| 2155 | 'selectors' => array( |
| 2156 | '{{WRAPPER}} .flipster__button:hover' => 'background-color: {{VALUE}};', |
| 2157 | ), |
| 2158 | ) |
| 2159 | ); |
| 2160 | |
| 2161 | $this->add_group_control( |
| 2162 | Group_Control_Border::get_type(), |
| 2163 | array( |
| 2164 | 'name' => 'pa_nav_border_hov', |
| 2165 | 'selector' => '{{WRAPPER}} .flipster__button:hover', |
| 2166 | ) |
| 2167 | ); |
| 2168 | |
| 2169 | $this->add_control( |
| 2170 | 'pa_nav_border_radius_hov', |
| 2171 | array( |
| 2172 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2173 | 'type' => Controls_Manager::SLIDER, |
| 2174 | 'size_units' => array( 'px', '%', 'em' ), |
| 2175 | 'selectors' => array( |
| 2176 | '{{WRAPPER}} .flipster__button:hover' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2177 | ), |
| 2178 | ) |
| 2179 | ); |
| 2180 | |
| 2181 | $this->end_controls_tab(); |
| 2182 | |
| 2183 | $this->end_controls_tabs(); |
| 2184 | |
| 2185 | $this->add_responsive_control( |
| 2186 | 'pa_nav_pos_hor', |
| 2187 | array( |
| 2188 | 'label' => __( 'Horizontal Position', 'premium-addons-for-elementor' ), |
| 2189 | 'type' => Controls_Manager::SLIDER, |
| 2190 | 'size_units' => array( 'px', '%', 'custom' ), |
| 2191 | 'range' => array( |
| 2192 | 'px' => array( |
| 2193 | 'min' => -500, |
| 2194 | 'max' => 500, |
| 2195 | 'step' => 1, |
| 2196 | ), |
| 2197 | ), |
| 2198 | 'separator' => 'before', |
| 2199 | 'selectors' => array( |
| 2200 | '{{WRAPPER}} .flipster__button.flipster__button--prev' => 'left: {{SIZE}}px;', |
| 2201 | '{{WRAPPER}} .flipster__button.flipster__button--next' => 'right: {{SIZE}}px;', |
| 2202 | ), |
| 2203 | ) |
| 2204 | ); |
| 2205 | |
| 2206 | $this->add_responsive_control( |
| 2207 | 'pa_nav_pos_ver', |
| 2208 | array( |
| 2209 | 'label' => __( 'Vertical Position', 'premium-addons-for-elementor' ), |
| 2210 | 'type' => Controls_Manager::SLIDER, |
| 2211 | 'size_units' => array( 'px', '%', 'custom' ), |
| 2212 | 'range' => array( |
| 2213 | 'px' => array( |
| 2214 | 'min' => -500, |
| 2215 | 'max' => 500, |
| 2216 | 'step' => 1, |
| 2217 | ), |
| 2218 | '%' => array( |
| 2219 | 'min' => -100, |
| 2220 | 'max' => 100, |
| 2221 | 'step' => 1, |
| 2222 | ), |
| 2223 | ), |
| 2224 | 'selectors' => array( |
| 2225 | '{{WRAPPER}} .flipster__button' => 'top: {{SIZE}}{{UNIT}};', |
| 2226 | ), |
| 2227 | ) |
| 2228 | ); |
| 2229 | |
| 2230 | $this->add_responsive_control( |
| 2231 | 'pa_nav_padding', |
| 2232 | array( |
| 2233 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2234 | 'type' => Controls_Manager::SLIDER, |
| 2235 | 'size_units' => array( 'px' ), |
| 2236 | 'range' => array( |
| 2237 | 'px' => array( |
| 2238 | 'min' => 0, |
| 2239 | 'max' => 500, |
| 2240 | 'step' => 1, |
| 2241 | ), |
| 2242 | ), |
| 2243 | 'selectors' => array( |
| 2244 | '{{WRAPPER}} .flipster__button' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 2245 | ), |
| 2246 | ) |
| 2247 | ); |
| 2248 | |
| 2249 | $this->end_controls_section(); |
| 2250 | } |
| 2251 | |
| 2252 | private function add_light_box_icon_style() { |
| 2253 | $this->start_controls_section( |
| 2254 | 'lighbox_icon_style', |
| 2255 | array( |
| 2256 | 'label' => __( 'Lightbox Icon', 'premium-addons-for-elementor' ), |
| 2257 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2258 | 'condition' => array( |
| 2259 | 'media_lightbox_type' => 'yes', |
| 2260 | ), |
| 2261 | ) |
| 2262 | ); |
| 2263 | |
| 2264 | $this->add_responsive_control( |
| 2265 | 'lighbox_icon_position', |
| 2266 | array( |
| 2267 | 'label' => __( 'Position', 'premium-addons-for-elementor' ), |
| 2268 | 'type' => Controls_Manager::SLIDER, |
| 2269 | 'size_units' => array( 'px', '%', 'em', 'custom' ), |
| 2270 | 'range' => array( |
| 2271 | 'px' => array( |
| 2272 | 'min' => 0, |
| 2273 | 'max' => 300, |
| 2274 | ), |
| 2275 | ), |
| 2276 | 'label_block' => true, |
| 2277 | 'selectors' => array( |
| 2278 | '{{WRAPPER}} .premium-adv-carousel__item .pa-media-icons-inner-container' => 'top: {{SIZE}}{{UNIT}};', |
| 2279 | ), |
| 2280 | ) |
| 2281 | ); |
| 2282 | |
| 2283 | $this->add_responsive_control( |
| 2284 | 'lighbox_icon_size', |
| 2285 | array( |
| 2286 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 2287 | 'type' => Controls_Manager::SLIDER, |
| 2288 | 'size_units' => array( 'px', 'em' ), |
| 2289 | 'range' => array( |
| 2290 | 'px' => array( |
| 2291 | 'min' => 1, |
| 2292 | 'max' => 50, |
| 2293 | ), |
| 2294 | ), |
| 2295 | 'default' => array( |
| 2296 | 'size' => 20, |
| 2297 | 'unit' => 'px', |
| 2298 | ), |
| 2299 | 'label_block' => true, |
| 2300 | 'selectors' => array( |
| 2301 | '{{WRAPPER}} .pa-media-icons-inner-container i' => 'font-size: {{SIZE}}{{UNIT}}', |
| 2302 | '{{WRAPPER}} .pa-media-icons-inner-container svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}', |
| 2303 | ), |
| 2304 | ) |
| 2305 | ); |
| 2306 | |
| 2307 | $this->add_responsive_control( |
| 2308 | 'lighbox_icon_style_padding', |
| 2309 | array( |
| 2310 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2311 | 'type' => Controls_Manager::DIMENSIONS, |
| 2312 | 'size_units' => array( 'px', 'em', '%' ), |
| 2313 | 'selectors' => array( |
| 2314 | '{{WRAPPER}} .pa-media-magnific-image span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2315 | ), |
| 2316 | ) |
| 2317 | ); |
| 2318 | |
| 2319 | $this->start_controls_tabs( 'lighbox_icon_style_tabs' ); |
| 2320 | |
| 2321 | $this->start_controls_tab( |
| 2322 | 'lighbox_icon_style_normal', |
| 2323 | array( |
| 2324 | 'label' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 2325 | ) |
| 2326 | ); |
| 2327 | |
| 2328 | $this->add_control( |
| 2329 | 'lighbox_icon_style_color', |
| 2330 | array( |
| 2331 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2332 | 'type' => Controls_Manager::COLOR, |
| 2333 | 'global' => array( |
| 2334 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 2335 | ), |
| 2336 | 'selectors' => array( |
| 2337 | '{{WRAPPER}} .pa-media-magnific-image i' => 'color: {{VALUE}};', |
| 2338 | '{{WRAPPER}} .pa-media-magnific-image svg' => 'fill: {{VALUE}}; color: {{VALUE}}', |
| 2339 | ), |
| 2340 | ) |
| 2341 | ); |
| 2342 | |
| 2343 | $this->add_control( |
| 2344 | 'lighbox_icon_style_background', |
| 2345 | array( |
| 2346 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2347 | 'type' => Controls_Manager::COLOR, |
| 2348 | 'global' => array( |
| 2349 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 2350 | ), |
| 2351 | 'selectors' => array( |
| 2352 | '{{WRAPPER}} .pa-media-magnific-image span' => 'background-color: {{VALUE}};', |
| 2353 | ), |
| 2354 | ) |
| 2355 | ); |
| 2356 | |
| 2357 | $this->add_group_control( |
| 2358 | Group_Control_Border::get_type(), |
| 2359 | array( |
| 2360 | 'name' => 'lighbox_icon_style_border', |
| 2361 | 'selector' => '{{WRAPPER}} .pa-media-magnific-image span', |
| 2362 | ) |
| 2363 | ); |
| 2364 | |
| 2365 | $this->add_control( |
| 2366 | 'lighbox_icon_style_border_radius', |
| 2367 | array( |
| 2368 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2369 | 'type' => Controls_Manager::SLIDER, |
| 2370 | 'size_units' => array( 'px', 'em', '%' ), |
| 2371 | 'selectors' => array( |
| 2372 | '{{WRAPPER}} .pa-media-magnific-image span' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2373 | ), |
| 2374 | ) |
| 2375 | ); |
| 2376 | |
| 2377 | $this->add_group_control( |
| 2378 | Group_Control_Box_Shadow::get_type(), |
| 2379 | array( |
| 2380 | 'label' => __( 'Shadow', 'premium-addons-for-elementor' ), |
| 2381 | 'name' => 'lighbox_icon_style_shadow', |
| 2382 | 'selector' => '{{WRAPPER}} .pa-media-magnific-image span', |
| 2383 | ) |
| 2384 | ); |
| 2385 | |
| 2386 | $this->end_controls_tab(); |
| 2387 | |
| 2388 | $this->start_controls_tab( |
| 2389 | 'lighbox_icon_style_hover', |
| 2390 | array( |
| 2391 | 'label' => __( 'Hover', 'premium-addons-for-elementor' ), |
| 2392 | ) |
| 2393 | ); |
| 2394 | |
| 2395 | $this->add_control( |
| 2396 | 'lighbox_icon_style_color_hover', |
| 2397 | array( |
| 2398 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2399 | 'type' => Controls_Manager::COLOR, |
| 2400 | 'global' => array( |
| 2401 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 2402 | ), |
| 2403 | 'selectors' => array( |
| 2404 | '{{WRAPPER}} .pa-media-magnific-image:hover i' => 'color: {{VALUE}}', |
| 2405 | '{{WRAPPER}} .pa-media-magnific-image:hover svg' => 'fill: {{VALUE}}; color: {{VALUE}}', |
| 2406 | ), |
| 2407 | ) |
| 2408 | ); |
| 2409 | |
| 2410 | $this->add_control( |
| 2411 | 'lighbox_icon_style_background_hover', |
| 2412 | array( |
| 2413 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2414 | 'type' => Controls_Manager::COLOR, |
| 2415 | 'global' => array( |
| 2416 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 2417 | ), |
| 2418 | 'selectors' => array( |
| 2419 | '{{WRAPPER}} .pa-media-magnific-image:hover span' => 'background-color: {{VALUE}};', |
| 2420 | ), |
| 2421 | ) |
| 2422 | ); |
| 2423 | |
| 2424 | $this->add_group_control( |
| 2425 | Group_Control_Border::get_type(), |
| 2426 | array( |
| 2427 | 'name' => 'lighbox_icon_style_border_hover', |
| 2428 | 'selector' => '{{WRAPPER}} .pa-media-magnific-image:hover span', |
| 2429 | ) |
| 2430 | ); |
| 2431 | |
| 2432 | $this->add_control( |
| 2433 | 'lighbox_icon_style_border_radius_hover', |
| 2434 | array( |
| 2435 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2436 | 'type' => Controls_Manager::SLIDER, |
| 2437 | 'size_units' => array( 'px', 'em', '%' ), |
| 2438 | 'selectors' => array( |
| 2439 | '{{WRAPPER}} .pa-media-magnific-image:hover span' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2440 | ), |
| 2441 | ) |
| 2442 | ); |
| 2443 | |
| 2444 | $this->add_group_control( |
| 2445 | Group_Control_Box_Shadow::get_type(), |
| 2446 | array( |
| 2447 | 'label' => __( 'Shadow', 'premium-addons-for-elementor' ), |
| 2448 | 'name' => 'lighbox_icon_style_shadow_hover', |
| 2449 | 'selector' => '{{WRAPPER}} .pa-media-magnific-image:hover span', |
| 2450 | ) |
| 2451 | ); |
| 2452 | |
| 2453 | $this->end_controls_tab(); |
| 2454 | |
| 2455 | $this->end_controls_tabs(); |
| 2456 | |
| 2457 | $this->end_controls_section(); |
| 2458 | } |
| 2459 | |
| 2460 | private function add_light_box_style() { |
| 2461 | |
| 2462 | $this->start_controls_section( |
| 2463 | 'section_lightbox_style', |
| 2464 | array( |
| 2465 | 'label' => __( 'Lightbox', 'premium-addons-for-elementor' ), |
| 2466 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2467 | 'condition' => array( |
| 2468 | 'media_lightbox_type' => 'yes', |
| 2469 | ), |
| 2470 | ) |
| 2471 | ); |
| 2472 | |
| 2473 | $this->add_control( |
| 2474 | 'lightbox_color', |
| 2475 | array( |
| 2476 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2477 | 'type' => Controls_Manager::COLOR, |
| 2478 | 'selectors' => array( |
| 2479 | '#elementor-lightbox-slideshow-{{ID}}, #elementor-lightbox-{{ID}}' => 'background-color: {{VALUE}};', |
| 2480 | ), |
| 2481 | ) |
| 2482 | ); |
| 2483 | |
| 2484 | $this->add_control( |
| 2485 | 'lightbox_ui_color', |
| 2486 | array( |
| 2487 | 'label' => __( 'UI Color', 'premium-addons-for-elementor' ), |
| 2488 | 'type' => Controls_Manager::COLOR, |
| 2489 | 'selectors' => array( |
| 2490 | '#elementor-lightbox-slideshow-{{ID}} .dialog-lightbox-close-button, #elementor-lightbox-{{ID}} .dialog-lightbox-close-button' => 'color: {{VALUE}};', |
| 2491 | '#elementor-lightbox-slideshow-{{ID}} svg, #elementor-lightbox-{{ID}} svg' => 'fill: {{VALUE}}', |
| 2492 | ), |
| 2493 | ) |
| 2494 | ); |
| 2495 | |
| 2496 | $this->add_control( |
| 2497 | 'lightbox_ui_hover_color', |
| 2498 | array( |
| 2499 | 'label' => __( 'UI Hover Color', 'premium-addons-for-elementor' ), |
| 2500 | 'type' => Controls_Manager::COLOR, |
| 2501 | 'selectors' => array( |
| 2502 | '#elementor-lightbox-slideshow-{{ID}} .dialog-lightbox-close-button:hover, #elementor-lightbox-{{ID}} .dialog-lightbox-close-button:hover' => 'color: {{VALUE}};', |
| 2503 | '#elementor-lightbox-slideshow-{{ID}} svg:hover, #elementor-lightbox-{{ID}} svg:hover' => 'fill: {{VALUE}}', |
| 2504 | ), |
| 2505 | ) |
| 2506 | ); |
| 2507 | |
| 2508 | $this->end_controls_section(); |
| 2509 | } |
| 2510 | |
| 2511 | /** |
| 2512 | * Render Advanced Media widget output on the frontend. |
| 2513 | * |
| 2514 | * Written in PHP and used to generate the final HTML. |
| 2515 | * |
| 2516 | * @access protected |
| 2517 | */ |
| 2518 | protected function render() { |
| 2519 | |
| 2520 | $settings = $this->get_settings_for_display(); |
| 2521 | |
| 2522 | $this->papro_activated = Helper_Functions::check_papro_version(); |
| 2523 | |
| 2524 | if ( ! $this->papro_activated || version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.9.6', '<' ) ) { |
| 2525 | |
| 2526 | if ( 'infinite' !== $settings['media_wheel_animation'] ) { |
| 2527 | |
| 2528 | ?> |
| 2529 | <div class="premium-error-notice"> |
| 2530 | <?php |
| 2531 | $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' ); |
| 2532 | echo wp_kses_post( $message ); |
| 2533 | ?> |
| 2534 | </div> |
| 2535 | <?php |
| 2536 | return false; |
| 2537 | |
| 2538 | } |
| 2539 | } |
| 2540 | |
| 2541 | $items = $settings['media_wheel_repeater']; |
| 2542 | |
| 2543 | $direction = $settings['media_wheel_direction']; |
| 2544 | |
| 2545 | $type = $settings['media_wheel_animation']; |
| 2546 | |
| 2547 | $wheel_settings = array( |
| 2548 | 'type' => $type, |
| 2549 | 'scroll' => 'yes' === $settings['media_wheel_scroll'], |
| 2550 | 'speed' => empty( $settings['media_wheel_speed'] ) ? 50 : $settings['media_wheel_speed'], |
| 2551 | 'pauseOnHover' => 'yes' === $settings['media_wheel_scroll'] ? true : 'yes' === $settings['pause_on_hover'], |
| 2552 | ); |
| 2553 | |
| 2554 | if ( 'infinite' === $type ) { |
| 2555 | $wheel_settings['dir'] = $direction; |
| 2556 | $wheel_settings['reverse'] = $settings['media_wheel_reverse']; |
| 2557 | $wheel_settings['renderEvent'] = $settings['render_event']; |
| 2558 | } else { |
| 2559 | $wheel_settings['loop'] = $settings['media_wheel_loop']; |
| 2560 | $auto_play = 'yes' === $settings['media_wheel_autoplay']; |
| 2561 | $arrows = 'yes' === $settings['arrows']; |
| 2562 | |
| 2563 | if ( $auto_play ) { |
| 2564 | $wheel_settings['autoPlay'] = '' === $settings['media_wheel_autoplay_speed'] ? 3000 : $settings['media_wheel_autoplay_speed']; |
| 2565 | } else { |
| 2566 | $wheel_settings['autoPlay'] = false; |
| 2567 | } |
| 2568 | |
| 2569 | $wheel_settings['click'] = 'yes' === $settings['nav_on_click']; |
| 2570 | $wheel_settings['keyboard'] = 'yes' === $settings['nav_by_keyboard']; |
| 2571 | $wheel_settings['touch'] = 'yes' === $settings['nav_by_touch']; |
| 2572 | $wheel_settings['buttons'] = $arrows; |
| 2573 | $wheel_settings['spacing'] = floatval( $settings['media_wheel_spacing']['size'] ); |
| 2574 | $wheel_settings['start'] = '' === $settings['media_whee_start'] ? 'center' : $settings['media_whee_start']; |
| 2575 | $wheel_settings['autoplay_videos'] = 'yes' === $settings['autoplay_videos']; |
| 2576 | |
| 2577 | } |
| 2578 | |
| 2579 | $this->add_render_attribute( 'inner', 'style', 'visibility:hidden;' ); |
| 2580 | |
| 2581 | $lightbox = $settings['media_light_box']; |
| 2582 | |
| 2583 | $lightbox_type = $settings['media_lightbox_type']; |
| 2584 | |
| 2585 | if ( 'yes' === $lightbox ) { |
| 2586 | |
| 2587 | $wheel_settings = array_merge( |
| 2588 | $wheel_settings, |
| 2589 | array( |
| 2590 | 'light_box' => $lightbox, |
| 2591 | 'lightbox_type' => $lightbox_type, |
| 2592 | 'overlay' => 'yes' === $settings['media_overlay_gallery'] ? true : false, |
| 2593 | 'theme' => $settings['media_lightbox_theme'], |
| 2594 | ) |
| 2595 | ); |
| 2596 | |
| 2597 | } else { |
| 2598 | $this->add_render_attribute( |
| 2599 | 'wheel', |
| 2600 | array( |
| 2601 | 'class' => array( |
| 2602 | 'premium-adv-carousel-no-lightbox', |
| 2603 | ), |
| 2604 | ) |
| 2605 | ); |
| 2606 | } |
| 2607 | |
| 2608 | $this->add_render_attribute( |
| 2609 | 'wheel', |
| 2610 | array( |
| 2611 | 'class' => 'premium-adv-carousel__container', |
| 2612 | 'data-settings' => wp_json_encode( $wheel_settings ), |
| 2613 | ) |
| 2614 | ); |
| 2615 | |
| 2616 | $this->add_render_attribute( 'inner', 'class', 'premium-adv-carousel__inner-container' ); |
| 2617 | |
| 2618 | ?> |
| 2619 | <div <?php $this->print_render_attribute_string( 'wheel' ); ?>> |
| 2620 | |
| 2621 | <div <?php $this->print_render_attribute_string( 'inner' ); ?>> |
| 2622 | |
| 2623 | <div class="premium-adv-carousel__items"> |
| 2624 | |
| 2625 | <?php |
| 2626 | $this->render_wheel_Items( $items ); |
| 2627 | if ( 'infinite' !== $type && $arrows ) { |
| 2628 | ?> |
| 2629 | <div class="premium-adv-carousel__icons-holder premium-adv-carousel__prev-icon"> |
| 2630 | <?php |
| 2631 | Icons_Manager::render_icon( |
| 2632 | $settings['prev_arrow'], |
| 2633 | array( |
| 2634 | 'aria-hidden' => 'true', |
| 2635 | ) |
| 2636 | ); |
| 2637 | ?> |
| 2638 | </div> |
| 2639 | <div class="premium-adv-carousel__icons-holder premium-adv-carousel__next-icon"> |
| 2640 | <?php |
| 2641 | Icons_Manager::render_icon( |
| 2642 | $settings['next_arrow'], |
| 2643 | array( |
| 2644 | 'aria-hidden' => 'true', |
| 2645 | ) |
| 2646 | ); |
| 2647 | ?> |
| 2648 | </div> |
| 2649 | <?php |
| 2650 | } |
| 2651 | ?> |
| 2652 | </div> |
| 2653 | </div> |
| 2654 | </div> |
| 2655 | <?php |
| 2656 | } |
| 2657 | |
| 2658 | /** |
| 2659 | * Get video thumbnail |
| 2660 | * |
| 2661 | * @access public |
| 2662 | * |
| 2663 | * @param string $video_id video ID. |
| 2664 | */ |
| 2665 | private function get_thumbnail( $settings, $video_id = '' ) { |
| 2666 | |
| 2667 | $type = $settings['media_wheel_video_type']; |
| 2668 | |
| 2669 | $thumbnail_src = $settings['media_wheel_img']['url']; |
| 2670 | |
| 2671 | if ( ! empty( $thumbnail_src ) || 'self' === $type ) { |
| 2672 | return $thumbnail_src; |
| 2673 | } |
| 2674 | |
| 2675 | // Check thumbnail size option only for Youtube videos. |
| 2676 | $size = ''; |
| 2677 | if ( 'youtube' === $type ) { |
| 2678 | $size = $settings['media_wheel_yt_thumbnail_size']; |
| 2679 | } |
| 2680 | |
| 2681 | $thumbnail_src = Helper_Functions::get_video_thumbnail( $video_id, $type, $size ); |
| 2682 | |
| 2683 | return $thumbnail_src; |
| 2684 | } |
| 2685 | |
| 2686 | private function render_wheel_Items( $items ) { |
| 2687 | |
| 2688 | $widget_settings = $this->get_settings_for_display(); |
| 2689 | |
| 2690 | $lightbox = $widget_settings['media_light_box']; |
| 2691 | |
| 2692 | if ( $this->papro_activated ) { |
| 2693 | |
| 2694 | $hover_effect = 'premium-hover-effects__' . $widget_settings['image_hover_effect']; |
| 2695 | |
| 2696 | } else { |
| 2697 | $hover_effect = ''; |
| 2698 | } |
| 2699 | |
| 2700 | foreach ( $items as $index => $item ) { |
| 2701 | |
| 2702 | $media_type = $item['pa_media_type']; |
| 2703 | |
| 2704 | $alt = ''; |
| 2705 | |
| 2706 | if ( $item['media_wheel_img'] ) { |
| 2707 | |
| 2708 | $image_id = apply_filters( 'wpml_object_id', $item['media_wheel_img']['id'], 'attachment', true ); |
| 2709 | |
| 2710 | $image_by_id = get_post( $image_id ); |
| 2711 | |
| 2712 | if ( $image_by_id && ! empty( $image_by_id->post_title ) ) { |
| 2713 | $alt = apply_filters( 'pa_media_alt', get_post( $image_id )->post_title ); |
| 2714 | } |
| 2715 | } |
| 2716 | |
| 2717 | if ( 'template' === $media_type ) { |
| 2718 | $hover_effect = ''; |
| 2719 | } |
| 2720 | |
| 2721 | $media_info = in_array( $media_type, array( 'image', 'video' ), true ) && 'yes' === $item['media_info']; |
| 2722 | |
| 2723 | $this->add_render_attribute( |
| 2724 | 'wheel_item' . $index, |
| 2725 | array( |
| 2726 | 'class' => array( |
| 2727 | 'elementor-repeater-item-' . $item['_id'], |
| 2728 | 'premium-adv-carousel__item', |
| 2729 | 'premium-adv-carousel__item-' . $media_type, |
| 2730 | ), |
| 2731 | ) |
| 2732 | ); |
| 2733 | |
| 2734 | ?> |
| 2735 | <div class="premium-adv-carousel__item-outer-wrapper"> |
| 2736 | <div <?php $this->print_render_attribute_string( 'wheel_item' . $index ); ?>> |
| 2737 | <div class="premium-adv-carousel__media-wrap"> |
| 2738 | <?php |
| 2739 | if ( 'image' === $media_type ) { |
| 2740 | |
| 2741 | $image_id = apply_filters( 'wpml_object_id', $item['media_wheel_img']['id'], 'attachment', true ); |
| 2742 | |
| 2743 | $image_url = wp_get_attachment_image_url( $image_id, 'full' ); |
| 2744 | |
| 2745 | $this->add_render_attribute( |
| 2746 | 'wheel_img' . $index, |
| 2747 | array( |
| 2748 | 'src' => esc_url( $image_url ? $image_url : $item['media_wheel_img']['url'] ), |
| 2749 | 'alt' => esc_attr( Control_Media::get_image_alt( $item['media_wheel_img'] ) ), |
| 2750 | 'class' => 'premium-adv-carousel__item-img ' . esc_attr( $hover_effect ), |
| 2751 | ) |
| 2752 | ); |
| 2753 | |
| 2754 | ?> |
| 2755 | <img <?php $this->print_render_attribute_string( 'wheel_img' . $index ); ?>> |
| 2756 | <?php |
| 2757 | } elseif ( 'id' === $media_type ) { |
| 2758 | ?> |
| 2759 | <div class="premium-adv-carousel__item--container" |
| 2760 | data-template-src="<?php echo esc_attr( $item['container_id'] ); // phpcs:ignore WordPressVIPMinimum.Security.ProperEscapingFunction.hrefSrcEscUrl -- Holds a container ID/CSS selector read by JS, not a URL. ?>"> |
| 2761 | </div> |
| 2762 | <?php |
| 2763 | } elseif ( 'video' === $media_type ) { |
| 2764 | $video_data = $this->render_carousel_video( $item, $index, $hover_effect ); |
| 2765 | $item['video_link'] = $video_data; |
| 2766 | } else { |
| 2767 | $template_name = empty( $item['section_template'] ) ? $item['live_temp_content'] : $item['section_template']; |
| 2768 | ?> |
| 2769 | <div class="premium-adv-carousel__template-wrapper"> |
| 2770 | <?php echo Helper_Functions::render_elementor_template( $template_name ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 2771 | </div> |
| 2772 | <?php |
| 2773 | } |
| 2774 | |
| 2775 | if ( 'yes' === $item['media_wheel_link_switcher'] ) { |
| 2776 | $link = ''; |
| 2777 | |
| 2778 | $target = ( 'yes' === $item['media_wheel_link_new_tab'] ) ? 'target=_blank' : ''; |
| 2779 | |
| 2780 | if ( 'link' === $item['media_wheel_link_type'] ) { |
| 2781 | $link = get_permalink( $item['media_wheel_existing_link'] ); |
| 2782 | } else { |
| 2783 | $link = $item['media_wheel_custom_link']['url']; |
| 2784 | } |
| 2785 | |
| 2786 | $aria_label = ''; |
| 2787 | |
| 2788 | if ( ! empty( $item['item_name'] ) ) { |
| 2789 | $aria_label = $item['item_name']; |
| 2790 | } elseif ( $media_info && ! empty( $item['media_title'] ) ) { |
| 2791 | $aria_label = $item['media_title']; |
| 2792 | } |
| 2793 | |
| 2794 | echo '<a class="premium-adv-carousel__item-link" aria-label="' . esc_attr( $aria_label ) . '" href="' . esc_url( $link ) . '" ' . esc_html( $target ) . '></a>'; |
| 2795 | } |
| 2796 | |
| 2797 | ?> |
| 2798 | </div> |
| 2799 | |
| 2800 | <?php |
| 2801 | if ( 'yes' === $lightbox || 'video' === $media_type ) { |
| 2802 | ?> |
| 2803 | <div class="pa-media-icons-wrapper"> |
| 2804 | <div class="pa-media-icons-inner-container"> |
| 2805 | <?php $this->render_icons( $item, $index, $alt ); ?> |
| 2806 | </div> |
| 2807 | </div> |
| 2808 | <?php |
| 2809 | } |
| 2810 | ?> |
| 2811 | |
| 2812 | <?php |
| 2813 | if ( $media_info ) { |
| 2814 | ?> |
| 2815 | <div class="premium-adv-carousel__media-info-wrap"> |
| 2816 | <?php |
| 2817 | if ( ! empty( $item['media_title'] ) ) { |
| 2818 | ?> |
| 2819 | <span class="premium-adv-carousel__media-title"><?php echo esc_html( $item['media_title'] ); ?></span> |
| 2820 | <?php |
| 2821 | } |
| 2822 | |
| 2823 | if ( ! empty( $item['media_desc'] ) ) { |
| 2824 | ?> |
| 2825 | <span class="premium-adv-carousel__media-desc"><?php echo esc_html( $item['media_desc'] ); ?></span> |
| 2826 | <?php |
| 2827 | } |
| 2828 | ?> |
| 2829 | </div> |
| 2830 | <?php |
| 2831 | } |
| 2832 | ?> |
| 2833 | </div> |
| 2834 | </div> |
| 2835 | <?php |
| 2836 | } |
| 2837 | } |
| 2838 | |
| 2839 | /** |
| 2840 | * Render carousel Videos |
| 2841 | * |
| 2842 | * Written in PHP and used to generate the final HTML for video items. |
| 2843 | * |
| 2844 | * @access private |
| 2845 | * |
| 2846 | * @param array $item repeater item. |
| 2847 | * @param number $index item index. |
| 2848 | * @param string $hover_effect image hover effect. |
| 2849 | */ |
| 2850 | private function render_carousel_video( $item, $index, $hover_effect ) { |
| 2851 | |
| 2852 | $video_type = $item['media_wheel_video_type']; |
| 2853 | |
| 2854 | $video_thumb = $item['media_wheel_img']['url']; |
| 2855 | |
| 2856 | $video_alt = Control_Media::get_image_alt( $item['media_wheel_img'] ); |
| 2857 | |
| 2858 | $params = $this->get_embed_params( $item ); |
| 2859 | |
| 2860 | $link = Embed::get_embed_url( $item['media_wheel_video_link'], $params ); |
| 2861 | |
| 2862 | // Embed::get_embed_url() returns the embed URL string (or null) at runtime; normalize to a string. |
| 2863 | $link = is_array( $link ) ? '' : (string) $link; |
| 2864 | |
| 2865 | if ( 'hosted' !== $video_type ) { |
| 2866 | |
| 2867 | $video_props = Embed::get_video_properties( $link ); |
| 2868 | $id = $video_props['video_id']; |
| 2869 | $thumbnail = $this->get_thumbnail( $item, $id ); |
| 2870 | |
| 2871 | } else { |
| 2872 | self::$check_self_hosted = true; |
| 2873 | $params = $this->get_hosted_params( $item ); |
| 2874 | $thumbnail = ''; |
| 2875 | } |
| 2876 | |
| 2877 | $thumbnail = empty( $thumbnail ) ? $video_thumb : $thumbnail; |
| 2878 | |
| 2879 | ?> |
| 2880 | <div class="premium-adv-carousel__video-wrap" data-type="<?php echo esc_attr( $item['media_wheel_video_type'] ); ?>" <?php $this->print_render_attribute_string( 'video_container' ); ?>> |
| 2881 | <?php if ( 'hosted' !== $item['media_wheel_video_type'] ) : ?> |
| 2882 | <div class="premium-adv-carousel__iframe-wrap" data-src="<?php echo esc_url( $link ); ?>"></div> |
| 2883 | <?php |
| 2884 | else : |
| 2885 | $link = empty( $item['media_wheel_video_self_url'] ) ? $item['media_wheel_video_self']['url'] : $item['media_wheel_video_self_url']; |
| 2886 | |
| 2887 | ?> |
| 2888 | <video src="<?php echo esc_url( $link ); ?>" <?php echo wp_kses_post( Utils::render_html_attributes( $params ) ); ?>></video> |
| 2889 | <?php endif; ?> |
| 2890 | <img class="premium-adv-carousel__vid-overlay <?php echo esc_attr( $hover_effect ); ?>" src="<?php echo esc_url( $thumbnail ); ?>" alt="<?php echo esc_attr( $video_alt ); ?>"> |
| 2891 | |
| 2892 | </div> |
| 2893 | <?php |
| 2894 | |
| 2895 | return empty( $link ) ? false : $link; |
| 2896 | } |
| 2897 | |
| 2898 | /** |
| 2899 | * Get embedded videos parameters |
| 2900 | * |
| 2901 | * @access private |
| 2902 | * |
| 2903 | * @param array $item repeater item. |
| 2904 | */ |
| 2905 | private function get_embed_params( $item ) { |
| 2906 | |
| 2907 | $video_params = array(); |
| 2908 | |
| 2909 | $video_params['controls'] = $item['media_wheel_video_controls'] ? '1' : '0'; |
| 2910 | |
| 2911 | $key = 'youtube' === $item['media_wheel_video_type'] ? 'mute' : 'muted'; |
| 2912 | |
| 2913 | $video_params[ $key ] = $item['media_wheel_video_mute'] ? '1' : '0'; |
| 2914 | |
| 2915 | if ( 'vimeo' === $item['media_wheel_video_type'] ) { |
| 2916 | $video_params['autopause'] = '0'; |
| 2917 | } |
| 2918 | |
| 2919 | return $video_params; |
| 2920 | } |
| 2921 | |
| 2922 | /** |
| 2923 | * Get Hosted Videos Parameters |
| 2924 | * |
| 2925 | * @access private |
| 2926 | * |
| 2927 | * @param array $item repeater item. |
| 2928 | */ |
| 2929 | private function get_hosted_params( $item ) { |
| 2930 | |
| 2931 | $video_params = array(); |
| 2932 | |
| 2933 | if ( $item['media_wheel_video_controls'] ) { |
| 2934 | $video_params['controls'] = ''; |
| 2935 | } |
| 2936 | |
| 2937 | if ( $item['media_wheel_video_mute'] ) { |
| 2938 | $video_params['muted'] = 'muted'; |
| 2939 | } |
| 2940 | |
| 2941 | if ( $item['media_wheel_video_loop'] ) { |
| 2942 | $video_params['loop'] = ''; |
| 2943 | } |
| 2944 | |
| 2945 | return $video_params; |
| 2946 | } |
| 2947 | |
| 2948 | /** |
| 2949 | * Render Icons |
| 2950 | * |
| 2951 | * Render Lightbox and URL Icons HTML |
| 2952 | * |
| 2953 | * @since 3.6.4 |
| 2954 | * @access protected |
| 2955 | * |
| 2956 | * @param array $item grid image repeater item. |
| 2957 | * @param integer $index item index. |
| 2958 | * @param string $alt image alternative text. |
| 2959 | */ |
| 2960 | private function render_icons( $item, $index, $alt ) { |
| 2961 | |
| 2962 | $settings = $this->get_settings_for_display(); |
| 2963 | |
| 2964 | $lightbox_key = 'image_lightbox_' . $index; |
| 2965 | |
| 2966 | $link_key = 'image_link_' . $index; |
| 2967 | |
| 2968 | $href = $item['media_wheel_img']['url']; |
| 2969 | |
| 2970 | $lightbox = $settings['media_light_box']; |
| 2971 | |
| 2972 | $lightbox_type = $settings['media_lightbox_type']; |
| 2973 | |
| 2974 | $media_type = $item['pa_media_type']; |
| 2975 | |
| 2976 | $id = $this->get_id(); |
| 2977 | |
| 2978 | $play_icon_enabled = 'yes' === $item['media_wheel_video_icon_switcher']; |
| 2979 | |
| 2980 | if ( 'video' === $media_type ) { |
| 2981 | |
| 2982 | $type = $item['media_wheel_video_type']; |
| 2983 | |
| 2984 | $this->add_render_attribute( |
| 2985 | $lightbox_key, |
| 2986 | array( |
| 2987 | 'class' => array( |
| 2988 | 'pa-media-lightbox-wrap', |
| 2989 | 'pa-media-magnific-image', |
| 2990 | 'pa-media-video-icon', |
| 2991 | ), |
| 2992 | 'tabindex' => 0, |
| 2993 | ) |
| 2994 | ); |
| 2995 | |
| 2996 | $lightbox_options = array( |
| 2997 | 'privacy' => 'yes', |
| 2998 | ); |
| 2999 | |
| 3000 | if ( 'yes' === $lightbox ) { |
| 3001 | |
| 3002 | if ( 'default' !== $lightbox_type ) { |
| 3003 | |
| 3004 | if ( 1 === count( $settings['media_wheel_repeater'] ) || self::$check_self_hosted ) { |
| 3005 | |
| 3006 | $lightbox_options = array( |
| 3007 | 'type' => 'video', |
| 3008 | 'videoType' => $item['media_wheel_video_type'], |
| 3009 | 'url' => $item['video_link'], |
| 3010 | 'modalOptions' => array( |
| 3011 | 'id' => 'elementor-lightbox-' . $id, |
| 3012 | 'videoAspectRatio' => '169', |
| 3013 | ), |
| 3014 | ); |
| 3015 | |
| 3016 | if ( 'hosted' === $type ) { |
| 3017 | $lightbox_options['videoParams'] = $this->get_hosted_params( $item ); |
| 3018 | } |
| 3019 | } |
| 3020 | |
| 3021 | $this->add_render_attribute( |
| 3022 | $lightbox_key, |
| 3023 | array( |
| 3024 | 'data-elementor-open-lightbox' => 'yes', |
| 3025 | 'data-elementor-lightbox' => wp_json_encode( $lightbox_options ), |
| 3026 | 'data-elementor-lightbox-video' => $item['video_link'], |
| 3027 | ) |
| 3028 | ); |
| 3029 | |
| 3030 | // Make sure videos slideshow is enabled only when there are no self hosted videos |
| 3031 | // Self hosted videos causes issue with slideshow |
| 3032 | if ( ! self::$check_self_hosted ) { |
| 3033 | $this->add_render_attribute( $lightbox_key, 'data-elementor-lightbox-slideshow', count( $settings['media_wheel_repeater'] ) > 1 ? $this->get_id() : false ); |
| 3034 | } |
| 3035 | } else { |
| 3036 | |
| 3037 | $rel = sprintf( 'prettyPhoto[premium-media-%s]', $this->get_id() ); |
| 3038 | |
| 3039 | $link = ( 'hosted' === $type ) ? $item['video_link'] : $item['video_link'] . '&iframe=true'; |
| 3040 | |
| 3041 | $this->add_render_attribute( |
| 3042 | $lightbox_key, |
| 3043 | array( |
| 3044 | 'href' => $link, |
| 3045 | 'data-rel' => $rel, |
| 3046 | ) |
| 3047 | ); |
| 3048 | } |
| 3049 | } |
| 3050 | |
| 3051 | if ( $play_icon_enabled ) { |
| 3052 | |
| 3053 | ?> |
| 3054 | <div> |
| 3055 | <a <?php $this->print_render_attribute_string( $lightbox_key ); ?>> |
| 3056 | <span class="premium-adv-carousel__video-icon"> |
| 3057 | <?php |
| 3058 | Icons_Manager::render_icon( $item['media_wheel_videos_icon'], array( 'aria-hidden' => 'true' ) ); |
| 3059 | ?> |
| 3060 | </span> |
| 3061 | </a> |
| 3062 | </div> |
| 3063 | <?php |
| 3064 | } |
| 3065 | |
| 3066 | if ( 'yes' !== $item['media_wheel_video_icon_switcher'] ) { |
| 3067 | ?> |
| 3068 | <div> |
| 3069 | <a <?php $this->print_render_attribute_string( $lightbox_key ); ?>> |
| 3070 | <span> |
| 3071 | <?php |
| 3072 | Icons_Manager::render_icon( $settings['media_lightbox_icon'], array( 'aria-hidden' => 'true' ) ); |
| 3073 | ?> |
| 3074 | </span> |
| 3075 | </a> |
| 3076 | </div> |
| 3077 | <?php |
| 3078 | } |
| 3079 | return; |
| 3080 | } |
| 3081 | |
| 3082 | if ( 'yes' !== $item['media_wheel_link_switcher'] ) { |
| 3083 | |
| 3084 | $this->add_render_attribute( |
| 3085 | $lightbox_key, |
| 3086 | array( |
| 3087 | 'class' => 'pa-media-magnific-image', |
| 3088 | 'href' => $href, |
| 3089 | ) |
| 3090 | ); |
| 3091 | |
| 3092 | if ( 'default' !== $lightbox_type ) { |
| 3093 | |
| 3094 | $this->add_render_attribute( |
| 3095 | $lightbox_key, |
| 3096 | array( |
| 3097 | 'data-elementor-open-lightbox' => $lightbox_type, |
| 3098 | 'data-elementor-lightbox-slideshow' => count( $settings['media_wheel_repeater'] ) > 1 ? $id : false, |
| 3099 | ) |
| 3100 | ); |
| 3101 | |
| 3102 | if ( 'yes' === $settings['lightbox_show_title'] ) { |
| 3103 | |
| 3104 | $this->add_render_attribute( $lightbox_key, 'data-elementor-lightbox-title', $alt ); |
| 3105 | |
| 3106 | } |
| 3107 | } else { |
| 3108 | |
| 3109 | $rel = sprintf( 'prettyPhoto[premium-media-%s]', $this->get_id() ); |
| 3110 | |
| 3111 | $this->add_render_attribute( |
| 3112 | $lightbox_key, |
| 3113 | array( |
| 3114 | 'data-rel' => $rel, |
| 3115 | ) |
| 3116 | ); |
| 3117 | |
| 3118 | } |
| 3119 | |
| 3120 | ?> |
| 3121 | |
| 3122 | <a <?php $this->print_render_attribute_string( $lightbox_key ); ?>> |
| 3123 | <span> |
| 3124 | <?php |
| 3125 | Icons_Manager::render_icon( $settings['media_lightbox_icon'], array( 'aria-hidden' => 'true' ) ); |
| 3126 | ?> |
| 3127 | </span> |
| 3128 | </a> |
| 3129 | <?php |
| 3130 | } |
| 3131 | } |
| 3132 | } |
| 3133 |