dep
1 month ago
premium-banner.php
3 weeks ago
premium-blog.php
3 weeks ago
premium-button.php
3 weeks ago
premium-carousel.php
3 weeks ago
premium-contactform.php
3 weeks ago
premium-countdown.php
3 weeks ago
premium-counter.php
3 weeks ago
premium-dual-header.php
3 weeks ago
premium-fancytext.php
3 weeks ago
premium-grid.php
3 weeks ago
premium-icon-list.php
3 weeks ago
premium-image-button.php
3 weeks ago
premium-image-scroll.php
3 weeks ago
premium-image-separator.php
3 weeks ago
premium-lottie.php
3 weeks ago
premium-maps.php
3 weeks ago
premium-media-wheel.php
3 weeks ago
premium-mobile-menu.php
3 weeks ago
premium-modalbox.php
3 weeks ago
premium-nav-menu.php
3 weeks ago
premium-notifications.php
3 weeks ago
premium-person.php
3 weeks ago
premium-pinterest-feed.php
3 weeks ago
premium-post-ticker.php
3 weeks ago
premium-pricing-table.php
3 weeks ago
premium-progressbar.php
3 weeks ago
premium-search-form.php
3 weeks ago
premium-svg-drawer.php
3 weeks ago
premium-tcloud.php
3 weeks ago
premium-testimonials.php
3 weeks ago
premium-textual-showcase.php
3 weeks ago
premium-tiktok-feed.php
3 weeks ago
premium-title.php
3 weeks ago
premium-videobox.php
3 weeks ago
premium-vscroll.php
3 weeks ago
premium-weather.php
3 weeks ago
premium-world-clock.php
3 weeks ago
premium-search-form.php
3413 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Premium Search Form. |
| 4 | */ |
| 5 | |
| 6 | namespace PremiumAddons\Widgets; |
| 7 | |
| 8 | // Elementor Classes. |
| 9 | use Elementor\Plugin; |
| 10 | use Elementor\Widget_Base; |
| 11 | use Elementor\Controls_Manager; |
| 12 | use Elementor\Icons_Manager; |
| 13 | use Elementor\Core\Kits\Documents\Tabs\Global_Colors; |
| 14 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 15 | use Elementor\Group_Control_Border; |
| 16 | use Elementor\Group_Control_Typography; |
| 17 | use PremiumAddons\Includes\Controls\Premium_Background; |
| 18 | use Elementor\Group_Control_Text_Shadow; |
| 19 | use Elementor\Group_Control_Box_Shadow; |
| 20 | use Elementor\Group_Control_Css_Filter; |
| 21 | |
| 22 | // PremiumAddons Classes. |
| 23 | use PremiumAddons\Includes\Premium_Template_Tags as Blog_Helper; |
| 24 | use PremiumAddons\Includes\Helper_Functions; |
| 25 | use PremiumAddons\Includes\Controls\Premium_Post_Filter; |
| 26 | use PremiumAddons\Includes\Controls\Premium_Tax_Filter; |
| 27 | |
| 28 | if ( ! defined( 'ABSPATH' ) ) { |
| 29 | exit; // If this file is called directly, abort. |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Class Premium_Search_Form |
| 34 | */ |
| 35 | class Premium_Search_Form extends Widget_Base { |
| 36 | |
| 37 | |
| 38 | /** |
| 39 | * Retrieve Widget Name. |
| 40 | * |
| 41 | * @since 1.0.0 |
| 42 | * @access public |
| 43 | */ |
| 44 | public function get_name() { |
| 45 | return 'premium-search-form'; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Retrieve Widget Title. |
| 50 | * |
| 51 | * @since 1.0.0 |
| 52 | * @access public |
| 53 | */ |
| 54 | public function get_title() { |
| 55 | return __( 'Search Form', 'premium-addons-for-elementor' ); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Retrieve Widget Icon. |
| 60 | * |
| 61 | * @since 1.0.0 |
| 62 | * @access public |
| 63 | * |
| 64 | * @return string widget icon. |
| 65 | */ |
| 66 | public function get_icon() { |
| 67 | return 'pa-search-form'; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Retrieve Widget Keywords. |
| 72 | * |
| 73 | * @since 1.0.0 |
| 74 | * @access public |
| 75 | * |
| 76 | * @return string Widget keywords. |
| 77 | */ |
| 78 | public function get_keywords() { |
| 79 | return array( 'pa', 'premium', 'premium search form', 'ajax' ); |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Retrieve Widget Categories. |
| 84 | * |
| 85 | * @since 1.5.1 |
| 86 | * @access public |
| 87 | * |
| 88 | * @return array Widget categories. |
| 89 | */ |
| 90 | public function get_categories() { |
| 91 | return array( 'premium-elements' ); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Retrieve Widget Dependent CSS. |
| 96 | * |
| 97 | * @since 1.0.0 |
| 98 | * @access public |
| 99 | * |
| 100 | * @return array CSS style handles. |
| 101 | */ |
| 102 | public function get_style_depends() { |
| 103 | return array( |
| 104 | 'pa-glass', |
| 105 | 'font-awesome-5-all', |
| 106 | 'pa-slick', |
| 107 | 'premium-addons', |
| 108 | ); |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * Retrieve Widget Dependent JS. |
| 113 | * |
| 114 | * @since 1.0.0 |
| 115 | * @access public |
| 116 | * |
| 117 | * @return array JS script handles. |
| 118 | */ |
| 119 | public function get_script_depends() { |
| 120 | |
| 121 | $is_edit = Helper_Functions::is_edit_mode(); |
| 122 | |
| 123 | $scripts = array(); |
| 124 | |
| 125 | if ( $is_edit ) { |
| 126 | |
| 127 | $scripts = array( 'pa-glass', 'pa-slick' ); |
| 128 | |
| 129 | } else { |
| 130 | $settings = $this->get_settings(); |
| 131 | |
| 132 | if ( 'none' !== $settings['post_lq_effect'] ) { |
| 133 | $scripts[] = 'pa-glass'; |
| 134 | } |
| 135 | |
| 136 | if ( 'yes' === $settings['carousel'] ) { |
| 137 | $scripts[] = 'pa-slick'; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | $scripts[] = 'premium-addons'; |
| 142 | |
| 143 | return $scripts; |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Retrieve Widget Support URL. |
| 148 | * |
| 149 | * @access public |
| 150 | * |
| 151 | * @return string support URL. |
| 152 | */ |
| 153 | public function get_custom_help_url() { |
| 154 | return 'https://premiumaddons.com/support/'; |
| 155 | } |
| 156 | |
| 157 | public function has_widget_inner_wrapper(): bool { |
| 158 | return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' ); |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * Register Search Form controls. |
| 163 | * |
| 164 | * @since 1.0.0 |
| 165 | * @access protected |
| 166 | */ |
| 167 | protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
| 168 | |
| 169 | $papro_activated = Helper_Functions::check_papro_version(); |
| 170 | |
| 171 | $this->start_controls_section( |
| 172 | 'query_section', |
| 173 | array( |
| 174 | 'label' => __( 'Query', 'premium-addons-for-elementor' ), |
| 175 | ) |
| 176 | ); |
| 177 | |
| 178 | $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-ajax-search-widget/', 'ajax-search', 'wp-editor', 'demo' ); |
| 179 | Helper_Functions::add_templates_controls( $this, 'ajax-search', $demo ); |
| 180 | |
| 181 | $this->add_control( |
| 182 | 'query_type', |
| 183 | array( |
| 184 | 'label' => __( 'Query Type', 'premium-addons-for-elementor' ), |
| 185 | 'type' => Controls_Manager::SELECT, |
| 186 | 'options' => array( |
| 187 | 'post' => __( 'Post Type (AJAX)', 'premium-addons-for-elementor' ), |
| 188 | 'elements' => apply_filters( 'pa_pro_label', __( 'Elements On Page (Pro)', 'premium-addons-for-elementor' ) ), |
| 189 | ), |
| 190 | 'default' => 'post', |
| 191 | 'label_block' => true, |
| 192 | ) |
| 193 | ); |
| 194 | |
| 195 | $this->add_control( |
| 196 | 'selector', |
| 197 | array( |
| 198 | 'label' => __( 'CSS Selector', 'premium-addons-for-elementor' ), |
| 199 | 'type' => Controls_Manager::TEXT, |
| 200 | 'description' => __( 'Add the CSS selector of the parent container that contains the queried elements.', 'premium-addons-for-elementor' ), |
| 201 | 'label_block' => true, |
| 202 | 'condition' => array( |
| 203 | 'query_type' => 'elements', |
| 204 | ), |
| 205 | 'ai' => array( |
| 206 | 'active' => false, |
| 207 | ), |
| 208 | ) |
| 209 | ); |
| 210 | |
| 211 | $this->add_control( |
| 212 | 'fadeout_selector', |
| 213 | array( |
| 214 | 'label' => __( 'Elements to Fade Out Selector', 'premium-addons-for-elementor' ), |
| 215 | 'type' => Controls_Manager::TEXT, |
| 216 | 'description' => __( 'Add the CSS selector of the elements to fade out.', 'premium-addons-for-elementor' ), |
| 217 | 'label_block' => true, |
| 218 | 'condition' => array( |
| 219 | 'query_type' => 'elements', |
| 220 | ), |
| 221 | 'ai' => array( |
| 222 | 'active' => false, |
| 223 | ), |
| 224 | ) |
| 225 | ); |
| 226 | |
| 227 | $this->add_control( |
| 228 | 'highlighted_text_color', |
| 229 | array( |
| 230 | 'label' => __( 'Highlighted Text Color', 'premium-addons-for-elementor' ), |
| 231 | 'type' => Controls_Manager::COLOR, |
| 232 | 'selectors' => array( |
| 233 | '.pa-highlighted-text-{{ID}}' => 'background-color: {{VALUE}};', |
| 234 | '{{WRAPPER}}' => '--pa-search-hightlight: {{VALUE}}', |
| 235 | ), |
| 236 | 'condition' => array( |
| 237 | 'query_type' => 'elements', |
| 238 | ), |
| 239 | ) |
| 240 | ); |
| 241 | |
| 242 | if ( ! $papro_activated ) { |
| 243 | |
| 244 | $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'search-widget', 'wp-editor', 'get-pro' ); |
| 245 | |
| 246 | $this->add_control( |
| 247 | 'query_notice', |
| 248 | array( |
| 249 | 'type' => Controls_Manager::RAW_HTML, |
| 250 | '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>', |
| 251 | 'content_classes' => 'papro-upgrade-notice', |
| 252 | 'condition' => array( |
| 253 | 'query_type' => 'elements', |
| 254 | ), |
| 255 | ) |
| 256 | ); |
| 257 | |
| 258 | } |
| 259 | |
| 260 | $post_types = Blog_Helper::get_posts_types(); |
| 261 | |
| 262 | $this->add_control( |
| 263 | 'custom_search_query', |
| 264 | array( |
| 265 | 'label' => __( 'Custom Search Query', 'premium-addons-for-elementor' ), |
| 266 | 'type' => Controls_Manager::SWITCHER, |
| 267 | 'condition' => array( |
| 268 | 'query_type' => 'post', |
| 269 | ), |
| 270 | ) |
| 271 | ); |
| 272 | |
| 273 | $this->add_control( |
| 274 | 'type_select', |
| 275 | array( |
| 276 | 'label' => __( 'Post Type Select', 'premium-addons-for-elementor' ), |
| 277 | 'type' => Controls_Manager::SWITCHER, |
| 278 | 'condition' => array( |
| 279 | 'query_type' => 'post', |
| 280 | 'custom_search_query!' => 'yes', |
| 281 | ), |
| 282 | ) |
| 283 | ); |
| 284 | |
| 285 | $this->add_control( |
| 286 | 'show_posts_number', |
| 287 | array( |
| 288 | 'label' => __( 'Show Posts Number', 'premium-addons-for-elementor' ), |
| 289 | 'type' => Controls_Manager::SWITCHER, |
| 290 | 'condition' => array( |
| 291 | 'query_type' => 'post', |
| 292 | 'type_select' => 'yes', |
| 293 | 'custom_search_query!' => 'yes', |
| 294 | ), |
| 295 | ) |
| 296 | ); |
| 297 | |
| 298 | $this->add_control( |
| 299 | 'post_types_excluded', |
| 300 | array( |
| 301 | 'label' => __( 'Excluded Post Types', 'premium-addons-for-elementor' ), |
| 302 | 'type' => Controls_Manager::SELECT2, |
| 303 | 'label_block' => true, |
| 304 | 'multiple' => true, |
| 305 | 'options' => $post_types, |
| 306 | 'default' => array(), |
| 307 | 'condition' => array( |
| 308 | 'query_type' => 'post', |
| 309 | 'type_select' => 'yes', |
| 310 | 'custom_search_query!' => 'yes', |
| 311 | ), |
| 312 | ) |
| 313 | ); |
| 314 | |
| 315 | $this->add_control( |
| 316 | 'select_field_position', |
| 317 | array( |
| 318 | 'label' => __( 'Select Field Position', 'premium-addons-for-elementor' ), |
| 319 | 'label_block' => true, |
| 320 | 'type' => Controls_Manager::SELECT, |
| 321 | 'options' => array( |
| 322 | 'after' => __( 'After Field', 'premium-addons-for-elementor' ), |
| 323 | 'before' => __( 'Before Field', 'premium-addons-for-elementor' ), |
| 324 | ), |
| 325 | 'default' => 'before', |
| 326 | 'prefix_class' => 'premium-search__select-', |
| 327 | 'condition' => array( |
| 328 | 'query_type' => 'post', |
| 329 | 'type_select' => 'yes', |
| 330 | 'custom_search_query!' => 'yes', |
| 331 | ), |
| 332 | ) |
| 333 | ); |
| 334 | |
| 335 | $this->add_control( |
| 336 | 'post_type_filter', |
| 337 | array( |
| 338 | 'label' => __( 'Source', 'premium-addons-for-elementor' ), |
| 339 | 'type' => Controls_Manager::SELECT, |
| 340 | 'label_block' => true, |
| 341 | 'options' => $post_types, |
| 342 | 'default' => 'post', |
| 343 | 'condition' => array( |
| 344 | 'custom_search_query' => 'yes', |
| 345 | 'query_type' => 'post', |
| 346 | ), |
| 347 | ) |
| 348 | ); |
| 349 | |
| 350 | $this->add_control( |
| 351 | 'search_in', |
| 352 | array( |
| 353 | 'label' => __( 'Search In', 'premium-addons-for-elementor' ), |
| 354 | 'label_block' => true, |
| 355 | 'type' => Controls_Manager::SELECT, |
| 356 | 'options' => array( |
| 357 | 'title' => __( 'Post Title', 'premium-addons-for-elementor' ), |
| 358 | 'description' => __( 'Post Description', 'premium-addons-for-elementor' ), |
| 359 | 'both' => __( 'Title & Description', 'premium-addons-for-elementor' ), |
| 360 | ), |
| 361 | 'default' => 'both', |
| 362 | 'condition' => array( |
| 363 | 'custom_search_query' => 'yes', |
| 364 | 'query_type' => 'post', |
| 365 | ), |
| 366 | ) |
| 367 | ); |
| 368 | |
| 369 | foreach ( $post_types as $key => $type ) { |
| 370 | |
| 371 | // Get all the taxonomies associated with the selected post type. |
| 372 | $taxonomy = Blog_Helper::get_taxnomies( $key ); |
| 373 | |
| 374 | if ( ! empty( $taxonomy ) ) { |
| 375 | |
| 376 | // Batch-fetch terms for all taxonomies of this post type in one query. |
| 377 | $all_terms = get_terms( |
| 378 | array( |
| 379 | 'taxonomy' => array_keys( $taxonomy ), |
| 380 | 'hide_empty' => false, |
| 381 | ) |
| 382 | ); |
| 383 | $terms_by_tax = array(); |
| 384 | if ( ! is_wp_error( $all_terms ) ) { |
| 385 | foreach ( $all_terms as $t ) { |
| 386 | $terms_by_tax[ $t->taxonomy ][] = $t; |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | // Get all taxonomy values under the taxonomy. |
| 391 | foreach ( $taxonomy as $index => $tax ) { |
| 392 | |
| 393 | $terms = isset( $terms_by_tax[ $index ] ) ? $terms_by_tax[ $index ] : array(); |
| 394 | |
| 395 | $related_tax = array(); |
| 396 | |
| 397 | if ( ! empty( $terms ) ) { |
| 398 | |
| 399 | foreach ( $terms as $t_index => $t_obj ) { |
| 400 | |
| 401 | $related_tax[ $t_obj->slug ] = $t_obj->name; |
| 402 | } |
| 403 | |
| 404 | // Add filter rule for the each taxonomy. |
| 405 | $this->add_control( |
| 406 | $index . '_' . $key . '_filter_rule', |
| 407 | array( |
| 408 | /* translators: %s Taxnomy Label */ |
| 409 | 'label' => sprintf( __( '%s Filter Rule', 'premium-addons-for-elementor' ), $tax->label ), |
| 410 | 'type' => Controls_Manager::SELECT, |
| 411 | 'default' => 'IN', |
| 412 | 'label_block' => true, |
| 413 | 'options' => array( |
| 414 | /* translators: %s: Taxnomy Label */ |
| 415 | 'IN' => sprintf( __( 'Match %s', 'premium-addons-for-elementor' ), $tax->label ), |
| 416 | /* translators: %s: Taxnomy Label */ |
| 417 | 'NOT IN' => sprintf( __( 'Exclude %s', 'premium-addons-for-elementor' ), $tax->label ), |
| 418 | ), |
| 419 | 'condition' => array( |
| 420 | 'query_type' => 'post', |
| 421 | 'custom_search_query' => 'yes', |
| 422 | 'post_type_filter' => $key, |
| 423 | ), |
| 424 | ) |
| 425 | ); |
| 426 | |
| 427 | // Add select control for each taxonomy. |
| 428 | $this->add_control( |
| 429 | 'tax_' . $index . '_' . $key . '_filter', |
| 430 | array( |
| 431 | /* translators: %s Taxnomy Label */ |
| 432 | 'label' => sprintf( __( '%s Filter', 'premium-addons-for-elementor' ), $tax->label ), |
| 433 | 'type' => Controls_Manager::SELECT2, |
| 434 | 'default' => '', |
| 435 | 'multiple' => true, |
| 436 | 'label_block' => true, |
| 437 | 'options' => $related_tax, |
| 438 | 'condition' => array( |
| 439 | 'query_type' => 'post', |
| 440 | 'custom_search_query' => 'yes', |
| 441 | 'post_type_filter' => $key, |
| 442 | ), |
| 443 | 'separator' => 'after', |
| 444 | ) |
| 445 | ); |
| 446 | |
| 447 | } |
| 448 | } |
| 449 | } |
| 450 | } |
| 451 | |
| 452 | $this->add_control( |
| 453 | 'author_filter_rule', |
| 454 | array( |
| 455 | 'label' => __( 'Filter By Author Rule', 'premium-addons-for-elementor' ), |
| 456 | 'type' => Controls_Manager::SELECT, |
| 457 | 'options' => array( |
| 458 | 'author__in' => __( 'Match Authors', 'premium-addons-for-elementor' ), |
| 459 | 'author__not_in' => __( 'Exclude Authors', 'premium-addons-for-elementor' ), |
| 460 | ), |
| 461 | 'default' => 'author__in', |
| 462 | 'separator' => 'before', |
| 463 | 'label_block' => true, |
| 464 | 'condition' => array( |
| 465 | 'query_type' => 'post', |
| 466 | 'custom_search_query' => 'yes', |
| 467 | ), |
| 468 | ) |
| 469 | ); |
| 470 | |
| 471 | $this->add_control( |
| 472 | 'premium_blog_users', |
| 473 | array( |
| 474 | 'label' => __( 'Authors', 'premium-addons-for-elementor' ), |
| 475 | 'type' => Controls_Manager::SELECT2, |
| 476 | 'options' => Blog_Helper::get_authors(), |
| 477 | 'label_block' => true, |
| 478 | 'multiple' => true, |
| 479 | 'condition' => array( |
| 480 | 'query_type' => 'post', |
| 481 | 'custom_search_query' => 'yes', |
| 482 | ), |
| 483 | ) |
| 484 | ); |
| 485 | |
| 486 | $this->add_control( |
| 487 | 'posts_filter_rule', |
| 488 | array( |
| 489 | 'label' => __( 'Filter By Post Rule', 'premium-addons-for-elementor' ), |
| 490 | 'type' => Controls_Manager::SELECT, |
| 491 | 'options' => array( |
| 492 | 'post__in' => __( 'Match Post', 'premium-addons-for-elementor' ), |
| 493 | 'post__not_in' => __( 'Exclude Post', 'premium-addons-for-elementor' ), |
| 494 | ), |
| 495 | 'default' => 'post__not_in', |
| 496 | 'separator' => 'before', |
| 497 | 'label_block' => true, |
| 498 | 'condition' => array( |
| 499 | 'query_type' => 'post', |
| 500 | 'custom_search_query' => 'yes', |
| 501 | ), |
| 502 | ) |
| 503 | ); |
| 504 | |
| 505 | $this->add_control( |
| 506 | 'premium_blog_posts_exclude', |
| 507 | array( |
| 508 | 'label' => __( 'Posts', 'premium-addons-for-elementor' ), |
| 509 | 'type' => Premium_Post_Filter::TYPE, |
| 510 | 'label_block' => true, |
| 511 | 'multiple' => true, |
| 512 | 'source' => 'post', |
| 513 | 'condition' => array( |
| 514 | 'post_type_filter' => 'post', |
| 515 | 'query_type' => 'post', |
| 516 | 'custom_search_query' => 'yes', |
| 517 | ), |
| 518 | ) |
| 519 | ); |
| 520 | |
| 521 | $this->add_control( |
| 522 | 'custom_posts_filter', |
| 523 | array( |
| 524 | 'label' => __( 'Posts', 'premium-addons-for-elementor' ), |
| 525 | 'type' => Premium_Post_Filter::TYPE, |
| 526 | 'render_type' => 'template', |
| 527 | 'label_block' => true, |
| 528 | 'multiple' => true, |
| 529 | 'frontend_available' => true, |
| 530 | 'condition' => array( |
| 531 | 'post_type_filter!' => 'post', |
| 532 | 'query_type' => 'post', |
| 533 | 'custom_search_query' => 'yes', |
| 534 | ), |
| 535 | |
| 536 | ) |
| 537 | ); |
| 538 | |
| 539 | $this->add_control( |
| 540 | 'premium_blog_number_of_posts', |
| 541 | array( |
| 542 | 'label' => __( 'Posts Per Page', 'premium-addons-for-elementor' ), |
| 543 | 'description' => __( 'Set the number of per page', 'premium-addons-for-elementor' ), |
| 544 | 'type' => Controls_Manager::NUMBER, |
| 545 | 'min' => 1, |
| 546 | 'default' => 4, |
| 547 | 'condition' => array( |
| 548 | 'query_type' => 'post', |
| 549 | ), |
| 550 | ) |
| 551 | ); |
| 552 | |
| 553 | $this->add_control( |
| 554 | 'show_results_number', |
| 555 | array( |
| 556 | 'label' => __( 'Show Results Number', 'premium-addons-for-elementor' ), |
| 557 | 'type' => Controls_Manager::SWITCHER, |
| 558 | 'condition' => array( |
| 559 | 'query_type' => 'post', |
| 560 | ), |
| 561 | ) |
| 562 | ); |
| 563 | |
| 564 | $this->add_control( |
| 565 | 'results_number_text', |
| 566 | array( |
| 567 | 'label' => __( 'Results Number Text', 'premium-addons-for-elementor' ), |
| 568 | 'type' => Controls_Manager::TEXT, |
| 569 | 'default' => 'Results: {{number}}', |
| 570 | 'description' => __( 'This helps to control number of results string. {{number}} will be repalced with the number of results', 'premium-addons-for-elementor' ), |
| 571 | 'condition' => array( |
| 572 | 'query_type' => 'post', |
| 573 | 'show_results_number' => 'yes', |
| 574 | ), |
| 575 | ) |
| 576 | ); |
| 577 | |
| 578 | $this->add_control( |
| 579 | 'premium_blog_order_by', |
| 580 | array( |
| 581 | 'label' => __( 'Order By', 'premium-addons-for-elementor' ), |
| 582 | 'type' => Controls_Manager::SELECT, |
| 583 | 'label_block' => true, |
| 584 | 'options' => array( |
| 585 | 'none' => __( 'None', 'premium-addons-for-elementor' ), |
| 586 | 'ID' => __( 'ID', 'premium-addons-for-elementor' ), |
| 587 | 'author' => __( 'Author', 'premium-addons-for-elementor' ), |
| 588 | 'title' => __( 'Title', 'premium-addons-for-elementor' ), |
| 589 | 'name' => __( 'Name', 'premium-addons-for-elementor' ), |
| 590 | 'date' => __( 'Date', 'premium-addons-for-elementor' ), |
| 591 | 'modified' => __( 'Last Modified', 'premium-addons-for-elementor' ), |
| 592 | 'rand' => __( 'Random', 'premium-addons-for-elementor' ), |
| 593 | 'menu_order' => __( 'Menu Order', 'premium-addons-for-elementor' ), |
| 594 | 'comment_count' => __( 'Number of Comments', 'premium-addons-for-elementor' ), |
| 595 | ), |
| 596 | 'default' => 'date', |
| 597 | 'condition' => array( |
| 598 | 'query_type' => 'post', |
| 599 | ), |
| 600 | ) |
| 601 | ); |
| 602 | |
| 603 | $this->add_control( |
| 604 | 'premium_blog_order', |
| 605 | array( |
| 606 | 'label' => __( 'Order', 'premium-addons-for-elementor' ), |
| 607 | 'type' => Controls_Manager::SELECT, |
| 608 | 'label_block' => true, |
| 609 | 'options' => array( |
| 610 | 'DESC' => __( 'Descending', 'premium-addons-for-elementor' ), |
| 611 | 'ASC' => __( 'Ascending', 'premium-addons-for-elementor' ), |
| 612 | ), |
| 613 | 'default' => 'DESC', |
| 614 | 'condition' => array( |
| 615 | 'query_type' => 'post', |
| 616 | ), |
| 617 | ) |
| 618 | ); |
| 619 | |
| 620 | $this->add_control( |
| 621 | 'empty_query_text', |
| 622 | array( |
| 623 | 'label' => __( 'Empty Query Text', 'premium-addons-for-elementor' ), |
| 624 | 'type' => Controls_Manager::TEXT, |
| 625 | 'label_block' => true, |
| 626 | 'condition' => array( |
| 627 | 'query_type' => 'post', |
| 628 | ), |
| 629 | ) |
| 630 | ); |
| 631 | |
| 632 | $this->end_controls_section(); |
| 633 | |
| 634 | $this->start_controls_section( |
| 635 | 'search_section', |
| 636 | array( |
| 637 | 'label' => __( 'Search Field', 'premium-addons-for-elementor' ), |
| 638 | ) |
| 639 | ); |
| 640 | |
| 641 | $this->add_responsive_control( |
| 642 | 'search_width', |
| 643 | array( |
| 644 | 'label' => __( 'Width', 'premium-addons-for-elementor' ), |
| 645 | 'type' => Controls_Manager::SLIDER, |
| 646 | 'size_units' => array( 'px', 'em', '%', 'custom' ), |
| 647 | 'range' => array( |
| 648 | 'px' => array( |
| 649 | 'min' => 1, |
| 650 | 'max' => 500, |
| 651 | ), |
| 652 | 'em' => array( |
| 653 | 'min' => 1, |
| 654 | 'max' => 30, |
| 655 | ), |
| 656 | ), |
| 657 | 'selectors' => array( |
| 658 | '{{WRAPPER}} .premium-search__input-wrap' => 'width: {{SIZE}}{{UNIT}}', |
| 659 | ), |
| 660 | ) |
| 661 | ); |
| 662 | |
| 663 | $this->add_responsive_control( |
| 664 | 'search_height', |
| 665 | array( |
| 666 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 667 | 'type' => Controls_Manager::SLIDER, |
| 668 | 'size_units' => array( 'px', 'em', 'custom' ), |
| 669 | 'selectors' => array( |
| 670 | '{{WRAPPER}} .premium-search__input-wrap' => 'height: {{SIZE}}{{UNIT}}', |
| 671 | ), |
| 672 | ) |
| 673 | ); |
| 674 | |
| 675 | $this->add_control( |
| 676 | 'show_label', |
| 677 | array( |
| 678 | 'label' => __( 'Show Label', 'premium-addons-for-elementor' ), |
| 679 | 'type' => Controls_Manager::SWITCHER, |
| 680 | 'conditions' => array( |
| 681 | 'relation' => 'or', |
| 682 | 'terms' => array( |
| 683 | array( |
| 684 | 'name' => 'type_select', |
| 685 | 'operator' => '!==', |
| 686 | 'value' => 'yes', |
| 687 | ), |
| 688 | array( |
| 689 | 'terms' => array( |
| 690 | array( |
| 691 | 'name' => 'type_select', |
| 692 | 'value' => 'yes', |
| 693 | ), |
| 694 | array( |
| 695 | 'name' => 'select_field_position', |
| 696 | 'value' => 'after', |
| 697 | ), |
| 698 | ), |
| 699 | ), |
| 700 | ), |
| 701 | ), |
| 702 | ) |
| 703 | ); |
| 704 | |
| 705 | $this->add_control( |
| 706 | 'label_text', |
| 707 | array( |
| 708 | 'label' => __( 'Label Text', 'premium-addons-for-elementor' ), |
| 709 | 'type' => Controls_Manager::TEXT, |
| 710 | 'default' => __( 'Search Field', 'premium-addons-for-elementor' ), |
| 711 | 'label_block' => true, |
| 712 | 'conditions' => array( |
| 713 | 'terms' => array( |
| 714 | array( |
| 715 | 'name' => 'show_label', |
| 716 | 'value' => 'yes', |
| 717 | ), |
| 718 | array( |
| 719 | 'relation' => 'or', |
| 720 | 'terms' => array( |
| 721 | array( |
| 722 | 'name' => 'type_select', |
| 723 | 'operator' => '!==', |
| 724 | 'value' => 'yes', |
| 725 | ), |
| 726 | array( |
| 727 | 'terms' => array( |
| 728 | array( |
| 729 | 'name' => 'type_select', |
| 730 | 'value' => 'yes', |
| 731 | ), |
| 732 | array( |
| 733 | 'name' => 'select_field_position', |
| 734 | 'value' => 'after', |
| 735 | ), |
| 736 | ), |
| 737 | ), |
| 738 | ), |
| 739 | ), |
| 740 | ), |
| 741 | ), |
| 742 | ) |
| 743 | ); |
| 744 | |
| 745 | $this->add_control( |
| 746 | 'placeholder_text', |
| 747 | array( |
| 748 | 'label' => __( 'Placeholder Text', 'premium-addons-for-elementor' ), |
| 749 | 'type' => Controls_Manager::TEXT, |
| 750 | 'default' => __( 'Looking for?', 'premium-addons-for-elementor' ), |
| 751 | 'label_block' => true, |
| 752 | ) |
| 753 | ); |
| 754 | |
| 755 | $this->add_control( |
| 756 | 'field_effects', |
| 757 | array( |
| 758 | 'label' => __( 'Fields Focus Effect', 'premium-addons-for-elementor' ), |
| 759 | 'type' => Controls_Manager::SELECT, |
| 760 | 'default' => '', |
| 761 | 'options' => array( |
| 762 | '' => __( 'None', 'premium-addons-for-elementor' ), |
| 763 | 'label' => apply_filters( 'pa_pro_label', __( 'Label Position (Pro)', 'premium-addons-for-elementor' ) ), |
| 764 | 'label-letter' => apply_filters( 'pa_pro_label', __( 'Label Letter Spacing (Pro)', 'premium-addons-for-elementor' ) ), |
| 765 | 'label-pos-back' => apply_filters( 'pa_pro_label', __( 'Label Position + Background (Pro)', 'premium-addons-for-elementor' ) ), |
| 766 | 'css-filters' => apply_filters( 'pa_pro_label', __( 'Label CSS Filters (Pro)', 'premium-addons-for-elementor' ) ), |
| 767 | ), |
| 768 | 'prefix_class' => 'premium-search-anim-', |
| 769 | 'label_block' => true, |
| 770 | 'conditions' => array( |
| 771 | 'terms' => array( |
| 772 | array( |
| 773 | 'name' => 'show_label', |
| 774 | 'value' => 'yes', |
| 775 | ), |
| 776 | array( |
| 777 | 'relation' => 'or', |
| 778 | 'terms' => array( |
| 779 | array( |
| 780 | 'name' => 'type_select', |
| 781 | 'operator' => '!==', |
| 782 | 'value' => 'yes', |
| 783 | ), |
| 784 | array( |
| 785 | 'terms' => array( |
| 786 | array( |
| 787 | 'name' => 'type_select', |
| 788 | 'value' => 'yes', |
| 789 | ), |
| 790 | array( |
| 791 | 'name' => 'select_field_position', |
| 792 | 'value' => 'after', |
| 793 | ), |
| 794 | ), |
| 795 | ), |
| 796 | ), |
| 797 | ), |
| 798 | ), |
| 799 | ), |
| 800 | ) |
| 801 | ); |
| 802 | |
| 803 | if ( $papro_activated ) { |
| 804 | do_action( 'pa_search_effects_options', $this ); |
| 805 | } |
| 806 | |
| 807 | $this->end_controls_section(); |
| 808 | |
| 809 | $this->start_controls_section( |
| 810 | 'search_button_section', |
| 811 | array( |
| 812 | 'label' => __( 'Search Button', 'premium-addons-for-elementor' ), |
| 813 | ) |
| 814 | ); |
| 815 | |
| 816 | $this->add_control( |
| 817 | 'search_button', |
| 818 | array( |
| 819 | 'label' => __( 'Search Button', 'premium-addons-for-elementor' ), |
| 820 | 'type' => Controls_Manager::SWITCHER, |
| 821 | ) |
| 822 | ); |
| 823 | |
| 824 | $this->add_responsive_control( |
| 825 | 'button_width', |
| 826 | array( |
| 827 | 'label' => __( 'Width', 'premium-addons-for-elementor' ), |
| 828 | 'type' => Controls_Manager::SLIDER, |
| 829 | 'size_units' => array( 'px', 'em', '%', 'custom' ), |
| 830 | 'range' => array( |
| 831 | 'px' => array( |
| 832 | 'min' => 1, |
| 833 | 'max' => 500, |
| 834 | ), |
| 835 | 'em' => array( |
| 836 | 'min' => 1, |
| 837 | 'max' => 30, |
| 838 | ), |
| 839 | ), |
| 840 | 'condition' => array( |
| 841 | 'search_button' => 'yes', |
| 842 | ), |
| 843 | 'selectors' => array( |
| 844 | '{{WRAPPER}} .premium-search__btn-wrap' => 'width: {{SIZE}}{{UNIT}}', |
| 845 | ), |
| 846 | ) |
| 847 | ); |
| 848 | |
| 849 | $this->add_control( |
| 850 | 'button_action', |
| 851 | array( |
| 852 | 'label' => __( 'Action', 'premium-addons-for-elementor' ), |
| 853 | 'type' => Controls_Manager::SELECT, |
| 854 | 'options' => array( |
| 855 | 'onpage' => __( 'On Page Search', 'premium-addons-for-elementor' ), |
| 856 | 'redirect' => __( 'Go to Search Page', 'premium-addons-for-elementor' ), |
| 857 | ), |
| 858 | 'default' => 'onpage', |
| 859 | 'label_block' => true, |
| 860 | 'condition' => array( |
| 861 | 'search_button' => 'yes', |
| 862 | 'query_type' => 'post', |
| 863 | ), |
| 864 | ) |
| 865 | ); |
| 866 | |
| 867 | $this->add_control( |
| 868 | 'search_page_link', |
| 869 | array( |
| 870 | 'label' => __( 'Search Page Link', 'premium-addons-for-elementor' ), |
| 871 | 'type' => Controls_Manager::TEXT, |
| 872 | 'label_block' => true, |
| 873 | 'condition' => array( |
| 874 | 'query_type' => 'post', |
| 875 | 'search_button' => 'yes', |
| 876 | 'button_action' => 'redirect', |
| 877 | ), |
| 878 | 'ai' => array( |
| 879 | 'active' => false, |
| 880 | ), |
| 881 | ) |
| 882 | ); |
| 883 | |
| 884 | $this->add_control( |
| 885 | 'button_text', |
| 886 | array( |
| 887 | 'label' => __( 'Text', 'premium-addons-for-elementor' ), |
| 888 | 'type' => Controls_Manager::TEXT, |
| 889 | 'default' => __( 'Find', 'premium-addons-for-elementor' ), |
| 890 | 'separator' => 'before', |
| 891 | 'label_block' => true, |
| 892 | 'condition' => array( |
| 893 | 'search_button' => 'yes', |
| 894 | ), |
| 895 | ) |
| 896 | ); |
| 897 | |
| 898 | $this->add_control( |
| 899 | 'search_icon', |
| 900 | array( |
| 901 | 'label' => __( 'Search Icon', 'premium-addons-for-elementor' ), |
| 902 | 'type' => Controls_Manager::SWITCHER, |
| 903 | 'condition' => array( |
| 904 | 'search_button' => 'yes', |
| 905 | ), |
| 906 | ) |
| 907 | ); |
| 908 | |
| 909 | $this->add_control( |
| 910 | 'search_icon_select', |
| 911 | array( |
| 912 | 'label' => __( 'Select Icon', 'premium-addons-for-elementor' ), |
| 913 | 'type' => Controls_Manager::ICONS, |
| 914 | 'default' => array( |
| 915 | 'value' => 'fas fa-search', |
| 916 | 'library' => 'fa-solid', |
| 917 | ), |
| 918 | 'recommended' => array( |
| 919 | 'fa-solid' => array( |
| 920 | 'search', |
| 921 | 'search-dollar', |
| 922 | 'search-location', |
| 923 | 'search-plus', |
| 924 | ), |
| 925 | ), |
| 926 | // 'exclude_inline_options' => array( 'svg' ), |
| 927 | 'condition' => array( |
| 928 | 'search_button' => 'yes', |
| 929 | 'search_icon' => 'yes', |
| 930 | ), |
| 931 | ) |
| 932 | ); |
| 933 | |
| 934 | $this->add_control( |
| 935 | 'icon_position', |
| 936 | array( |
| 937 | 'label' => __( 'Icon Position', 'premium-addons-for-elementor' ), |
| 938 | 'type' => Controls_Manager::CHOOSE, |
| 939 | 'options' => array( |
| 940 | 'row' => array( |
| 941 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 942 | 'icon' => 'eicon-arrow-left', |
| 943 | ), |
| 944 | 'row-reverse' => array( |
| 945 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 946 | 'icon' => 'eicon-arrow-right', |
| 947 | ), |
| 948 | ), |
| 949 | 'default' => 'row-reverse', |
| 950 | 'toggle' => false, |
| 951 | 'condition' => array( |
| 952 | 'search_button' => 'yes', |
| 953 | 'search_icon' => 'yes', |
| 954 | ), |
| 955 | 'selectors' => array( |
| 956 | '{{WRAPPER}} .premium-search__btn' => 'flex-direction:{{VALUE}}', |
| 957 | ), |
| 958 | ) |
| 959 | ); |
| 960 | |
| 961 | $this->add_responsive_control( |
| 962 | 'icon_size', |
| 963 | array( |
| 964 | 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ), |
| 965 | 'type' => Controls_Manager::SLIDER, |
| 966 | 'condition' => array( |
| 967 | 'search_button' => 'yes', |
| 968 | 'search_icon' => 'yes', |
| 969 | ), |
| 970 | 'selectors' => array( |
| 971 | '{{WRAPPER}} .premium-search__btn svg' => 'width: {{SIZE}}px !important; height: {{SIZE}}px !important', |
| 972 | '{{WRAPPER}} .premium-search__btn i' => 'font-size: {{SIZE}}px', |
| 973 | ), |
| 974 | ) |
| 975 | ); |
| 976 | |
| 977 | $this->add_responsive_control( |
| 978 | 'icon_spacing', |
| 979 | array( |
| 980 | 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ), |
| 981 | 'type' => Controls_Manager::SLIDER, |
| 982 | 'size_units' => array( 'px', 'em' ), |
| 983 | 'selectors' => array( |
| 984 | '{{WRAPPER}} .premium-search__btn' => 'column-gap: {{SIZE}}{{UNIT}};', |
| 985 | ), |
| 986 | 'default' => array( |
| 987 | 'size' => 10, |
| 988 | 'unit' => 'px', |
| 989 | ), |
| 990 | 'condition' => array( |
| 991 | 'search_button' => 'yes', |
| 992 | 'search_icon' => 'yes', |
| 993 | ), |
| 994 | ) |
| 995 | ); |
| 996 | |
| 997 | $this->add_control( |
| 998 | 'button_position', |
| 999 | array( |
| 1000 | 'label' => __( 'Button Position', 'premium-addons-for-elementor' ), |
| 1001 | 'label_block' => true, |
| 1002 | 'type' => Controls_Manager::SELECT, |
| 1003 | 'options' => array( |
| 1004 | 'row-reverse' => __( 'Before Input Field', 'premium-addons-for-elementor' ), |
| 1005 | 'row' => __( 'After Input Field', 'premium-addons-for-elementor' ), |
| 1006 | ), |
| 1007 | 'default' => 'row', |
| 1008 | 'selectors' => array( |
| 1009 | '{{WRAPPER}} .premium-search__input-btn-wrap' => 'flex-direction: {{VALUE}}', |
| 1010 | ), |
| 1011 | 'condition' => array( |
| 1012 | 'search_button' => 'yes', |
| 1013 | ), |
| 1014 | ) |
| 1015 | ); |
| 1016 | |
| 1017 | $this->end_controls_section(); |
| 1018 | |
| 1019 | $this->start_controls_section( |
| 1020 | 'display_options_section', |
| 1021 | array( |
| 1022 | 'label' => __( 'Display Options', 'premium-addons-for-elementor' ), |
| 1023 | 'condition' => array( |
| 1024 | 'query_type' => 'post', |
| 1025 | ), |
| 1026 | ) |
| 1027 | ); |
| 1028 | |
| 1029 | $this->add_control( |
| 1030 | 'hide_on_click', |
| 1031 | array( |
| 1032 | 'label' => __( 'Hide Results on Click Outside', 'premium-addons-for-elementor' ), |
| 1033 | 'type' => Controls_Manager::SWITCHER, |
| 1034 | 'default' => 'yes', |
| 1035 | 'condition' => array( |
| 1036 | 'query_type' => 'post', |
| 1037 | ), |
| 1038 | ) |
| 1039 | ); |
| 1040 | |
| 1041 | $this->add_control( |
| 1042 | 'skin', |
| 1043 | array( |
| 1044 | 'label' => __( 'Skin', 'premium-addons-for-elementor' ), |
| 1045 | 'type' => Controls_Manager::SELECT, |
| 1046 | 'options' => array( |
| 1047 | 'classic' => __( 'Classic', 'premium-addons-for-elementor' ), |
| 1048 | 'side' => __( 'On Side', 'premium-addons-for-elementor' ), |
| 1049 | 'banner' => __( 'Banner', 'premium-addons-for-elementor' ), |
| 1050 | ), |
| 1051 | 'default' => 'classic', |
| 1052 | 'label_block' => true, |
| 1053 | ) |
| 1054 | ); |
| 1055 | |
| 1056 | $this->add_control( |
| 1057 | 'image_notice', |
| 1058 | array( |
| 1059 | 'raw' => __( 'You need to set the Width control value for this skin from style tab -> Thumbnail', 'premium-addons-for-elementor' ), |
| 1060 | 'type' => Controls_Manager::RAW_HTML, |
| 1061 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', |
| 1062 | 'condition' => array( |
| 1063 | 'skin' => 'side', |
| 1064 | ), |
| 1065 | ) |
| 1066 | ); |
| 1067 | |
| 1068 | $this->add_control( |
| 1069 | 'banner_notice', |
| 1070 | array( |
| 1071 | 'raw' => __( 'Please note that Banner skin requires posts to have featured images added for them.', 'premium-addons-for-elementor' ), |
| 1072 | 'type' => Controls_Manager::RAW_HTML, |
| 1073 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', |
| 1074 | 'condition' => array( |
| 1075 | 'skin' => 'banner', |
| 1076 | ), |
| 1077 | ) |
| 1078 | ); |
| 1079 | |
| 1080 | $this->add_responsive_control( |
| 1081 | 'columns_number', |
| 1082 | array( |
| 1083 | 'label' => __( 'Number of Columns', 'premium-addons-for-elementor' ), |
| 1084 | 'type' => Controls_Manager::SELECT, |
| 1085 | 'options' => array( |
| 1086 | '100%' => __( '1 Column', 'premium-addons-for-elementor' ), |
| 1087 | '50%' => __( '2 Columns', 'premium-addons-for-elementor' ), |
| 1088 | '33.33%' => __( '3 Columns', 'premium-addons-for-elementor' ), |
| 1089 | '25%' => __( '4 Columns', 'premium-addons-for-elementor' ), |
| 1090 | '20%' => __( '5 Columns', 'premium-addons-for-elementor' ), |
| 1091 | '16.66%' => __( '6 Columns', 'premium-addons-for-elementor' ), |
| 1092 | ), |
| 1093 | 'default' => '50%', |
| 1094 | 'tablet_default' => '50%', |
| 1095 | 'mobile_default' => '100%', |
| 1096 | 'render_type' => 'template', |
| 1097 | 'label_block' => true, |
| 1098 | 'selectors' => array( |
| 1099 | '{{WRAPPER}} .premium-search__post-wrap' => 'width: {{VALUE}}', |
| 1100 | '{{WRAPPER}}' => '--pa-search-carousel-slides: {{VALUE}}', |
| 1101 | ), |
| 1102 | ) |
| 1103 | ); |
| 1104 | |
| 1105 | $this->add_responsive_control( |
| 1106 | 'columns_spacing', |
| 1107 | array( |
| 1108 | 'label' => __( 'Columns Spacing', 'premium-addons-for-elementor' ), |
| 1109 | 'type' => Controls_Manager::SLIDER, |
| 1110 | 'default' => array( |
| 1111 | 'size' => 10, |
| 1112 | ), |
| 1113 | 'range' => array( |
| 1114 | 'px' => array( |
| 1115 | 'min' => 0, |
| 1116 | 'max' => 50, |
| 1117 | ), |
| 1118 | ), |
| 1119 | 'selectors' => array( |
| 1120 | '{{WRAPPER}} .premium-search__posts-wrap' => 'margin-left: calc( -{{SIZE}}{{UNIT}}/2 ); margin-right: calc( -{{SIZE}}{{UNIT}}/2 );', |
| 1121 | '{{WRAPPER}} .premium-search__post-wrap' => 'padding-right: calc( {{SIZE}}{{UNIT}}/2 ); padding-left: calc( {{SIZE}}{{UNIT}}/2 )', |
| 1122 | ), |
| 1123 | ) |
| 1124 | ); |
| 1125 | |
| 1126 | $this->add_responsive_control( |
| 1127 | 'row_spacing', |
| 1128 | array( |
| 1129 | 'label' => __( 'Rows Spacing', 'premium-addons-for-elementor' ), |
| 1130 | 'type' => Controls_Manager::SLIDER, |
| 1131 | 'size_units' => array( 'px', '%', 'em' ), |
| 1132 | 'range' => array( |
| 1133 | 'px' => array( |
| 1134 | 'min' => 1, |
| 1135 | 'max' => 200, |
| 1136 | ), |
| 1137 | ), |
| 1138 | 'default' => array( |
| 1139 | 'size' => 10, |
| 1140 | 'unit' => 'px', |
| 1141 | ), |
| 1142 | 'selectors' => array( |
| 1143 | '{{WRAPPER}} .premium-search__post-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}}', |
| 1144 | ), |
| 1145 | ) |
| 1146 | ); |
| 1147 | |
| 1148 | $this->add_control( |
| 1149 | 'show_post_thumbnail', |
| 1150 | array( |
| 1151 | 'label' => __( 'Show Thumbnail', 'premium-addons-for-elementor' ), |
| 1152 | 'type' => Controls_Manager::SWITCHER, |
| 1153 | 'default' => 'yes', |
| 1154 | ) |
| 1155 | ); |
| 1156 | |
| 1157 | $this->add_control( |
| 1158 | 'premium_blog_title_tag', |
| 1159 | array( |
| 1160 | 'label' => __( 'Title HTML Tag', 'premium-addons-for-elementor' ), |
| 1161 | 'type' => Controls_Manager::SELECT, |
| 1162 | 'options' => array( |
| 1163 | 'h1' => 'H1', |
| 1164 | 'h2' => 'H2', |
| 1165 | 'h3' => 'H3', |
| 1166 | 'h4' => 'H4', |
| 1167 | 'h5' => 'H5', |
| 1168 | 'h6' => 'H6', |
| 1169 | 'div' => 'div', |
| 1170 | 'span' => 'span', |
| 1171 | 'p' => 'p', |
| 1172 | ), |
| 1173 | 'default' => 'h2', |
| 1174 | 'label_block' => true, |
| 1175 | ) |
| 1176 | ); |
| 1177 | |
| 1178 | $this->add_control( |
| 1179 | 'show_excerpt', |
| 1180 | array( |
| 1181 | 'label' => __( 'Show Excerpt', 'premium-addons-for-elementor' ), |
| 1182 | 'type' => Controls_Manager::SWITCHER, |
| 1183 | 'default' => 'yes', |
| 1184 | ) |
| 1185 | ); |
| 1186 | |
| 1187 | $this->add_control( |
| 1188 | 'excerpt_length', |
| 1189 | array( |
| 1190 | 'label' => __( 'Excerpt Length', 'premium-addons-for-elementor' ), |
| 1191 | 'type' => Controls_Manager::NUMBER, |
| 1192 | 'default' => 22, |
| 1193 | 'condition' => array( |
| 1194 | 'show_excerpt' => 'yes', |
| 1195 | ), |
| 1196 | ) |
| 1197 | ); |
| 1198 | |
| 1199 | $this->add_control( |
| 1200 | 'excerpt_length_apply', |
| 1201 | array( |
| 1202 | 'label' => __( 'Apply On Posts With Excerpt Set', 'premium-addons-for-elementor' ), |
| 1203 | 'description' => __( 'Enable this option if you want the excerpt length to be also applied on posts with the Excerpt field set.', 'premium-addons-for-elementor' ), |
| 1204 | 'type' => Controls_Manager::SWITCHER, |
| 1205 | 'condition' => array( |
| 1206 | 'show_excerpt' => 'yes', |
| 1207 | ), |
| 1208 | ) |
| 1209 | ); |
| 1210 | |
| 1211 | $this->add_control( |
| 1212 | 'excerpt_type', |
| 1213 | array( |
| 1214 | 'label' => __( 'Excerpt Type', 'premium-addons-for-elementor' ), |
| 1215 | 'type' => Controls_Manager::SELECT, |
| 1216 | 'options' => array( |
| 1217 | 'dots' => __( 'Dots', 'premium-addons-for-elementor' ), |
| 1218 | 'link' => __( 'Read More', 'premium-addons-for-elementor' ), |
| 1219 | ), |
| 1220 | 'default' => 'dots', |
| 1221 | 'label_block' => true, |
| 1222 | 'condition' => array( |
| 1223 | 'show_excerpt' => 'yes', |
| 1224 | ), |
| 1225 | ) |
| 1226 | ); |
| 1227 | |
| 1228 | $this->add_control( |
| 1229 | 'excerpt_text', |
| 1230 | array( |
| 1231 | 'label' => __( 'Read More Text', 'premium-addons-for-elementor' ), |
| 1232 | 'type' => Controls_Manager::TEXT, |
| 1233 | 'default' => __( 'Read More »', 'premium-addons-for-elementor' ), |
| 1234 | 'condition' => array( |
| 1235 | 'show_excerpt' => 'yes', |
| 1236 | 'excerpt_type' => 'link', |
| 1237 | ), |
| 1238 | ) |
| 1239 | ); |
| 1240 | |
| 1241 | $this->add_control( |
| 1242 | 'link_box', |
| 1243 | array( |
| 1244 | 'label' => __( 'Link Whole Box', 'premium-addons-for-elementor' ), |
| 1245 | 'type' => Controls_Manager::SWITCHER, |
| 1246 | 'prefix_class' => 'premium-search__whole-link-', |
| 1247 | 'render_type' => 'template', |
| 1248 | 'default' => 'yes', |
| 1249 | ) |
| 1250 | ); |
| 1251 | |
| 1252 | $this->add_control( |
| 1253 | 'new_tab', |
| 1254 | array( |
| 1255 | 'label' => __( 'Open Links in New Tab', 'premium-addons-for-elementor' ), |
| 1256 | 'type' => Controls_Manager::SWITCHER, |
| 1257 | 'default' => 'yes', |
| 1258 | ) |
| 1259 | ); |
| 1260 | |
| 1261 | $this->end_controls_section(); |
| 1262 | |
| 1263 | $this->start_controls_section( |
| 1264 | 'remove_button', |
| 1265 | array( |
| 1266 | 'label' => __( 'Remove Keyword Button', 'premium-addons-for-elementor' ), |
| 1267 | 'condition' => array( |
| 1268 | 'carousel!' => 'yes', |
| 1269 | ), |
| 1270 | ) |
| 1271 | ); |
| 1272 | |
| 1273 | $this->add_control( |
| 1274 | 'remove_button_switcher', |
| 1275 | array( |
| 1276 | 'label' => __( 'Enable Remove Button', 'premium-addons-for-elementor' ), |
| 1277 | 'type' => Controls_Manager::SWITCHER, |
| 1278 | ) |
| 1279 | ); |
| 1280 | |
| 1281 | if ( ! $papro_activated ) { |
| 1282 | |
| 1283 | $get_pro = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/pro', 'search-widget', 'wp-editor', 'get-pro' ); |
| 1284 | |
| 1285 | $this->add_control( |
| 1286 | 'keyword_remove_notice', |
| 1287 | array( |
| 1288 | 'type' => Controls_Manager::RAW_HTML, |
| 1289 | '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>', |
| 1290 | 'content_classes' => 'papro-upgrade-notice', |
| 1291 | 'condition' => array( |
| 1292 | 'remove_button_switcher' => 'yes', |
| 1293 | ), |
| 1294 | ) |
| 1295 | ); |
| 1296 | |
| 1297 | } |
| 1298 | |
| 1299 | $this->end_controls_section(); |
| 1300 | |
| 1301 | $this->start_controls_section( |
| 1302 | 'pagination_section', |
| 1303 | array( |
| 1304 | 'label' => __( 'Pagination', 'premium-addons-for-elementor' ), |
| 1305 | 'condition' => array( |
| 1306 | 'query_type' => 'post', |
| 1307 | 'carousel!' => 'yes', |
| 1308 | ), |
| 1309 | ) |
| 1310 | ); |
| 1311 | |
| 1312 | $this->add_control( |
| 1313 | 'premium_blog_paging', |
| 1314 | array( |
| 1315 | 'label' => __( 'Enable Pagination', 'premium-addons-for-elementor' ), |
| 1316 | 'type' => Controls_Manager::SWITCHER, |
| 1317 | ) |
| 1318 | ); |
| 1319 | |
| 1320 | $this->add_control( |
| 1321 | 'max_pages', |
| 1322 | array( |
| 1323 | 'label' => __( 'Page Limit', 'premium-addons-for-elementor' ), |
| 1324 | 'type' => Controls_Manager::NUMBER, |
| 1325 | 'default' => 5, |
| 1326 | 'condition' => array( |
| 1327 | 'premium_blog_paging' => 'yes', |
| 1328 | ), |
| 1329 | ) |
| 1330 | ); |
| 1331 | |
| 1332 | $this->add_control( |
| 1333 | 'pagination_strings', |
| 1334 | array( |
| 1335 | 'label' => __( 'Enable Pagination Next/Prev Strings', 'premium-addons-for-elementor' ), |
| 1336 | 'type' => Controls_Manager::SWITCHER, |
| 1337 | 'default' => 'yes', |
| 1338 | 'condition' => array( |
| 1339 | 'premium_blog_paging' => 'yes', |
| 1340 | ), |
| 1341 | ) |
| 1342 | ); |
| 1343 | |
| 1344 | $this->add_control( |
| 1345 | 'premium_blog_prev_text', |
| 1346 | array( |
| 1347 | 'label' => __( 'Previous Page String', 'premium-addons-for-elementor' ), |
| 1348 | 'type' => Controls_Manager::TEXT, |
| 1349 | 'default' => __( 'Previous', 'premium-addons-for-elementor' ), |
| 1350 | 'condition' => array( |
| 1351 | 'premium_blog_paging' => 'yes', |
| 1352 | 'pagination_strings' => 'yes', |
| 1353 | ), |
| 1354 | ) |
| 1355 | ); |
| 1356 | |
| 1357 | $this->add_control( |
| 1358 | 'premium_blog_next_text', |
| 1359 | array( |
| 1360 | 'label' => __( 'Next Page String', 'premium-addons-for-elementor' ), |
| 1361 | 'type' => Controls_Manager::TEXT, |
| 1362 | 'default' => __( 'Next', 'premium-addons-for-elementor' ), |
| 1363 | 'condition' => array( |
| 1364 | 'premium_blog_paging' => 'yes', |
| 1365 | 'pagination_strings' => 'yes', |
| 1366 | ), |
| 1367 | ) |
| 1368 | ); |
| 1369 | |
| 1370 | $this->add_responsive_control( |
| 1371 | 'pagination_align', |
| 1372 | array( |
| 1373 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 1374 | 'type' => Controls_Manager::CHOOSE, |
| 1375 | 'options' => array( |
| 1376 | 'left' => array( |
| 1377 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 1378 | 'icon' => 'eicon-text-align-left', |
| 1379 | ), |
| 1380 | 'center' => array( |
| 1381 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 1382 | 'icon' => 'eicon-text-align-center', |
| 1383 | ), |
| 1384 | 'right' => array( |
| 1385 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 1386 | 'icon' => 'eicon-text-align-right', |
| 1387 | ), |
| 1388 | ), |
| 1389 | 'default' => 'right', |
| 1390 | 'toggle' => false, |
| 1391 | 'condition' => array( |
| 1392 | 'premium_blog_paging' => 'yes', |
| 1393 | ), |
| 1394 | 'selectors' => array( |
| 1395 | '{{WRAPPER}} .premium-search-form__pagination-container' => 'text-align: {{VALUE}}', |
| 1396 | ), |
| 1397 | ) |
| 1398 | ); |
| 1399 | |
| 1400 | $this->end_controls_section(); |
| 1401 | |
| 1402 | $this->start_controls_section( |
| 1403 | 'premium_blog_carousel_settings', |
| 1404 | array( |
| 1405 | 'label' => __( 'Carousel', 'premium-addons-for-elementor' ), |
| 1406 | 'condition' => array( |
| 1407 | 'query_type' => 'post', |
| 1408 | 'premium_blog_paging!' => 'yes', |
| 1409 | ), |
| 1410 | ) |
| 1411 | ); |
| 1412 | |
| 1413 | $this->add_control( |
| 1414 | 'carousel', |
| 1415 | array( |
| 1416 | 'label' => __( 'Enable Carousel', 'premium-addons-for-elementor' ), |
| 1417 | 'type' => Controls_Manager::SWITCHER, |
| 1418 | ) |
| 1419 | ); |
| 1420 | |
| 1421 | $this->add_control( |
| 1422 | 'carousel_fade', |
| 1423 | array( |
| 1424 | 'label' => __( 'Fade', 'premium-addons-for-elementor' ), |
| 1425 | 'type' => Controls_Manager::SWITCHER, |
| 1426 | 'condition' => array( |
| 1427 | 'carousel' => 'yes', |
| 1428 | 'columns_number' => '100%', |
| 1429 | ), |
| 1430 | ) |
| 1431 | ); |
| 1432 | |
| 1433 | $this->add_control( |
| 1434 | 'slides_to_scroll', |
| 1435 | array( |
| 1436 | 'label' => __( 'Slides To Scroll', 'premium-addons-for-elementor' ), |
| 1437 | 'type' => Controls_Manager::NUMBER, |
| 1438 | 'condition' => array( |
| 1439 | 'carousel' => 'yes', |
| 1440 | ), |
| 1441 | ) |
| 1442 | ); |
| 1443 | |
| 1444 | $this->add_control( |
| 1445 | 'rows', |
| 1446 | array( |
| 1447 | 'label' => __( 'Rows', 'premium-addons-for-elementor' ), |
| 1448 | 'description' => __( ' How many rows should each slide have.', 'premium-addons-for-elementor' ), |
| 1449 | 'type' => Controls_Manager::NUMBER, |
| 1450 | 'default' => 1, |
| 1451 | 'condition' => array( |
| 1452 | 'carousel' => 'yes', |
| 1453 | ), |
| 1454 | ) |
| 1455 | ); |
| 1456 | |
| 1457 | $this->add_control( |
| 1458 | 'carousel_speed', |
| 1459 | array( |
| 1460 | 'label' => __( 'Transition Speed (ms)', 'premium-addons-for-elementor' ), |
| 1461 | 'description' => __( 'Set the speed of the carousel animation in milliseconds (ms)', 'premium-addons-for-elementor' ), |
| 1462 | 'type' => Controls_Manager::NUMBER, |
| 1463 | 'default' => 300, |
| 1464 | 'render_type' => 'template', |
| 1465 | 'selectors' => array( |
| 1466 | '{{WRAPPER}} .premium-blog-wrap .slick-slide' => 'transition: all {{VALUE}}ms !important', |
| 1467 | ), |
| 1468 | 'condition' => array( |
| 1469 | 'carousel' => 'yes', |
| 1470 | ), |
| 1471 | ) |
| 1472 | ); |
| 1473 | |
| 1474 | $this->add_control( |
| 1475 | 'carousel_center', |
| 1476 | array( |
| 1477 | 'label' => __( 'Center Mode', 'premium-addons-for-elementor' ), |
| 1478 | 'type' => Controls_Manager::SWITCHER, |
| 1479 | 'condition' => array( |
| 1480 | 'carousel' => 'yes', |
| 1481 | ), |
| 1482 | ) |
| 1483 | ); |
| 1484 | |
| 1485 | $this->add_control( |
| 1486 | 'carousel_spacing', |
| 1487 | array( |
| 1488 | 'label' => __( 'Slides\' Spacing', 'premium-addons-for-elementor' ), |
| 1489 | 'description' => __( 'Set a spacing value in pixels (px)', 'premium-addons-for-elementor' ), |
| 1490 | 'type' => Controls_Manager::NUMBER, |
| 1491 | 'default' => '15', |
| 1492 | 'condition' => array( |
| 1493 | 'carousel' => 'yes', |
| 1494 | 'carousel_center' => 'yes', |
| 1495 | ), |
| 1496 | ) |
| 1497 | ); |
| 1498 | |
| 1499 | $this->add_control( |
| 1500 | 'carousel_dots', |
| 1501 | array( |
| 1502 | 'label' => __( 'Navigation Dots', 'premium-addons-for-elementor' ), |
| 1503 | 'type' => Controls_Manager::SWITCHER, |
| 1504 | 'condition' => array( |
| 1505 | 'carousel' => 'yes', |
| 1506 | ), |
| 1507 | ) |
| 1508 | ); |
| 1509 | |
| 1510 | $this->add_control( |
| 1511 | 'carousel_arrows', |
| 1512 | array( |
| 1513 | 'label' => __( 'Navigation Arrows', 'premium-addons-for-elementor' ), |
| 1514 | 'type' => Controls_Manager::SWITCHER, |
| 1515 | 'default' => 'yes', |
| 1516 | 'condition' => array( |
| 1517 | 'carousel' => 'yes', |
| 1518 | ), |
| 1519 | ) |
| 1520 | ); |
| 1521 | |
| 1522 | $this->add_responsive_control( |
| 1523 | 'arrows_vposition', |
| 1524 | array( |
| 1525 | 'label' => __( 'Vertical Position', 'premium-addons-for-elementor' ), |
| 1526 | 'type' => Controls_Manager::CHOOSE, |
| 1527 | 'options' => array( |
| 1528 | 'top' => array( |
| 1529 | 'title' => __( 'Top', 'premium-addons-for-elementor' ), |
| 1530 | 'icon' => 'eicon-arrow-up', |
| 1531 | ), |
| 1532 | 'middle' => array( |
| 1533 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 1534 | 'icon' => 'eicon-text-align-justify', |
| 1535 | ), |
| 1536 | 'bottom' => array( |
| 1537 | 'title' => __( 'Bottom', 'premium-addons-for-elementor' ), |
| 1538 | 'icon' => 'eicon-arrow-down', |
| 1539 | ), |
| 1540 | ), |
| 1541 | 'default' => 'middle', |
| 1542 | 'toggle' => false, |
| 1543 | 'prefix_class' => 'premium-search__arrow-', |
| 1544 | 'condition' => array( |
| 1545 | 'carousel' => 'yes', |
| 1546 | 'carousel_arrows' => 'yes', |
| 1547 | ), |
| 1548 | ) |
| 1549 | ); |
| 1550 | |
| 1551 | $this->add_responsive_control( |
| 1552 | 'carousel_prev_arrow_pos', |
| 1553 | array( |
| 1554 | 'label' => __( 'Previous Arrow Position', 'premium-addons-for-elementor' ), |
| 1555 | 'type' => Controls_Manager::SLIDER, |
| 1556 | 'size_units' => array( 'px', 'em', '%' ), |
| 1557 | 'range' => array( |
| 1558 | 'px' => array( |
| 1559 | 'min' => -100, |
| 1560 | 'max' => 100, |
| 1561 | ), |
| 1562 | 'em' => array( |
| 1563 | 'min' => -10, |
| 1564 | 'max' => 10, |
| 1565 | ), |
| 1566 | ), |
| 1567 | 'condition' => array( |
| 1568 | 'carousel' => 'yes', |
| 1569 | 'carousel_arrows' => 'yes', |
| 1570 | ), |
| 1571 | 'selectors' => array( |
| 1572 | // '{{WRAPPER}} .premium-blog-wrap a.carousel-arrow.carousel-next' => 'right: {{SIZE}}{{UNIT}};', |
| 1573 | '{{WRAPPER}} .premium-search__query-wrap a.carousel-arrow.carousel-prev' => 'left: {{SIZE}}{{UNIT}};', |
| 1574 | ), |
| 1575 | ) |
| 1576 | ); |
| 1577 | |
| 1578 | $this->add_responsive_control( |
| 1579 | 'carousel_next_arrow_pos', |
| 1580 | array( |
| 1581 | 'label' => __( 'Next Arrow Position', 'premium-addons-for-elementor' ), |
| 1582 | 'type' => Controls_Manager::SLIDER, |
| 1583 | 'size_units' => array( 'px', 'em', '%' ), |
| 1584 | 'range' => array( |
| 1585 | 'px' => array( |
| 1586 | 'min' => -100, |
| 1587 | 'max' => 100, |
| 1588 | ), |
| 1589 | 'em' => array( |
| 1590 | 'min' => -10, |
| 1591 | 'max' => 10, |
| 1592 | ), |
| 1593 | ), |
| 1594 | 'condition' => array( |
| 1595 | 'carousel' => 'yes', |
| 1596 | 'carousel_arrows' => 'yes', |
| 1597 | ), |
| 1598 | 'selectors' => array( |
| 1599 | '{{WRAPPER}} .premium-search__query-wrap a.carousel-arrow.carousel-next' => 'right: {{SIZE}}{{UNIT}};', |
| 1600 | // '{{WRAPPER}} .premium-blog-wrap a.carousel-arrow.carousel-prev' => 'left: {{SIZE}}{{UNIT}};', |
| 1601 | ), |
| 1602 | ) |
| 1603 | ); |
| 1604 | |
| 1605 | $this->end_controls_section(); |
| 1606 | |
| 1607 | $this->start_controls_section( |
| 1608 | 'label_style', |
| 1609 | array( |
| 1610 | 'label' => __( 'Label', 'premium-addons-for-elementor' ), |
| 1611 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1612 | 'condition' => array( |
| 1613 | 'show_label' => 'yes', |
| 1614 | ), |
| 1615 | ) |
| 1616 | ); |
| 1617 | |
| 1618 | $this->add_control( |
| 1619 | 'label_color', |
| 1620 | array( |
| 1621 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1622 | 'type' => Controls_Manager::COLOR, |
| 1623 | 'selectors' => array( |
| 1624 | '{{WRAPPER}} .premium-search__label' => 'color: {{VALUE}};', |
| 1625 | ), |
| 1626 | ) |
| 1627 | ); |
| 1628 | |
| 1629 | $this->add_group_control( |
| 1630 | Group_Control_Typography::get_type(), |
| 1631 | array( |
| 1632 | 'name' => 'label_typo', |
| 1633 | 'selector' => '{{WRAPPER}} .premium-search__label', |
| 1634 | ) |
| 1635 | ); |
| 1636 | |
| 1637 | $this->add_control( |
| 1638 | 'label_background_color', |
| 1639 | array( |
| 1640 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1641 | 'type' => Controls_Manager::COLOR, |
| 1642 | 'selectors' => array( |
| 1643 | '{{WRAPPER}} .premium-search__label' => 'background-color: {{VALUE}};', |
| 1644 | ), |
| 1645 | ) |
| 1646 | ); |
| 1647 | |
| 1648 | $this->add_group_control( |
| 1649 | Group_Control_Border::get_type(), |
| 1650 | array( |
| 1651 | 'name' => 'label_border', |
| 1652 | 'selector' => '{{WRAPPER}} .premium-search__label', |
| 1653 | ) |
| 1654 | ); |
| 1655 | |
| 1656 | $this->add_control( |
| 1657 | 'label_border_radius', |
| 1658 | array( |
| 1659 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1660 | 'type' => Controls_Manager::SLIDER, |
| 1661 | 'size_units' => array( 'px', 'em', '%' ), |
| 1662 | 'selectors' => array( |
| 1663 | '{{WRAPPER}} .premium-search__label' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1664 | ), |
| 1665 | ) |
| 1666 | ); |
| 1667 | |
| 1668 | $this->add_group_control( |
| 1669 | Group_Control_Text_Shadow::get_type(), |
| 1670 | array( |
| 1671 | 'name' => 'label_text_shadow', |
| 1672 | 'selector' => '{{WRAPPER}} .premium-search__label', |
| 1673 | ) |
| 1674 | ); |
| 1675 | |
| 1676 | $this->add_responsive_control( |
| 1677 | 'label_margin', |
| 1678 | array( |
| 1679 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1680 | 'type' => Controls_Manager::DIMENSIONS, |
| 1681 | 'size_units' => array( 'px', 'em', '%' ), |
| 1682 | 'selectors' => array( |
| 1683 | '{{WRAPPER}} .premium-search__label-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1684 | ), |
| 1685 | ) |
| 1686 | ); |
| 1687 | |
| 1688 | $this->add_responsive_control( |
| 1689 | 'label_padding', |
| 1690 | array( |
| 1691 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1692 | 'type' => Controls_Manager::DIMENSIONS, |
| 1693 | 'size_units' => array( 'px', 'em', '%' ), |
| 1694 | 'selectors' => array( |
| 1695 | '{{WRAPPER}} .premium-search__label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 1696 | ), |
| 1697 | ) |
| 1698 | ); |
| 1699 | |
| 1700 | $this->end_controls_section(); |
| 1701 | |
| 1702 | if ( $papro_activated ) { |
| 1703 | do_action( 'pa_search_select_field_style', $this ); |
| 1704 | } |
| 1705 | |
| 1706 | $this->start_controls_section( |
| 1707 | 'input_field_style', |
| 1708 | array( |
| 1709 | 'label' => __( 'Search Field', 'premium-addons-for-elementor' ), |
| 1710 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1711 | ) |
| 1712 | ); |
| 1713 | |
| 1714 | $this->add_group_control( |
| 1715 | Group_Control_Typography::get_type(), |
| 1716 | array( |
| 1717 | 'name' => 'input_typo', |
| 1718 | 'selector' => '{{WRAPPER}} .premium-search__input', |
| 1719 | ) |
| 1720 | ); |
| 1721 | |
| 1722 | $this->start_controls_tabs( 'input_style_tabs' ); |
| 1723 | |
| 1724 | $this->start_controls_tab( |
| 1725 | 'input_style_normal', |
| 1726 | array( |
| 1727 | 'label' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 1728 | ) |
| 1729 | ); |
| 1730 | |
| 1731 | $this->add_control( |
| 1732 | 'input_color', |
| 1733 | array( |
| 1734 | 'label' => __( 'Text Color', 'premium-addons-for-elementor' ), |
| 1735 | 'type' => Controls_Manager::COLOR, |
| 1736 | 'selectors' => array( |
| 1737 | '{{WRAPPER}} .premium-search__input, {{WRAPPER}} .premium-search__input::placeholder' => 'color: {{VALUE}};', |
| 1738 | ), |
| 1739 | ) |
| 1740 | ); |
| 1741 | |
| 1742 | $this->add_control( |
| 1743 | 'input_background_color', |
| 1744 | array( |
| 1745 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1746 | 'type' => Controls_Manager::COLOR, |
| 1747 | 'selectors' => array( |
| 1748 | '{{WRAPPER}} .premium-search__input' => 'background-color: {{VALUE}};', |
| 1749 | ), |
| 1750 | ) |
| 1751 | ); |
| 1752 | |
| 1753 | $this->add_group_control( |
| 1754 | Group_Control_Border::get_type(), |
| 1755 | array( |
| 1756 | 'name' => 'input_border', |
| 1757 | 'selector' => '{{WRAPPER}} .premium-search__input', |
| 1758 | ) |
| 1759 | ); |
| 1760 | |
| 1761 | $this->add_control( |
| 1762 | 'input_border_radius', |
| 1763 | array( |
| 1764 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1765 | 'type' => Controls_Manager::DIMENSIONS, |
| 1766 | 'size_units' => array( 'px', 'em', '%' ), |
| 1767 | 'selectors' => array( |
| 1768 | '{{WRAPPER}} .premium-search__input' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1769 | ), |
| 1770 | ) |
| 1771 | ); |
| 1772 | |
| 1773 | $this->add_group_control( |
| 1774 | Group_Control_Box_Shadow::get_type(), |
| 1775 | array( |
| 1776 | 'name' => 'input_box_shadow', |
| 1777 | 'selector' => '{{WRAPPER}} .premium-search__input', |
| 1778 | ) |
| 1779 | ); |
| 1780 | |
| 1781 | $this->end_controls_tab(); |
| 1782 | |
| 1783 | $this->start_controls_tab( |
| 1784 | 'input_style_focus', |
| 1785 | array( |
| 1786 | 'label' => __( 'Focus', 'premium-addons-for-elementor' ), |
| 1787 | ) |
| 1788 | ); |
| 1789 | |
| 1790 | $this->add_control( |
| 1791 | 'input_background_color_focus', |
| 1792 | array( |
| 1793 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1794 | 'type' => Controls_Manager::COLOR, |
| 1795 | 'selectors' => array( |
| 1796 | '{{WRAPPER}} .premium-search__input:focus' => 'background-color: {{VALUE}};', |
| 1797 | ), |
| 1798 | ) |
| 1799 | ); |
| 1800 | |
| 1801 | $this->add_group_control( |
| 1802 | Group_Control_Border::get_type(), |
| 1803 | array( |
| 1804 | 'name' => 'input_border_focus', |
| 1805 | 'selector' => '{{WRAPPER}} .premium-search__input:focus', |
| 1806 | ) |
| 1807 | ); |
| 1808 | |
| 1809 | $this->add_control( |
| 1810 | 'read_more_border_radius_focus', |
| 1811 | array( |
| 1812 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1813 | 'type' => Controls_Manager::DIMENSIONS, |
| 1814 | 'size_units' => array( 'px', 'em', '%' ), |
| 1815 | 'selectors' => array( |
| 1816 | '{{WRAPPER}} .premium-search__input:focus' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1817 | ), |
| 1818 | ) |
| 1819 | ); |
| 1820 | |
| 1821 | $this->add_group_control( |
| 1822 | Group_Control_Box_Shadow::get_type(), |
| 1823 | array( |
| 1824 | 'name' => 'input_box_shadow_focus', |
| 1825 | 'selector' => '{{WRAPPER}} .premium-search__input:focus', |
| 1826 | ) |
| 1827 | ); |
| 1828 | |
| 1829 | $this->end_controls_tab(); |
| 1830 | |
| 1831 | $this->end_controls_tabs(); |
| 1832 | |
| 1833 | $this->end_controls_section(); |
| 1834 | |
| 1835 | if ( $papro_activated ) { |
| 1836 | do_action( 'pa_search_keyword_button_style', $this ); |
| 1837 | } |
| 1838 | |
| 1839 | $this->start_controls_section( |
| 1840 | 'search_button_style', |
| 1841 | array( |
| 1842 | 'label' => __( 'Search Button', 'premium-addons-for-elementor' ), |
| 1843 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1844 | 'condition' => array( |
| 1845 | 'search_button' => 'yes', |
| 1846 | ), |
| 1847 | ) |
| 1848 | ); |
| 1849 | |
| 1850 | $this->add_group_control( |
| 1851 | Group_Control_Typography::get_type(), |
| 1852 | array( |
| 1853 | 'name' => 'btn_typo', |
| 1854 | 'selector' => '{{WRAPPER}} .premium-search__btn', |
| 1855 | ) |
| 1856 | ); |
| 1857 | |
| 1858 | $this->start_controls_tabs( 'btn_style_tabs' ); |
| 1859 | |
| 1860 | $this->start_controls_tab( |
| 1861 | 'btn_style_normal', |
| 1862 | array( |
| 1863 | 'label' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 1864 | ) |
| 1865 | ); |
| 1866 | |
| 1867 | $this->add_control( |
| 1868 | 'btn_color', |
| 1869 | array( |
| 1870 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1871 | 'type' => Controls_Manager::COLOR, |
| 1872 | 'selectors' => array( |
| 1873 | '{{WRAPPER}} .premium-search__btn' => 'color: {{VALUE}};', |
| 1874 | '{{WRAPPER}} .premium-search__btn svg' => 'fill: {{VALUE}};', |
| 1875 | ), |
| 1876 | ) |
| 1877 | ); |
| 1878 | |
| 1879 | $this->add_group_control( |
| 1880 | Premium_Background::get_type(), |
| 1881 | array( |
| 1882 | 'name' => 'btn_background', |
| 1883 | 'types' => array( 'classic', 'gradient' ), |
| 1884 | 'selector' => '{{WRAPPER}} .premium-search__btn', |
| 1885 | ) |
| 1886 | ); |
| 1887 | |
| 1888 | $this->add_group_control( |
| 1889 | Group_Control_Text_Shadow::get_type(), |
| 1890 | array( |
| 1891 | 'name' => 'btn_text_shadow', |
| 1892 | 'selector' => '{{WRAPPER}} .premium-search__btn', |
| 1893 | ) |
| 1894 | ); |
| 1895 | |
| 1896 | $this->add_group_control( |
| 1897 | Group_Control_Border::get_type(), |
| 1898 | array( |
| 1899 | 'name' => 'btn_border', |
| 1900 | 'selector' => '{{WRAPPER}} .premium-search__btn', |
| 1901 | ) |
| 1902 | ); |
| 1903 | |
| 1904 | $this->add_control( |
| 1905 | 'btn_border_radius', |
| 1906 | array( |
| 1907 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1908 | 'type' => Controls_Manager::DIMENSIONS, |
| 1909 | 'size_units' => array( 'px', 'em', '%' ), |
| 1910 | 'selectors' => array( |
| 1911 | '{{WRAPPER}} .premium-search__btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1912 | ), |
| 1913 | ) |
| 1914 | ); |
| 1915 | |
| 1916 | $this->add_group_control( |
| 1917 | Group_Control_Box_Shadow::get_type(), |
| 1918 | array( |
| 1919 | 'name' => 'btn_box_shadow', |
| 1920 | 'selector' => '{{WRAPPER}} .premium-search__btn', |
| 1921 | ) |
| 1922 | ); |
| 1923 | |
| 1924 | $this->add_responsive_control( |
| 1925 | 'btn_margin', |
| 1926 | array( |
| 1927 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 1928 | 'type' => Controls_Manager::DIMENSIONS, |
| 1929 | 'size_units' => array( 'px', 'em', '%' ), |
| 1930 | 'selectors' => array( |
| 1931 | '{{WRAPPER}} .premium-search__btn-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1932 | ), |
| 1933 | ) |
| 1934 | ); |
| 1935 | |
| 1936 | $this->add_responsive_control( |
| 1937 | 'btn_padding', |
| 1938 | array( |
| 1939 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1940 | 'type' => Controls_Manager::DIMENSIONS, |
| 1941 | 'size_units' => array( 'px', 'em', '%' ), |
| 1942 | 'selectors' => array( |
| 1943 | '{{WRAPPER}} .premium-search__btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1944 | ), |
| 1945 | ) |
| 1946 | ); |
| 1947 | |
| 1948 | $this->end_controls_tab(); |
| 1949 | |
| 1950 | $this->start_controls_tab( |
| 1951 | 'btn_style_hover', |
| 1952 | array( |
| 1953 | 'label' => __( 'Hover', 'premium-addons-for-elementor' ), |
| 1954 | ) |
| 1955 | ); |
| 1956 | |
| 1957 | $this->add_control( |
| 1958 | 'btn_hover_color', |
| 1959 | array( |
| 1960 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1961 | 'type' => Controls_Manager::COLOR, |
| 1962 | 'selectors' => array( |
| 1963 | '{{WRAPPER}} .premium-search__btn:hover' => 'color: {{VALUE}};', |
| 1964 | '{{WRAPPER}} .premium-search__btn:hover svg' => 'fill: {{VALUE}};', |
| 1965 | ), |
| 1966 | ) |
| 1967 | ); |
| 1968 | |
| 1969 | $this->add_group_control( |
| 1970 | Premium_Background::get_type(), |
| 1971 | array( |
| 1972 | 'name' => 'btn_background_hover', |
| 1973 | 'types' => array( 'classic', 'gradient' ), |
| 1974 | 'selector' => '{{WRAPPER}} .premium-search__btn:hover', |
| 1975 | ) |
| 1976 | ); |
| 1977 | |
| 1978 | $this->add_group_control( |
| 1979 | Group_Control_Text_Shadow::get_type(), |
| 1980 | array( |
| 1981 | 'name' => 'btn_text_shadow_hover', |
| 1982 | 'selector' => '{{WRAPPER}} .premium-search__btn:hover', |
| 1983 | ) |
| 1984 | ); |
| 1985 | |
| 1986 | $this->add_group_control( |
| 1987 | Group_Control_Border::get_type(), |
| 1988 | array( |
| 1989 | 'name' => 'btn_border_hover', |
| 1990 | 'selector' => '{{WRAPPER}} .premium-search__btn:hover', |
| 1991 | ) |
| 1992 | ); |
| 1993 | |
| 1994 | $this->add_control( |
| 1995 | 'btn_border_radius_hover', |
| 1996 | array( |
| 1997 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1998 | 'type' => Controls_Manager::DIMENSIONS, |
| 1999 | 'size_units' => array( 'px', 'em', '%' ), |
| 2000 | 'selectors' => array( |
| 2001 | '{{WRAPPER}} .premium-search__btn:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2002 | ), |
| 2003 | ) |
| 2004 | ); |
| 2005 | |
| 2006 | $this->add_group_control( |
| 2007 | Group_Control_Box_Shadow::get_type(), |
| 2008 | array( |
| 2009 | 'name' => 'btn_shadow_hover', |
| 2010 | 'selector' => '{{WRAPPER}} .premium-search__btn:hover', |
| 2011 | ) |
| 2012 | ); |
| 2013 | |
| 2014 | $this->add_responsive_control( |
| 2015 | 'btn_margin_hover', |
| 2016 | array( |
| 2017 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2018 | 'type' => Controls_Manager::DIMENSIONS, |
| 2019 | 'size_units' => array( 'px', 'em', '%' ), |
| 2020 | 'selectors' => array( |
| 2021 | '{{WRAPPER}} .premium-search__btn-wrap:hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2022 | ), |
| 2023 | ) |
| 2024 | ); |
| 2025 | |
| 2026 | $this->add_responsive_control( |
| 2027 | 'btn_padding_hover', |
| 2028 | array( |
| 2029 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2030 | 'type' => Controls_Manager::DIMENSIONS, |
| 2031 | 'size_units' => array( 'px', 'em', '%' ), |
| 2032 | 'selectors' => array( |
| 2033 | '{{WRAPPER}} .premium-search__btn:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2034 | ), |
| 2035 | ) |
| 2036 | ); |
| 2037 | |
| 2038 | $this->end_controls_tab(); |
| 2039 | |
| 2040 | $this->end_controls_tabs(); |
| 2041 | |
| 2042 | $this->end_controls_section(); |
| 2043 | |
| 2044 | $this->start_controls_section( |
| 2045 | 'thumbnail_style_section', |
| 2046 | array( |
| 2047 | 'label' => __( 'Thumbnail', 'premium-addons-for-elementor' ), |
| 2048 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2049 | 'condition' => array( |
| 2050 | 'query_type' => 'post', |
| 2051 | 'show_post_thumbnail' => 'yes', |
| 2052 | ), |
| 2053 | ) |
| 2054 | ); |
| 2055 | |
| 2056 | $this->add_responsive_control( |
| 2057 | 'thumbnail_width', |
| 2058 | array( |
| 2059 | 'label' => __( 'Width', 'premium-addons-for-elementor' ), |
| 2060 | 'type' => Controls_Manager::SLIDER, |
| 2061 | 'size_units' => array( 'px', 'em', 'custom' ), |
| 2062 | 'range' => array( |
| 2063 | 'px' => array( |
| 2064 | 'min' => 0, |
| 2065 | 'max' => 200, |
| 2066 | ), |
| 2067 | 'em' => array( |
| 2068 | 'min' => 1, |
| 2069 | 'max' => 20, |
| 2070 | ), |
| 2071 | ), |
| 2072 | 'condition' => array( |
| 2073 | 'show_post_thumbnail' => 'yes', |
| 2074 | 'skin' => 'side', |
| 2075 | ), |
| 2076 | 'selectors' => array( |
| 2077 | '{{WRAPPER}} .premium-search__thumbnail img' => 'width: {{SIZE}}{{UNIT}};', |
| 2078 | ), |
| 2079 | ) |
| 2080 | ); |
| 2081 | |
| 2082 | $this->add_responsive_control( |
| 2083 | 'thumbnail_height', |
| 2084 | array( |
| 2085 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 2086 | 'type' => Controls_Manager::SLIDER, |
| 2087 | 'size_units' => array( 'px', 'em', 'custom' ), |
| 2088 | 'range' => array( |
| 2089 | 'px' => array( |
| 2090 | 'min' => 0, |
| 2091 | 'max' => 600, |
| 2092 | ), |
| 2093 | 'em' => array( |
| 2094 | 'min' => 1, |
| 2095 | 'max' => 60, |
| 2096 | ), |
| 2097 | ), |
| 2098 | 'default' => array( |
| 2099 | 'size' => 300, |
| 2100 | 'unit' => 'px', |
| 2101 | ), |
| 2102 | 'selectors' => array( |
| 2103 | '{{WRAPPER}} .premium-search__thumbnail img' => 'height: {{SIZE}}{{UNIT}};', |
| 2104 | ), |
| 2105 | 'condition' => array( |
| 2106 | 'show_post_thumbnail' => 'yes', |
| 2107 | ), |
| 2108 | ) |
| 2109 | ); |
| 2110 | |
| 2111 | $this->add_control( |
| 2112 | 'image_effect', |
| 2113 | array( |
| 2114 | 'label' => __( 'Hover Effect', 'premium-addons-for-elementor' ), |
| 2115 | 'type' => Controls_Manager::SELECT, |
| 2116 | 'description' => __( 'Choose a hover effect for the image', 'premium-addons-for-elementor' ), |
| 2117 | 'options' => array( |
| 2118 | 'none' => __( 'None', 'premium-addons-for-elementor' ), |
| 2119 | 'zoomin' => __( 'Zoom In', 'premium-addons-for-elementor' ), |
| 2120 | 'zoomout' => __( 'Zoom Out', 'premium-addons-for-elementor' ), |
| 2121 | 'scale' => __( 'Scale', 'premium-addons-for-elementor' ), |
| 2122 | 'gray' => __( 'Grayscale', 'premium-addons-for-elementor' ), |
| 2123 | 'blur' => __( 'Blur', 'premium-addons-for-elementor' ), |
| 2124 | 'bright' => __( 'Bright', 'premium-addons-for-elementor' ), |
| 2125 | 'sepia' => __( 'Sepia', 'premium-addons-for-elementor' ), |
| 2126 | 'trans' => __( 'Translate', 'premium-addons-for-elementor' ), |
| 2127 | ), |
| 2128 | 'prefix_class' => 'premium-search__effect-', |
| 2129 | 'default' => 'zoomin', |
| 2130 | 'label_block' => true, |
| 2131 | ) |
| 2132 | ); |
| 2133 | |
| 2134 | $this->add_control( |
| 2135 | 'overlay_color_normal', |
| 2136 | array( |
| 2137 | 'label' => __( 'Overlay Color', 'premium-addons-for-elementor' ), |
| 2138 | 'type' => Controls_Manager::COLOR, |
| 2139 | 'selectors' => array( |
| 2140 | '{{WRAPPER}} .premium-search__overlay' => 'background-color: {{VALUE}};', |
| 2141 | ), |
| 2142 | ) |
| 2143 | ); |
| 2144 | |
| 2145 | $this->add_control( |
| 2146 | 'overlay_color', |
| 2147 | array( |
| 2148 | 'label' => __( 'Hover Overlay Color', 'premium-addons-for-elementor' ), |
| 2149 | 'type' => Controls_Manager::COLOR, |
| 2150 | 'selectors' => array( |
| 2151 | '{{WRAPPER}} .premium-search__container:not(.premium-search__skin-banner) .premium-search__thumbnail-wrap:hover .premium-search__overlay' => 'background-color: {{VALUE}};', |
| 2152 | '{{WRAPPER}} .premium-search__container.premium-search__skin-banner .premium-search__post-wrap:hover .premium-search__overlay' => 'background-color: {{VALUE}};', |
| 2153 | ), |
| 2154 | ) |
| 2155 | ); |
| 2156 | |
| 2157 | $this->add_group_control( |
| 2158 | Group_Control_Border::get_type(), |
| 2159 | array( |
| 2160 | 'name' => 'thumbnail_border', |
| 2161 | 'selector' => '{{WRAPPER}} .premium-search__thumbnail', |
| 2162 | ) |
| 2163 | ); |
| 2164 | |
| 2165 | $this->add_control( |
| 2166 | 'thumbnail_border_radius', |
| 2167 | array( |
| 2168 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2169 | 'type' => Controls_Manager::DIMENSIONS, |
| 2170 | 'size_units' => array( 'px', 'em', '%' ), |
| 2171 | 'selectors' => array( |
| 2172 | '{{WRAPPER}} .premium-search__thumbnail' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2173 | ), |
| 2174 | ) |
| 2175 | ); |
| 2176 | |
| 2177 | $this->end_controls_section(); |
| 2178 | |
| 2179 | $this->start_controls_section( |
| 2180 | 'title_style_section', |
| 2181 | array( |
| 2182 | 'label' => __( 'Title', 'premium-addons-for-elementor' ), |
| 2183 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2184 | 'condition' => array( |
| 2185 | 'query_type' => 'post', |
| 2186 | ), |
| 2187 | ) |
| 2188 | ); |
| 2189 | |
| 2190 | $this->add_group_control( |
| 2191 | Group_Control_Typography::get_type(), |
| 2192 | array( |
| 2193 | 'name' => 'title_typo', |
| 2194 | 'global' => array( |
| 2195 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2196 | ), |
| 2197 | 'selector' => '{{WRAPPER}} .premium-search__post-title, {{WRAPPER}} .premium-search__post-title a', |
| 2198 | ) |
| 2199 | ); |
| 2200 | |
| 2201 | $this->add_control( |
| 2202 | 'title_color', |
| 2203 | array( |
| 2204 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2205 | 'type' => Controls_Manager::COLOR, |
| 2206 | 'global' => array( |
| 2207 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 2208 | ), |
| 2209 | 'selectors' => array( |
| 2210 | '{{WRAPPER}} .premium-search__post-title a' => 'color: {{VALUE}};', |
| 2211 | ), |
| 2212 | ) |
| 2213 | ); |
| 2214 | |
| 2215 | $this->add_control( |
| 2216 | 'title_hover_color', |
| 2217 | array( |
| 2218 | 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ), |
| 2219 | 'type' => Controls_Manager::COLOR, |
| 2220 | 'selectors' => array( |
| 2221 | '{{WRAPPER}} .premium-search__post-title:hover a, {{WRAPPER}}.premium-search__whole-link-yes .premium-search__post-wrap:hover .premium-search__post-title a' => 'color: {{VALUE}};', |
| 2222 | ), |
| 2223 | ) |
| 2224 | ); |
| 2225 | |
| 2226 | $this->add_responsive_control( |
| 2227 | 'title_margin', |
| 2228 | array( |
| 2229 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2230 | 'type' => Controls_Manager::DIMENSIONS, |
| 2231 | 'size_units' => array( 'px', 'em', '%' ), |
| 2232 | 'selectors' => array( |
| 2233 | '{{WRAPPER}} .premium-search__post-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2234 | ), |
| 2235 | ) |
| 2236 | ); |
| 2237 | |
| 2238 | $this->end_controls_section(); |
| 2239 | |
| 2240 | $this->start_controls_section( |
| 2241 | 'excerpt_style_section', |
| 2242 | array( |
| 2243 | 'label' => __( 'Excerpt', 'premium-addons-for-elementor' ), |
| 2244 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2245 | 'condition' => array( |
| 2246 | 'query_type' => 'post', |
| 2247 | 'show_excerpt' => 'yes', |
| 2248 | ), |
| 2249 | ) |
| 2250 | ); |
| 2251 | |
| 2252 | $this->add_control( |
| 2253 | 'excerpt_color', |
| 2254 | array( |
| 2255 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2256 | 'type' => Controls_Manager::COLOR, |
| 2257 | 'global' => array( |
| 2258 | 'default' => Global_Colors::COLOR_TEXT, |
| 2259 | ), |
| 2260 | 'selectors' => array( |
| 2261 | '{{WRAPPER}} .premium-search__excerpt-wrap' => 'color: {{VALUE}};', |
| 2262 | ), |
| 2263 | ) |
| 2264 | ); |
| 2265 | |
| 2266 | $this->add_group_control( |
| 2267 | Group_Control_Typography::get_type(), |
| 2268 | array( |
| 2269 | 'name' => 'excerpt_typo', |
| 2270 | 'selector' => '{{WRAPPER}} .premium-search__excerpt-wrap', |
| 2271 | ) |
| 2272 | ); |
| 2273 | |
| 2274 | $this->add_group_control( |
| 2275 | Group_Control_Text_Shadow::get_type(), |
| 2276 | array( |
| 2277 | 'name' => 'excerpt_text_shadow', |
| 2278 | 'selector' => '{{WRAPPER}} .premium-search__post-excerpt', |
| 2279 | ) |
| 2280 | ); |
| 2281 | |
| 2282 | $this->add_responsive_control( |
| 2283 | 'excerpt_margin', |
| 2284 | array( |
| 2285 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2286 | 'type' => Controls_Manager::DIMENSIONS, |
| 2287 | 'size_units' => array( 'px', 'em', '%' ), |
| 2288 | 'selectors' => array( |
| 2289 | '{{WRAPPER}} .premium-search__excerpt-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2290 | ), |
| 2291 | ) |
| 2292 | ); |
| 2293 | |
| 2294 | $this->end_controls_section(); |
| 2295 | |
| 2296 | $this->start_controls_section( |
| 2297 | 'post_container_style', |
| 2298 | array( |
| 2299 | 'label' => __( 'Post Box', 'premium-addons-for-elementor' ), |
| 2300 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2301 | 'condition' => array( |
| 2302 | 'query_type' => 'post', |
| 2303 | 'skin!' => 'banner', |
| 2304 | ), |
| 2305 | ) |
| 2306 | ); |
| 2307 | |
| 2308 | $this->start_controls_tabs( 'post_box_style_tabs' ); |
| 2309 | |
| 2310 | $this->start_controls_tab( |
| 2311 | 'post_box_normal', |
| 2312 | array( |
| 2313 | 'label' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 2314 | ) |
| 2315 | ); |
| 2316 | |
| 2317 | $this->add_group_control( |
| 2318 | Premium_Background::get_type(), |
| 2319 | array( |
| 2320 | 'name' => 'post_background', |
| 2321 | 'types' => array( 'classic', 'gradient' ), |
| 2322 | 'selector' => '{{WRAPPER}} .premium-search__post-inner', |
| 2323 | ) |
| 2324 | ); |
| 2325 | |
| 2326 | $this->add_control( |
| 2327 | 'post_lq_effect', |
| 2328 | array( |
| 2329 | 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ), |
| 2330 | 'type' => Controls_Manager::SELECT, |
| 2331 | 'description' => sprintf( |
| 2332 | /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */ |
| 2333 | esc_html__( 'Important: Make sure this element has a semi-transparent background color to see the effect. See all presets from %1$shere%2$s.', 'premium-addons-for-elementor' ), |
| 2334 | '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">', |
| 2335 | '</a>' |
| 2336 | ), |
| 2337 | 'options' => array( |
| 2338 | 'none' => __( 'None', 'premium-addons-for-elementor' ), |
| 2339 | 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ), |
| 2340 | 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ), |
| 2341 | 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ), |
| 2342 | 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ), |
| 2343 | 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ), |
| 2344 | 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ), |
| 2345 | ), |
| 2346 | 'default' => 'none', |
| 2347 | 'label_block' => true, |
| 2348 | ) |
| 2349 | ); |
| 2350 | |
| 2351 | $this->add_group_control( |
| 2352 | Group_Control_Border::get_type(), |
| 2353 | array( |
| 2354 | 'name' => 'post_border', |
| 2355 | 'selector' => '{{WRAPPER}} .premium-search__post-inner', |
| 2356 | ) |
| 2357 | ); |
| 2358 | |
| 2359 | $this->add_control( |
| 2360 | 'post_border_radius', |
| 2361 | array( |
| 2362 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2363 | 'type' => Controls_Manager::DIMENSIONS, |
| 2364 | 'size_units' => array( 'px', '%', 'em' ), |
| 2365 | 'selectors' => array( |
| 2366 | '{{WRAPPER}} .premium-search__post-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2367 | ), |
| 2368 | ) |
| 2369 | ); |
| 2370 | |
| 2371 | $this->add_group_control( |
| 2372 | Group_Control_Box_Shadow::get_type(), |
| 2373 | array( |
| 2374 | 'name' => 'post_box_shadow', |
| 2375 | 'selector' => '{{WRAPPER}} .premium-search__post-inner', |
| 2376 | ) |
| 2377 | ); |
| 2378 | |
| 2379 | $this->add_responsive_control( |
| 2380 | 'post_box_padding', |
| 2381 | array( |
| 2382 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2383 | 'type' => Controls_Manager::DIMENSIONS, |
| 2384 | 'size_units' => array( 'px', 'em', '%' ), |
| 2385 | 'selectors' => array( |
| 2386 | '{{WRAPPER}} .premium-search__post-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 2387 | ), |
| 2388 | ) |
| 2389 | ); |
| 2390 | |
| 2391 | $this->end_controls_tab(); |
| 2392 | |
| 2393 | $this->start_controls_tab( |
| 2394 | 'post_box_hover', |
| 2395 | array( |
| 2396 | 'label' => __( 'Hover', 'premium-addons-for-elementor' ), |
| 2397 | ) |
| 2398 | ); |
| 2399 | |
| 2400 | $this->add_group_control( |
| 2401 | Premium_Background::get_type(), |
| 2402 | array( |
| 2403 | 'name' => 'post_background_hover', |
| 2404 | 'types' => array( 'classic', 'gradient' ), |
| 2405 | 'selector' => '{{WRAPPER}} .premium-search__post-inner:hover', |
| 2406 | ) |
| 2407 | ); |
| 2408 | |
| 2409 | $this->add_group_control( |
| 2410 | Group_Control_Border::get_type(), |
| 2411 | array( |
| 2412 | 'name' => 'post_border_hover', |
| 2413 | 'selector' => '{{WRAPPER}} .premium-search__post-inner:hover', |
| 2414 | ) |
| 2415 | ); |
| 2416 | |
| 2417 | $this->add_control( |
| 2418 | 'post_border_radius_hover', |
| 2419 | array( |
| 2420 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2421 | 'type' => Controls_Manager::DIMENSIONS, |
| 2422 | 'size_units' => array( 'px', '%', 'em' ), |
| 2423 | 'selectors' => array( |
| 2424 | '{{WRAPPER}} .premium-search__post-inner:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2425 | ), |
| 2426 | ) |
| 2427 | ); |
| 2428 | |
| 2429 | $this->add_group_control( |
| 2430 | Group_Control_Box_Shadow::get_type(), |
| 2431 | array( |
| 2432 | 'name' => 'post_box_shadow_hover', |
| 2433 | 'selector' => '{{WRAPPER}} .premium-search__post-inner:hover', |
| 2434 | ) |
| 2435 | ); |
| 2436 | |
| 2437 | $this->add_responsive_control( |
| 2438 | 'post_box_padding_hover', |
| 2439 | array( |
| 2440 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2441 | 'type' => Controls_Manager::DIMENSIONS, |
| 2442 | 'size_units' => array( 'px', 'em', '%' ), |
| 2443 | 'selectors' => array( |
| 2444 | '{{WRAPPER}} .premium-search__post-inner:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 2445 | ), |
| 2446 | ) |
| 2447 | ); |
| 2448 | |
| 2449 | $this->end_controls_tab(); |
| 2450 | |
| 2451 | $this->end_controls_tabs(); |
| 2452 | |
| 2453 | $this->end_controls_section(); |
| 2454 | |
| 2455 | $this->start_controls_section( |
| 2456 | 'content_style_section', |
| 2457 | array( |
| 2458 | 'label' => __( 'Content Box', 'premium-addons-for-elementor' ), |
| 2459 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2460 | 'condition' => array( |
| 2461 | 'query_type' => 'post', |
| 2462 | 'skin' => 'banner', |
| 2463 | ), |
| 2464 | ) |
| 2465 | ); |
| 2466 | |
| 2467 | $this->add_group_control( |
| 2468 | Premium_Background::get_type(), |
| 2469 | array( |
| 2470 | 'name' => 'content_background_color', |
| 2471 | 'types' => array( 'classic', 'gradient' ), |
| 2472 | 'selector' => '{{WRAPPER}} .premium-search__post-content', |
| 2473 | ) |
| 2474 | ); |
| 2475 | |
| 2476 | $this->add_responsive_control( |
| 2477 | 'content_margin', |
| 2478 | array( |
| 2479 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2480 | 'type' => Controls_Manager::DIMENSIONS, |
| 2481 | 'size_units' => array( 'px', 'em', '%' ), |
| 2482 | 'selectors' => array( |
| 2483 | '{{WRAPPER}} .premium-search__post-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2484 | ), |
| 2485 | ) |
| 2486 | ); |
| 2487 | |
| 2488 | $this->add_responsive_control( |
| 2489 | 'content_padding', |
| 2490 | array( |
| 2491 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2492 | 'type' => Controls_Manager::DIMENSIONS, |
| 2493 | 'size_units' => array( 'px', 'em', '%' ), |
| 2494 | 'selectors' => array( |
| 2495 | '{{WRAPPER}} .premium-search__post-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2496 | ), |
| 2497 | ) |
| 2498 | ); |
| 2499 | |
| 2500 | $this->end_controls_section(); |
| 2501 | |
| 2502 | $this->start_controls_section( |
| 2503 | 'readmore_style_section', |
| 2504 | array( |
| 2505 | 'label' => __( 'Read More', 'premium-addons-for-elementor' ), |
| 2506 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2507 | 'condition' => array( |
| 2508 | 'query_type' => 'post', |
| 2509 | 'show_excerpt' => 'yes', |
| 2510 | 'excerpt_type' => 'link', |
| 2511 | ), |
| 2512 | ) |
| 2513 | ); |
| 2514 | |
| 2515 | $this->add_control( |
| 2516 | 'readmore_color', |
| 2517 | array( |
| 2518 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2519 | 'type' => Controls_Manager::COLOR, |
| 2520 | 'selectors' => array( |
| 2521 | '{{WRAPPER}} .premium-search-excerpt-link' => 'color: {{VALUE}};', |
| 2522 | ), |
| 2523 | ) |
| 2524 | ); |
| 2525 | |
| 2526 | $this->add_control( |
| 2527 | 'readmore_hover_color', |
| 2528 | array( |
| 2529 | 'label' => __( 'Hover Color', 'premium-addons-for-elementor' ), |
| 2530 | 'type' => Controls_Manager::COLOR, |
| 2531 | 'selectors' => array( |
| 2532 | '{{WRAPPER}} .premium-search-excerpt-link:hover' => 'color: {{VALUE}};', |
| 2533 | ), |
| 2534 | ) |
| 2535 | ); |
| 2536 | |
| 2537 | $this->add_group_control( |
| 2538 | Group_Control_Typography::get_type(), |
| 2539 | array( |
| 2540 | 'name' => 'readmore_typo', |
| 2541 | 'selector' => '{{WRAPPER}} .premium-search-excerpt-link', |
| 2542 | ) |
| 2543 | ); |
| 2544 | |
| 2545 | $this->add_responsive_control( |
| 2546 | 'readmore_spacing', |
| 2547 | array( |
| 2548 | 'label' => __( 'Spacing', 'premium-addons-for-elementor' ), |
| 2549 | 'type' => Controls_Manager::SLIDER, |
| 2550 | 'selectors' => array( |
| 2551 | '{{WRAPPER}} .premium-search-excerpt-link-wrap' => 'margin-top: {{SIZE}}px', |
| 2552 | ), |
| 2553 | ) |
| 2554 | ); |
| 2555 | |
| 2556 | $this->end_controls_section(); |
| 2557 | |
| 2558 | $this->start_controls_section( |
| 2559 | 'results_number_style_section', |
| 2560 | array( |
| 2561 | 'label' => __( 'Results Number', 'premium-addons-for-elementor' ), |
| 2562 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2563 | 'condition' => array( |
| 2564 | 'query_type' => 'post', |
| 2565 | 'show_results_number' => 'yes', |
| 2566 | ), |
| 2567 | ) |
| 2568 | ); |
| 2569 | |
| 2570 | $this->add_control( |
| 2571 | 'results_color', |
| 2572 | array( |
| 2573 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2574 | 'type' => Controls_Manager::COLOR, |
| 2575 | 'global' => array( |
| 2576 | 'default' => Global_Colors::COLOR_TEXT, |
| 2577 | ), |
| 2578 | 'selectors' => array( |
| 2579 | '{{WRAPPER}} .premium-search__results-number span' => 'color: {{VALUE}};', |
| 2580 | ), |
| 2581 | ) |
| 2582 | ); |
| 2583 | |
| 2584 | $this->add_group_control( |
| 2585 | Group_Control_Typography::get_type(), |
| 2586 | array( |
| 2587 | 'name' => 'results_typo', |
| 2588 | 'selector' => '{{WRAPPER}} .premium-search__results-number span', |
| 2589 | ) |
| 2590 | ); |
| 2591 | |
| 2592 | $this->add_responsive_control( |
| 2593 | 'results_spacing', |
| 2594 | array( |
| 2595 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2596 | 'type' => Controls_Manager::DIMENSIONS, |
| 2597 | 'size_units' => array( 'px', 'em', '%' ), |
| 2598 | 'selectors' => array( |
| 2599 | '{{WRAPPER}} .premium-search__results-number' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 2600 | ), |
| 2601 | ) |
| 2602 | ); |
| 2603 | |
| 2604 | $this->end_controls_section(); |
| 2605 | |
| 2606 | $this->start_controls_section( |
| 2607 | 'posts_container_style', |
| 2608 | array( |
| 2609 | 'label' => __( 'Posts Container', 'premium-addons-for-elementor' ), |
| 2610 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2611 | 'condition' => array( |
| 2612 | 'query_type' => 'post', |
| 2613 | ), |
| 2614 | ) |
| 2615 | ); |
| 2616 | |
| 2617 | $this->add_responsive_control( |
| 2618 | 'posts_container_max_height', |
| 2619 | array( |
| 2620 | 'label' => __( 'Maximum Height', 'premium-addons-for-elementor' ), |
| 2621 | 'type' => Controls_Manager::SLIDER, |
| 2622 | 'size_units' => array( 'px', 'em', 'vh', 'custom' ), |
| 2623 | 'range' => array( |
| 2624 | 'px' => array( |
| 2625 | 'min' => 50, |
| 2626 | 'max' => 600, |
| 2627 | ), |
| 2628 | 'em' => array( |
| 2629 | 'min' => 1, |
| 2630 | 'max' => 50, |
| 2631 | ), |
| 2632 | ), |
| 2633 | 'label_block' => true, |
| 2634 | 'selectors' => array( |
| 2635 | '{{WRAPPER}} .premium-search__posts-wrap' => 'max-height: {{SIZE}}{{UNIT}};', |
| 2636 | ), |
| 2637 | 'condition' => array( |
| 2638 | 'query_type' => 'post', |
| 2639 | 'carousel!' => 'yes', |
| 2640 | ), |
| 2641 | ) |
| 2642 | ); |
| 2643 | |
| 2644 | $this->add_group_control( |
| 2645 | Premium_Background::get_type(), |
| 2646 | array( |
| 2647 | 'name' => 'posts_container_background', |
| 2648 | 'types' => array( 'classic', 'gradient' ), |
| 2649 | 'selector' => '{{WRAPPER}} .premium-search__query-wrap', |
| 2650 | ) |
| 2651 | ); |
| 2652 | |
| 2653 | $this->add_group_control( |
| 2654 | Group_Control_Border::get_type(), |
| 2655 | array( |
| 2656 | 'name' => 'posts_container_border', |
| 2657 | 'selector' => '{{WRAPPER}} .premium-search__query-wrap', |
| 2658 | ) |
| 2659 | ); |
| 2660 | |
| 2661 | $this->add_control( |
| 2662 | 'posts_container_border_radius', |
| 2663 | array( |
| 2664 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2665 | 'type' => Controls_Manager::SLIDER, |
| 2666 | 'size_units' => array( 'px', '%', 'em' ), |
| 2667 | 'selectors' => array( |
| 2668 | '{{WRAPPER}} .premium-search__query-wrap' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2669 | ), |
| 2670 | ) |
| 2671 | ); |
| 2672 | |
| 2673 | $this->add_group_control( |
| 2674 | Group_Control_Box_Shadow::get_type(), |
| 2675 | array( |
| 2676 | 'name' => 'posts_container_shadow', |
| 2677 | 'selector' => '{{WRAPPER}} .premium-search__query-wrap', |
| 2678 | ) |
| 2679 | ); |
| 2680 | |
| 2681 | $this->add_responsive_control( |
| 2682 | 'posts_container_margin', |
| 2683 | array( |
| 2684 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2685 | 'type' => Controls_Manager::DIMENSIONS, |
| 2686 | 'size_units' => array( 'px', 'em', '%' ), |
| 2687 | 'selectors' => array( |
| 2688 | '{{WRAPPER}} .premium-search__query-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 2689 | ), |
| 2690 | ) |
| 2691 | ); |
| 2692 | |
| 2693 | $this->add_responsive_control( |
| 2694 | 'posts_container_padding', |
| 2695 | array( |
| 2696 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2697 | 'type' => Controls_Manager::DIMENSIONS, |
| 2698 | 'size_units' => array( 'px', 'em', '%' ), |
| 2699 | 'selectors' => array( |
| 2700 | '{{WRAPPER}} .premium-search__query-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 2701 | ), |
| 2702 | ) |
| 2703 | ); |
| 2704 | |
| 2705 | $this->end_controls_section(); |
| 2706 | |
| 2707 | $this->start_controls_section( |
| 2708 | 'pagination_style_section', |
| 2709 | array( |
| 2710 | 'label' => __( 'Pagination', 'premium-addons-for-elementor' ), |
| 2711 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2712 | 'condition' => array( |
| 2713 | 'query_type' => 'post', |
| 2714 | 'premium_blog_paging' => 'yes', |
| 2715 | ), |
| 2716 | ) |
| 2717 | ); |
| 2718 | |
| 2719 | $this->add_group_control( |
| 2720 | Group_Control_Typography::get_type(), |
| 2721 | array( |
| 2722 | 'name' => 'pagination_typo', |
| 2723 | 'selector' => '{{WRAPPER}} .premium-search-form__pagination-container > .page-numbers', |
| 2724 | ) |
| 2725 | ); |
| 2726 | |
| 2727 | $this->start_controls_tabs( 'pagination_style_tabs' ); |
| 2728 | |
| 2729 | $this->start_controls_tab( |
| 2730 | 'pagination_nomral_tab', |
| 2731 | array( |
| 2732 | 'label' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 2733 | |
| 2734 | ) |
| 2735 | ); |
| 2736 | |
| 2737 | $this->add_control( |
| 2738 | 'pagination_color', |
| 2739 | array( |
| 2740 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2741 | 'type' => Controls_Manager::COLOR, |
| 2742 | 'selectors' => array( |
| 2743 | '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers' => 'color: {{VALUE}};', |
| 2744 | ), |
| 2745 | ) |
| 2746 | ); |
| 2747 | |
| 2748 | $this->add_control( |
| 2749 | 'pagination_back_color', |
| 2750 | array( |
| 2751 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2752 | 'type' => Controls_Manager::COLOR, |
| 2753 | 'selectors' => array( |
| 2754 | '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers' => 'background-color: {{VALUE}};', |
| 2755 | ), |
| 2756 | ) |
| 2757 | ); |
| 2758 | |
| 2759 | $this->add_group_control( |
| 2760 | Group_Control_Border::get_type(), |
| 2761 | array( |
| 2762 | 'name' => 'navigation_border', |
| 2763 | 'separator' => 'before', |
| 2764 | 'selector' => '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers', |
| 2765 | ) |
| 2766 | ); |
| 2767 | |
| 2768 | $this->add_control( |
| 2769 | 'navigation_border_radius', |
| 2770 | array( |
| 2771 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2772 | 'type' => Controls_Manager::SLIDER, |
| 2773 | 'size_units' => array( 'px', '%', 'em' ), |
| 2774 | 'selectors' => array( |
| 2775 | '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2776 | ), |
| 2777 | 'condition' => array( |
| 2778 | 'navigation_adv_radius!' => 'yes', |
| 2779 | ), |
| 2780 | ) |
| 2781 | ); |
| 2782 | |
| 2783 | $this->add_control( |
| 2784 | 'navigation_adv_radius', |
| 2785 | array( |
| 2786 | 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ), |
| 2787 | 'type' => Controls_Manager::SWITCHER, |
| 2788 | 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>', |
| 2789 | ) |
| 2790 | ); |
| 2791 | |
| 2792 | $this->add_control( |
| 2793 | 'navigation_adv_radius_value', |
| 2794 | array( |
| 2795 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2796 | 'type' => Controls_Manager::TEXT, |
| 2797 | 'dynamic' => array( 'active' => true ), |
| 2798 | 'selectors' => array( |
| 2799 | '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers' => 'border-radius: {{VALUE}};', |
| 2800 | ), |
| 2801 | 'condition' => array( |
| 2802 | 'navigation_adv_radius' => 'yes', |
| 2803 | ), |
| 2804 | 'ai' => array( |
| 2805 | 'active' => false, |
| 2806 | ), |
| 2807 | ) |
| 2808 | ); |
| 2809 | |
| 2810 | $this->end_controls_tab(); |
| 2811 | |
| 2812 | $this->start_controls_tab( |
| 2813 | 'pagination_hover_tab', |
| 2814 | array( |
| 2815 | 'label' => __( 'Hover', 'premium-addons-for-elementor' ), |
| 2816 | |
| 2817 | ) |
| 2818 | ); |
| 2819 | |
| 2820 | $this->add_control( |
| 2821 | 'pagination_hover_color', |
| 2822 | array( |
| 2823 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2824 | 'type' => Controls_Manager::COLOR, |
| 2825 | 'selectors' => array( |
| 2826 | '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers:hover' => 'color: {{VALUE}};', |
| 2827 | ), |
| 2828 | ) |
| 2829 | ); |
| 2830 | |
| 2831 | $this->add_control( |
| 2832 | 'pagination_back_hover_color', |
| 2833 | array( |
| 2834 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2835 | 'type' => Controls_Manager::COLOR, |
| 2836 | 'selectors' => array( |
| 2837 | '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers:hover' => 'background-color: {{VALUE}};', |
| 2838 | ), |
| 2839 | ) |
| 2840 | ); |
| 2841 | |
| 2842 | $this->add_group_control( |
| 2843 | Group_Control_Border::get_type(), |
| 2844 | array( |
| 2845 | 'name' => 'hover_navigation_border', |
| 2846 | 'separator' => 'before', |
| 2847 | 'selector' => '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers:hover', |
| 2848 | ) |
| 2849 | ); |
| 2850 | |
| 2851 | $this->add_control( |
| 2852 | 'hover_navigation_border_radius', |
| 2853 | array( |
| 2854 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2855 | 'type' => Controls_Manager::SLIDER, |
| 2856 | 'size_units' => array( 'px', '%', 'em' ), |
| 2857 | 'selectors' => array( |
| 2858 | '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers:hover' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2859 | ), |
| 2860 | 'condition' => array( |
| 2861 | 'hover_navigation_adv_radius!' => 'yes', |
| 2862 | ), |
| 2863 | ) |
| 2864 | ); |
| 2865 | |
| 2866 | $this->add_control( |
| 2867 | 'hover_navigation_adv_radius', |
| 2868 | array( |
| 2869 | 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ), |
| 2870 | 'type' => Controls_Manager::SWITCHER, |
| 2871 | 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>', |
| 2872 | ) |
| 2873 | ); |
| 2874 | |
| 2875 | $this->add_control( |
| 2876 | 'hover_navigation_adv_radius_value', |
| 2877 | array( |
| 2878 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2879 | 'type' => Controls_Manager::TEXT, |
| 2880 | 'dynamic' => array( 'active' => true ), |
| 2881 | 'selectors' => array( |
| 2882 | '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers:hover' => 'border-radius: {{VALUE}};', |
| 2883 | ), |
| 2884 | 'condition' => array( |
| 2885 | 'hover_navigation_adv_radius' => 'yes', |
| 2886 | ), |
| 2887 | 'ai' => array( |
| 2888 | 'active' => false, |
| 2889 | ), |
| 2890 | ) |
| 2891 | ); |
| 2892 | |
| 2893 | $this->end_controls_tab(); |
| 2894 | |
| 2895 | $this->start_controls_tab( |
| 2896 | 'pagination_active_tab', |
| 2897 | array( |
| 2898 | 'label' => __( 'Active', 'premium-addons-for-elementor' ), |
| 2899 | |
| 2900 | ) |
| 2901 | ); |
| 2902 | |
| 2903 | $this->add_control( |
| 2904 | 'pagination_active_color', |
| 2905 | array( |
| 2906 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2907 | 'type' => Controls_Manager::COLOR, |
| 2908 | 'selectors' => array( |
| 2909 | '{{WRAPPER}} .premium-search-form__pagination-container span.current' => 'color: {{VALUE}};', |
| 2910 | ), |
| 2911 | ) |
| 2912 | ); |
| 2913 | |
| 2914 | $this->add_control( |
| 2915 | 'pagination_back_active_color', |
| 2916 | array( |
| 2917 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2918 | 'type' => Controls_Manager::COLOR, |
| 2919 | 'selectors' => array( |
| 2920 | '{{WRAPPER}} .premium-search-form__pagination-container span.current' => 'background-color: {{VALUE}};', |
| 2921 | ), |
| 2922 | ) |
| 2923 | ); |
| 2924 | |
| 2925 | $this->add_group_control( |
| 2926 | Group_Control_Border::get_type(), |
| 2927 | array( |
| 2928 | 'name' => 'active_navigation_border', |
| 2929 | 'separator' => 'before', |
| 2930 | 'selector' => '{{WRAPPER}} .premium-search-form__pagination-container span.current', |
| 2931 | ) |
| 2932 | ); |
| 2933 | |
| 2934 | $this->add_control( |
| 2935 | 'active_navigation_border_radius', |
| 2936 | array( |
| 2937 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2938 | 'type' => Controls_Manager::SLIDER, |
| 2939 | 'size_units' => array( 'px', '%', 'em' ), |
| 2940 | 'selectors' => array( |
| 2941 | '{{WRAPPER}} .premium-search-form__pagination-container span.current' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2942 | ), |
| 2943 | 'condition' => array( |
| 2944 | 'active_navigation_adv_radius!' => 'yes', |
| 2945 | ), |
| 2946 | ) |
| 2947 | ); |
| 2948 | |
| 2949 | $this->add_control( |
| 2950 | 'active_navigation_adv_radius', |
| 2951 | array( |
| 2952 | 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ), |
| 2953 | 'type' => Controls_Manager::SWITCHER, |
| 2954 | 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>', |
| 2955 | ) |
| 2956 | ); |
| 2957 | |
| 2958 | $this->add_control( |
| 2959 | 'active_navigation_adv_radius_value', |
| 2960 | array( |
| 2961 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2962 | 'type' => Controls_Manager::TEXT, |
| 2963 | 'dynamic' => array( 'active' => true ), |
| 2964 | 'selectors' => array( |
| 2965 | '{{WRAPPER}} .premium-search-form__pagination-container span.current' => 'border-radius: {{VALUE}};', |
| 2966 | ), |
| 2967 | 'condition' => array( |
| 2968 | 'active_navigation_adv_radius' => 'yes', |
| 2969 | ), |
| 2970 | 'ai' => array( |
| 2971 | 'active' => false, |
| 2972 | ), |
| 2973 | ) |
| 2974 | ); |
| 2975 | |
| 2976 | $this->end_controls_tab(); |
| 2977 | |
| 2978 | $this->end_controls_tabs(); |
| 2979 | |
| 2980 | $this->add_responsive_control( |
| 2981 | 'pagination_margin', |
| 2982 | array( |
| 2983 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2984 | 'type' => Controls_Manager::DIMENSIONS, |
| 2985 | 'size_units' => array( 'px', 'em', '%' ), |
| 2986 | 'separator' => 'before', |
| 2987 | 'selectors' => array( |
| 2988 | '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2989 | ), |
| 2990 | ) |
| 2991 | ); |
| 2992 | |
| 2993 | $this->add_responsive_control( |
| 2994 | 'pagination_padding', |
| 2995 | array( |
| 2996 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2997 | 'type' => Controls_Manager::DIMENSIONS, |
| 2998 | 'size_units' => array( 'px', 'em', '%' ), |
| 2999 | 'selectors' => array( |
| 3000 | '{{WRAPPER}} .premium-search-form__pagination-container .page-numbers' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3001 | ), |
| 3002 | ) |
| 3003 | ); |
| 3004 | |
| 3005 | $this->add_control( |
| 3006 | 'pagination_overlay_color', |
| 3007 | array( |
| 3008 | 'label' => __( 'Overlay Color', 'premium-addons-for-elementor' ), |
| 3009 | 'type' => Controls_Manager::COLOR, |
| 3010 | 'separator' => 'before', |
| 3011 | 'selectors' => array( |
| 3012 | '{{WRAPPER}} .premium-search__query-wrap .premium-loading-feed' => 'background-color: {{VALUE}}', |
| 3013 | ), |
| 3014 | ) |
| 3015 | ); |
| 3016 | |
| 3017 | $this->add_control( |
| 3018 | 'pagination_spinner_color', |
| 3019 | array( |
| 3020 | 'label' => __( 'Spinner Color', 'premium-addons-for-elementor' ), |
| 3021 | 'type' => Controls_Manager::COLOR, |
| 3022 | 'selectors' => array( |
| 3023 | '{{WRAPPER}} .premium-search__query-wrap .premium-loader' => 'border-color: {{VALUE}}', |
| 3024 | ), |
| 3025 | ) |
| 3026 | ); |
| 3027 | |
| 3028 | $this->add_control( |
| 3029 | 'pagination_spinner_fill_color', |
| 3030 | array( |
| 3031 | 'label' => __( 'Fill Color', 'premium-addons-for-elementor' ), |
| 3032 | 'type' => Controls_Manager::COLOR, |
| 3033 | 'selectors' => array( |
| 3034 | '{{WRAPPER}} .premium-search__query-wrap .premium-loader' => 'border-top-color: {{VALUE}}', |
| 3035 | ), |
| 3036 | ) |
| 3037 | ); |
| 3038 | |
| 3039 | $this->end_controls_section(); |
| 3040 | |
| 3041 | $this->start_controls_section( |
| 3042 | 'carousel_dots_style', |
| 3043 | array( |
| 3044 | 'label' => __( 'Carousel Dots', 'premium-addons-for-elementor' ), |
| 3045 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3046 | 'condition' => array( |
| 3047 | 'query_type' => 'post', |
| 3048 | 'carousel' => 'yes', |
| 3049 | ), |
| 3050 | ) |
| 3051 | ); |
| 3052 | |
| 3053 | $this->add_control( |
| 3054 | 'carousel_dot_color', |
| 3055 | array( |
| 3056 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 3057 | 'type' => Controls_Manager::COLOR, |
| 3058 | 'global' => array( |
| 3059 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 3060 | ), |
| 3061 | 'selectors' => array( |
| 3062 | '{{WRAPPER}} ul.slick-dots li' => 'color: {{VALUE}}', |
| 3063 | ), |
| 3064 | ) |
| 3065 | ); |
| 3066 | |
| 3067 | $this->add_control( |
| 3068 | 'carousel_dot_active_color', |
| 3069 | array( |
| 3070 | 'label' => __( 'Active Color', 'premium-addons-for-elementor' ), |
| 3071 | 'type' => Controls_Manager::COLOR, |
| 3072 | 'global' => array( |
| 3073 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 3074 | ), |
| 3075 | 'selectors' => array( |
| 3076 | '{{WRAPPER}} ul.slick-dots li.slick-active' => 'color: {{VALUE}}', |
| 3077 | ), |
| 3078 | ) |
| 3079 | ); |
| 3080 | |
| 3081 | $this->end_controls_section(); |
| 3082 | |
| 3083 | $this->start_controls_section( |
| 3084 | 'carousel_arrows_style', |
| 3085 | array( |
| 3086 | 'label' => __( 'Carousel Arrows', 'premium-addons-for-elementor' ), |
| 3087 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3088 | 'condition' => array( |
| 3089 | 'query_type' => 'post', |
| 3090 | 'carousel' => 'yes', |
| 3091 | ), |
| 3092 | ) |
| 3093 | ); |
| 3094 | |
| 3095 | $this->add_control( |
| 3096 | 'arrow_color', |
| 3097 | array( |
| 3098 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 3099 | 'type' => Controls_Manager::COLOR, |
| 3100 | 'global' => array( |
| 3101 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 3102 | ), |
| 3103 | 'selectors' => array( |
| 3104 | '{{WRAPPER}} .premium-search__query-wrap .slick-arrow' => 'color: {{VALUE}};', |
| 3105 | ), |
| 3106 | ) |
| 3107 | ); |
| 3108 | |
| 3109 | $this->add_responsive_control( |
| 3110 | 'carousel_arrow_size', |
| 3111 | array( |
| 3112 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 3113 | 'type' => Controls_Manager::SLIDER, |
| 3114 | 'size_units' => array( 'px', '%', 'em' ), |
| 3115 | 'selectors' => array( |
| 3116 | '{{WRAPPER}} .premium-search__query-wrap .slick-arrow i' => 'font-size: {{SIZE}}{{UNIT}};', |
| 3117 | ), |
| 3118 | ) |
| 3119 | ); |
| 3120 | |
| 3121 | $this->add_control( |
| 3122 | 'carousel_arrow_background', |
| 3123 | array( |
| 3124 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 3125 | 'type' => Controls_Manager::COLOR, |
| 3126 | 'global' => array( |
| 3127 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 3128 | ), |
| 3129 | 'selectors' => array( |
| 3130 | '{{WRAPPER}} .premium-search__query-wrap .slick-arrow' => 'background-color: {{VALUE}};', |
| 3131 | ), |
| 3132 | ) |
| 3133 | ); |
| 3134 | |
| 3135 | $this->add_control( |
| 3136 | 'carousel_border_radius', |
| 3137 | array( |
| 3138 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 3139 | 'type' => Controls_Manager::SLIDER, |
| 3140 | 'size_units' => array( 'px', '%', 'em' ), |
| 3141 | 'selectors' => array( |
| 3142 | '{{WRAPPER}} .premium-search__query-wrap .slick-arrow' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 3143 | ), |
| 3144 | ) |
| 3145 | ); |
| 3146 | |
| 3147 | $this->add_control( |
| 3148 | 'carousel_arrow_padding', |
| 3149 | array( |
| 3150 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 3151 | 'type' => Controls_Manager::SLIDER, |
| 3152 | 'size_units' => array( 'px', '%', 'em' ), |
| 3153 | 'selectors' => array( |
| 3154 | '{{WRAPPER}} .premium-search__query-wrap .slick-arrow' => 'padding: {{SIZE}}{{UNIT}};', |
| 3155 | ), |
| 3156 | ) |
| 3157 | ); |
| 3158 | |
| 3159 | $this->add_responsive_control( |
| 3160 | 'carousel_arrow_margin', |
| 3161 | array( |
| 3162 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 3163 | 'type' => Controls_Manager::DIMENSIONS, |
| 3164 | 'size_units' => array( 'px', 'em', '%' ), |
| 3165 | 'selectors' => array( |
| 3166 | '{{WRAPPER}} .premium-search__query-wrap .slick-arrow' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', |
| 3167 | ), |
| 3168 | ) |
| 3169 | ); |
| 3170 | |
| 3171 | $this->end_controls_section(); |
| 3172 | |
| 3173 | $this->start_controls_section( |
| 3174 | 'spinner_style', |
| 3175 | array( |
| 3176 | 'label' => __( 'Spinner', 'premium-addons-for-elementor' ), |
| 3177 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3178 | ) |
| 3179 | ); |
| 3180 | |
| 3181 | $this->add_responsive_control( |
| 3182 | 'spinner_size', |
| 3183 | array( |
| 3184 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 3185 | 'type' => Controls_Manager::SLIDER, |
| 3186 | 'size_units' => array( 'px', 'em' ), |
| 3187 | 'selectors' => array( |
| 3188 | '{{WRAPPER}} .premium-search__spinner .premium-loader' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}', |
| 3189 | ), |
| 3190 | ) |
| 3191 | ); |
| 3192 | |
| 3193 | $this->add_control( |
| 3194 | 'spinner_color', |
| 3195 | array( |
| 3196 | 'label' => __( 'Spinner Color', 'premium-addons-for-elementor' ), |
| 3197 | 'type' => Controls_Manager::COLOR, |
| 3198 | 'selectors' => array( |
| 3199 | '{{WRAPPER}} .premium-search__spinner .premium-loader' => 'border-color: {{VALUE}}', |
| 3200 | ), |
| 3201 | ) |
| 3202 | ); |
| 3203 | |
| 3204 | $this->add_control( |
| 3205 | 'spinner_fill_color', |
| 3206 | array( |
| 3207 | 'label' => __( 'Fill Color', 'premium-addons-for-elementor' ), |
| 3208 | 'type' => Controls_Manager::COLOR, |
| 3209 | 'selectors' => array( |
| 3210 | '{{WRAPPER}} .premium-search__spinner .premium-loader' => 'border-top-color: {{VALUE}}', |
| 3211 | ), |
| 3212 | ) |
| 3213 | ); |
| 3214 | |
| 3215 | $this->add_responsive_control( |
| 3216 | 'spinner_offset', |
| 3217 | array( |
| 3218 | 'label' => __( 'Offset', 'premium-addons-for-elementor' ), |
| 3219 | 'type' => Controls_Manager::SLIDER, |
| 3220 | 'size_units' => array( 'px', 'em', '%' ), |
| 3221 | 'selectors' => array( |
| 3222 | '{{WRAPPER}} .premium-search__spinner' => 'right: {{SIZE}}{{UNIT}}', |
| 3223 | ), |
| 3224 | ) |
| 3225 | ); |
| 3226 | |
| 3227 | $this->end_controls_section(); |
| 3228 | } |
| 3229 | |
| 3230 | /** |
| 3231 | * Render Search Form widget output on the frontend. |
| 3232 | * |
| 3233 | * Written in PHP and used to generate the final HTML. |
| 3234 | * |
| 3235 | * @since 1.0.0 |
| 3236 | * @access protected |
| 3237 | */ |
| 3238 | protected function render() { |
| 3239 | |
| 3240 | $settings = $this->get_settings_for_display(); |
| 3241 | |
| 3242 | $papro_activated = Helper_Functions::check_papro_version(); |
| 3243 | |
| 3244 | if ( ! $papro_activated || version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.9.15', '<' ) ) { |
| 3245 | |
| 3246 | if ( 'elements' === $settings['query_type'] || 'yes' === $settings['remove_button_switcher'] || 'yes' === $settings['type_select'] || ( '' !== $settings['field_effects'] && 'yes' === $settings['show_label'] ) ) { |
| 3247 | |
| 3248 | ?> |
| 3249 | <div class="premium-error-notice"> |
| 3250 | <?php |
| 3251 | $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' ); |
| 3252 | echo wp_kses_post( $message ); |
| 3253 | ?> |
| 3254 | </div> |
| 3255 | <?php |
| 3256 | return false; |
| 3257 | |
| 3258 | } |
| 3259 | } |
| 3260 | |
| 3261 | $this->add_render_attribute( |
| 3262 | 'search_input', |
| 3263 | array( |
| 3264 | 'id' => 'premium-search__input-' . $this->get_id(), |
| 3265 | 'type' => 'text', |
| 3266 | 'class' => 'premium-search__input', |
| 3267 | 'value' => '', |
| 3268 | 'placeholder' => esc_attr( $settings['placeholder_text'] ), |
| 3269 | ) |
| 3270 | ); |
| 3271 | |
| 3272 | $search_settings = array( |
| 3273 | 'query' => $settings['query_type'], |
| 3274 | ); |
| 3275 | |
| 3276 | if ( 'redirect' === $settings['button_action'] ) { |
| 3277 | $search_settings['search_link'] = esc_url( $settings['search_page_link'] ); |
| 3278 | } |
| 3279 | |
| 3280 | if ( 'elements' === $settings['query_type'] ) { |
| 3281 | $search_settings['target'] = esc_attr( $settings['selector'] ); |
| 3282 | $search_settings['fadeout_target'] = esc_attr( $settings['fadeout_selector'] ); |
| 3283 | } else { |
| 3284 | |
| 3285 | $search_settings['hideOnClick'] = 'yes' === $settings['hide_on_click']; |
| 3286 | $search_settings['results_number'] = 'yes' === $settings['show_results_number']; |
| 3287 | $search_settings['buttonAction'] = $settings['button_action']; |
| 3288 | // Add page ID to be used later to get posts by AJAX. |
| 3289 | $page_id = ''; |
| 3290 | if ( null !== Plugin::$instance->documents->get_current() ) { |
| 3291 | $page_id = Plugin::$instance->documents->get_current()->get_main_id(); |
| 3292 | } |
| 3293 | $this->add_render_attribute( 'container', 'data-page', $page_id ); |
| 3294 | |
| 3295 | if ( 'yes' === $settings['carousel'] ) { |
| 3296 | |
| 3297 | $search_settings['carousel'] = true; |
| 3298 | $search_settings['slidesToScroll'] = $settings['slides_to_scroll']; |
| 3299 | $search_settings['rows'] = $settings['rows']; |
| 3300 | $search_settings['spacing'] = $settings['carousel_spacing']; |
| 3301 | $search_settings['arrows'] = 'yes' === $settings['carousel_arrows']; |
| 3302 | $search_settings['fade'] = 'yes' === $settings['carousel_fade']; |
| 3303 | $search_settings['center'] = 'yes' === $settings['carousel_center']; |
| 3304 | $search_settings['dots'] = 'yes' === $settings['carousel_dots']; |
| 3305 | $search_settings['speed'] = '' !== $settings['carousel_speed'] ? $settings['carousel_speed'] : 300; |
| 3306 | |
| 3307 | } |
| 3308 | } |
| 3309 | |
| 3310 | $this->add_render_attribute( |
| 3311 | 'container', |
| 3312 | array( |
| 3313 | 'class' => array( |
| 3314 | 'premium-search__container', |
| 3315 | 'premium-search__skin-' . $settings['skin'], |
| 3316 | ), |
| 3317 | 'data-settings' => wp_json_encode( $search_settings ), |
| 3318 | ) |
| 3319 | ); |
| 3320 | |
| 3321 | ?> |
| 3322 | |
| 3323 | <div <?php $this->print_render_attribute_string( 'container' ); ?>> |
| 3324 | |
| 3325 | <?php if ( 'yes' === $settings['show_label'] ) : ?> |
| 3326 | <div class="premium-search__label-wrap"> |
| 3327 | <label for="<?php echo esc_attr( 'premium-search__input-' . $this->get_id() ); ?>" class="premium-search__label"><?php echo wp_kses_post( $settings['label_text'] ); ?></label> |
| 3328 | </div> |
| 3329 | <?php endif; ?> |
| 3330 | <div class="premium-search__input-btn-wrap"> |
| 3331 | |
| 3332 | <?php |
| 3333 | if ( 'yes' === $settings['type_select'] ) : |
| 3334 | $post_types = Blog_Helper::get_posts_types(); |
| 3335 | ?> |
| 3336 | <div class="premium-search__type-filter"> |
| 3337 | <select class="premium-search__type-select"> |
| 3338 | |
| 3339 | <option value="any"><?php echo __( 'All Posts', 'premium-addons-for-elementor' ); ?></option> |
| 3340 | <?php |
| 3341 | foreach ( $post_types as $id => $label ) : |
| 3342 | $count = wp_count_posts( $id )->publish; |
| 3343 | |
| 3344 | if ( $count < 1 ) { |
| 3345 | continue; |
| 3346 | } |
| 3347 | ?> |
| 3348 | <?php |
| 3349 | if ( ! in_array( $id, $settings['post_types_excluded'] ) ) : |
| 3350 | if ( 'yes' === $settings['show_posts_number'] ) { |
| 3351 | $label = $label . ' (' . $count . ')'; |
| 3352 | } |
| 3353 | ?> |
| 3354 | <option value="<?php echo esc_attr( $id ); ?>"><?php echo wp_kses_post( $label ); ?></option> |
| 3355 | <?php endif; ?> |
| 3356 | <?php endforeach; ?> |
| 3357 | </select> |
| 3358 | </div> |
| 3359 | <?php endif; ?> |
| 3360 | |
| 3361 | <div class="premium-search__input-wrap"> |
| 3362 | <input <?php $this->print_render_attribute_string( 'search_input' ); ?>> |
| 3363 | |
| 3364 | <div class="premium-search__spinner"></div> |
| 3365 | |
| 3366 | <?php if ( 'yes' === $settings['remove_button_switcher'] ) : ?> |
| 3367 | <div class="premium-search__remove-wrap premium-addons__v-hidden"> |
| 3368 | <i class="premium-search__remove-icon fa fa-close"></i> |
| 3369 | </div> |
| 3370 | <?php endif; ?> |
| 3371 | </div> |
| 3372 | |
| 3373 | <?php if ( 'yes' === $settings['search_button'] ) : ?> |
| 3374 | |
| 3375 | <div class="premium-search__btn-wrap"> |
| 3376 | <button type="button" class="premium-search__btn" value="" data-page-url=""> |
| 3377 | |
| 3378 | <?php if ( 'yes' === $settings['search_icon'] ) : ?> |
| 3379 | |
| 3380 | <?php |
| 3381 | Icons_Manager::render_icon( |
| 3382 | $settings['search_icon_select'], |
| 3383 | array( |
| 3384 | 'aria-hidden' => 'true', |
| 3385 | ) |
| 3386 | ); |
| 3387 | ?> |
| 3388 | |
| 3389 | <?php endif; ?> |
| 3390 | |
| 3391 | <?php if ( ! empty( $settings['button_text'] ) ) : ?> |
| 3392 | <span class="premium-search__btn-text"> |
| 3393 | <?php echo wp_kses_post( $settings['button_text'] ); ?> |
| 3394 | </span> |
| 3395 | <?php endif; ?> |
| 3396 | |
| 3397 | </button> |
| 3398 | </div> |
| 3399 | |
| 3400 | <?php endif; ?> |
| 3401 | |
| 3402 | </div> |
| 3403 | |
| 3404 | <?php if ( 'post' === $settings['query_type'] ) : ?> |
| 3405 | <div class="premium-search__query-wrap query-hidden"></div> |
| 3406 | <?php endif; ?> |
| 3407 | |
| 3408 | </div> |
| 3409 | |
| 3410 | <?php |
| 3411 | } |
| 3412 | } |
| 3413 |