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