Adv_Accordion.php
2 years ago
Adv_Tabs.php
2 years ago
Advanced_Data_Table.php
2 years ago
Better_Payment.php
4 years ago
Betterdocs_Category_Box.php
2 years ago
Betterdocs_Category_Grid.php
2 years ago
Betterdocs_Search_Form.php
2 years ago
Business_Reviews.php
2 years ago
Caldera_Forms.php
2 years ago
Career_Page.php
4 years ago
Contact_Form_7.php
2 years ago
Content_Ticker.php
2 years ago
Countdown.php
2 years ago
Creative_Button.php
2 years ago
Crowdfundly_All_Campaign.php
4 years ago
Crowdfundly_Organization.php
4 years ago
Crowdfundly_Single_Campaign.php
4 years ago
Cta_Box.php
2 years ago
Data_Table.php
2 years ago
Dual_Color_Header.php
2 years ago
EmbedPress.php
4 years ago
Event_Calendar.php
2 years ago
Facebook_Feed.php
2 years ago
Fancy_Text.php
2 years ago
Feature_List.php
2 years ago
Filterable_Gallery.php
2 years ago
Flip_Box.php
2 years ago
FluentForm.php
2 years ago
Formstack.php
2 years ago
GravityForms.php
2 years ago
Image_Accordion.php
2 years ago
Info_Box.php
2 years ago
Interactive_Circle.php
2 years ago
Login_Register.php
2 years ago
NFT_Gallery.php
2 years ago
NinjaForms.php
2 years ago
Post_Grid.php
2 years ago
Post_Timeline.php
2 years ago
Pricing_Table.php
2 years ago
Product_Grid.php
2 years ago
Progress_Bar.php
2 years ago
SVG_Draw.php
3 years ago
Simple_Menu.php
2 years ago
Sticky_Video.php
2 years ago
Team_Member.php
2 years ago
Testimonial.php
2 years ago
Tooltip.php
2 years ago
Twitter_Feed.php
2 years ago
TypeForm.php
2 years ago
WeForms.php
2 years ago
Woo_Cart.php
2 years ago
Woo_Checkout.php
2 years ago
Woo_Product_Carousel.php
2 years ago
Woo_Product_Compare.php
4 years ago
Woo_Product_Gallery.php
2 years ago
Woocommerce_Review.php
4 years ago
WpForms.php
2 years ago
index.php
3 years ago
Betterdocs_Search_Form.php
592 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Essential_Addons_Elementor\Elements; |
| 4 | |
| 5 | // If this file is called directly, abort. |
| 6 | if (!defined('ABSPATH')) { |
| 7 | exit; |
| 8 | } |
| 9 | |
| 10 | use \Elementor\Controls_Manager; |
| 11 | use \Elementor\Group_Control_Border; |
| 12 | use \Elementor\Group_Control_Box_Shadow; |
| 13 | use \Elementor\Group_Control_Typography; |
| 14 | use \Elementor\Group_Control_Background; |
| 15 | use \Elementor\Widget_Base; |
| 16 | |
| 17 | class Betterdocs_Search_Form extends Widget_Base |
| 18 | { |
| 19 | |
| 20 | |
| 21 | |
| 22 | public function get_name() |
| 23 | { |
| 24 | return 'eael-betterdocs-search-form'; |
| 25 | } |
| 26 | |
| 27 | public function get_title() |
| 28 | { |
| 29 | return __('BetterDocs Search Form', 'essential-addons-for-elementor-lite'); |
| 30 | } |
| 31 | |
| 32 | public function get_categories() |
| 33 | { |
| 34 | return ['essential-addons-elementor']; |
| 35 | } |
| 36 | |
| 37 | public function get_icon() |
| 38 | { |
| 39 | return 'eaicon-betterdocs-search-form'; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Get widget keywords. |
| 44 | * |
| 45 | * Retrieve the list of keywords the widget belongs to. |
| 46 | * |
| 47 | * @since 3.5.2 |
| 48 | * @access public |
| 49 | * |
| 50 | * @return array Widget keywords. |
| 51 | */ |
| 52 | public function get_keywords() |
| 53 | { |
| 54 | return [ |
| 55 | 'knowledgebase', |
| 56 | 'knowledge Base', |
| 57 | 'documentation', |
| 58 | 'doc', |
| 59 | 'kb', |
| 60 | 'betterdocs', |
| 61 | 'ea betterdocs', |
| 62 | 'search', |
| 63 | 'search form', |
| 64 | 'ea', |
| 65 | 'essential addons' |
| 66 | ]; |
| 67 | } |
| 68 | |
| 69 | public function get_custom_help_url() |
| 70 | { |
| 71 | return 'https://essential-addons.com/elementor/docs/betterdocs-search-form/'; |
| 72 | } |
| 73 | |
| 74 | protected function register_controls() |
| 75 | { |
| 76 | /*-----------------------------------------------------------------------------------*/ |
| 77 | /* Content Tab |
| 78 | /*-----------------------------------------------------------------------------------*/ |
| 79 | if (!defined('BETTERDOCS_URL')) { |
| 80 | $this->start_controls_section( |
| 81 | 'eael_global_warning', |
| 82 | [ |
| 83 | 'label' => __('Warning!', 'essential-addons-for-elementor-lite'), |
| 84 | ] |
| 85 | ); |
| 86 | |
| 87 | $this->add_control( |
| 88 | 'eael_global_warning_text', |
| 89 | [ |
| 90 | 'type' => Controls_Manager::RAW_HTML, |
| 91 | 'raw' => __('<strong>BetterDocs</strong> is not installed/activated on your site. Please install and activate <a href="plugin-install.php?s=BetterDocs&tab=search&type=term" target="_blank">BetterDocs</a> first.', 'essential-addons-for-elementor-lite'), |
| 92 | 'content_classes' => 'eael-warning', |
| 93 | ] |
| 94 | ); |
| 95 | |
| 96 | $this->end_controls_section(); |
| 97 | } else { |
| 98 | |
| 99 | /** |
| 100 | * ---------------------------------------------------------- |
| 101 | * Section: Search Box |
| 102 | * ---------------------------------------------------------- |
| 103 | */ |
| 104 | $this->start_controls_section( |
| 105 | 'section_search_box_settings', |
| 106 | [ |
| 107 | 'label' => __('Search Box', 'essential-addons-for-elementor-lite'), |
| 108 | ] |
| 109 | ); |
| 110 | |
| 111 | $this->add_group_control( |
| 112 | Group_Control_Background::get_type(), |
| 113 | [ |
| 114 | 'name' => 'search_box_bg', |
| 115 | 'types' => ['classic', 'gradient'], |
| 116 | 'selector' => '{{WRAPPER}} .betterdocs-live-search' |
| 117 | ] |
| 118 | ); |
| 119 | |
| 120 | $this->add_responsive_control( |
| 121 | 'search_box_padding', |
| 122 | [ |
| 123 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 124 | 'type' => Controls_Manager::DIMENSIONS, |
| 125 | 'size_units' => ['px', 'em', '%'], |
| 126 | 'default' => [ |
| 127 | 'top' => 50, |
| 128 | 'right' => 50, |
| 129 | 'bottom' => 50, |
| 130 | 'left' => 50 |
| 131 | ], |
| 132 | 'selectors' => [ |
| 133 | '{{WRAPPER}} .betterdocs-live-search' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 134 | ], |
| 135 | ] |
| 136 | ); |
| 137 | |
| 138 | $this->end_controls_section(); # end of 'Search Box' |
| 139 | |
| 140 | /** |
| 141 | * ---------------------------------------------------------- |
| 142 | * Section: Search Field |
| 143 | * ---------------------------------------------------------- |
| 144 | */ |
| 145 | $this->start_controls_section( |
| 146 | 'section_search_field_settings', |
| 147 | [ |
| 148 | 'label' => __('Search Field', 'essential-addons-for-elementor-lite'), |
| 149 | ] |
| 150 | ); |
| 151 | |
| 152 | $this->add_control( |
| 153 | 'section_search_field_placeholder', |
| 154 | [ |
| 155 | 'label' => __('Placeholder', 'essential-addons-for-elementor-lite'), |
| 156 | 'type' => Controls_Manager::TEXT, |
| 157 | 'default' => esc_html__('Search', 'essential-addons-for-elementor-lite'), |
| 158 | 'ai' => [ |
| 159 | 'active' => false, |
| 160 | ], |
| 161 | ] |
| 162 | ); |
| 163 | |
| 164 | $this->add_control( |
| 165 | 'search_field_bg', |
| 166 | [ |
| 167 | 'label' => esc_html__('Field Background Color', 'essential-addons-for-elementor-lite'), |
| 168 | 'type' => Controls_Manager::COLOR, |
| 169 | 'selectors' => [ |
| 170 | '{{WRAPPER}} .betterdocs-searchform' => 'background: {{VALUE}};', |
| 171 | ], |
| 172 | ] |
| 173 | ); |
| 174 | |
| 175 | $this->add_control( |
| 176 | 'search_field_text_color', |
| 177 | [ |
| 178 | 'label' => esc_html__('Field Color', 'essential-addons-for-elementor-lite'), |
| 179 | 'type' => Controls_Manager::COLOR, |
| 180 | 'selectors' => [ |
| 181 | '{{WRAPPER}} .betterdocs-searchform .betterdocs-search-field' => 'color: {{VALUE}};', |
| 182 | ], |
| 183 | ] |
| 184 | ); |
| 185 | |
| 186 | $this->add_group_control( |
| 187 | Group_Control_Typography::get_type(), |
| 188 | [ |
| 189 | 'name' => 'search_field_text_typography', |
| 190 | 'selector' => '{{WRAPPER}} .betterdocs-searchform .betterdocs-search-field' |
| 191 | ] |
| 192 | ); |
| 193 | |
| 194 | $this->add_responsive_control( |
| 195 | 'search_field_padding', |
| 196 | [ |
| 197 | 'label' => __('Field Padding', 'essential-addons-for-elementor-lite'), |
| 198 | 'type' => Controls_Manager::DIMENSIONS, |
| 199 | 'size_units' => ['px', 'em', '%'], |
| 200 | 'selectors' => [ |
| 201 | '{{WRAPPER}} .betterdocs-searchform .betterdocs-search-field' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 202 | ], |
| 203 | ] |
| 204 | ); |
| 205 | |
| 206 | $this->add_responsive_control( |
| 207 | 'search_field_padding_radius', |
| 208 | [ |
| 209 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 210 | 'type' => Controls_Manager::DIMENSIONS, |
| 211 | 'size_units' => ['px', 'em', '%'], |
| 212 | 'selectors' => [ |
| 213 | '{{WRAPPER}} .betterdocs-searchform' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 214 | ], |
| 215 | ] |
| 216 | ); |
| 217 | |
| 218 | $this->add_group_control( |
| 219 | \Elementor\Group_Control_Border::get_type(), |
| 220 | [ |
| 221 | 'name' => 'search_field_border', |
| 222 | 'label' => __('Border', 'essential-addons-for-elementor-lite'), |
| 223 | 'selector' => '{{WRAPPER}} .betterdocs-searchform', |
| 224 | ] |
| 225 | ); |
| 226 | |
| 227 | $this->add_group_control( |
| 228 | \Elementor\Group_Control_Box_Shadow::get_type(), |
| 229 | [ |
| 230 | 'name' => 'search_field_shadow', |
| 231 | 'label' => __('Shadow', 'essential-addons-for-elementor-lite'), |
| 232 | 'selector' => '{{WRAPPER}} .betterdocs-searchform', |
| 233 | ] |
| 234 | ); |
| 235 | |
| 236 | |
| 237 | $this->add_control( |
| 238 | 'field_search_icon_heading', |
| 239 | [ |
| 240 | 'label' => esc_html__('Search Icon', 'essential-addons-for-elementor-lite'), |
| 241 | 'type' => Controls_Manager::HEADING, |
| 242 | 'separator' => 'before' |
| 243 | ] |
| 244 | ); |
| 245 | |
| 246 | $this->add_control( |
| 247 | 'field_search_icon_color', |
| 248 | [ |
| 249 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 250 | 'type' => Controls_Manager::COLOR, |
| 251 | 'selectors' => [ |
| 252 | '{{WRAPPER}} .betterdocs-searchform svg.docs-search-icon' => 'fill: {{VALUE}};', |
| 253 | ], |
| 254 | ] |
| 255 | ); |
| 256 | |
| 257 | $this->add_control( |
| 258 | 'field_search_icon_size', |
| 259 | [ |
| 260 | 'label' => esc_html__('Size', 'essential-addons-for-elementor-lite'), |
| 261 | 'type' => Controls_Manager::SLIDER, |
| 262 | 'size_units' => ['px', '%', 'em'], |
| 263 | 'range' => [ |
| 264 | 'px' => [ |
| 265 | 'max' => 500, |
| 266 | ], |
| 267 | ], |
| 268 | 'selectors' => [ |
| 269 | '{{WRAPPER}} .betterdocs-searchform svg.docs-search-icon' => 'height: {{SIZE}}{{UNIT}};', |
| 270 | ], |
| 271 | ] |
| 272 | ); |
| 273 | |
| 274 | $this->add_control( |
| 275 | 'field_close_icon_heading', |
| 276 | [ |
| 277 | 'label' => esc_html__('Close Icon', 'essential-addons-for-elementor-lite'), |
| 278 | 'type' => Controls_Manager::HEADING, |
| 279 | 'separator' => 'before' |
| 280 | ] |
| 281 | ); |
| 282 | |
| 283 | $this->add_control( |
| 284 | 'search_field_close_icon_color', |
| 285 | [ |
| 286 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 287 | 'type' => Controls_Manager::COLOR, |
| 288 | 'selectors' => [ |
| 289 | '{{WRAPPER}} .docs-search-close .close-line' => 'fill: {{VALUE}};', |
| 290 | ], |
| 291 | ] |
| 292 | ); |
| 293 | |
| 294 | $this->add_control( |
| 295 | 'search_field_close_icon_border_color', |
| 296 | [ |
| 297 | 'label' => esc_html__('Border Color', 'essential-addons-for-elementor-lite'), |
| 298 | 'type' => Controls_Manager::COLOR, |
| 299 | 'selectors' => [ |
| 300 | '{{WRAPPER}} .docs-search-loader, {{WRAPPER}} .docs-search-close .close-border' => 'stroke: {{VALUE}};', |
| 301 | ], |
| 302 | ] |
| 303 | ); |
| 304 | |
| 305 | $this->end_controls_section(); # end of 'Search Field' |
| 306 | |
| 307 | |
| 308 | /** |
| 309 | * ---------------------------------------------------------- |
| 310 | * Section: Search Result Box |
| 311 | * ---------------------------------------------------------- |
| 312 | */ |
| 313 | $this->start_controls_section( |
| 314 | 'section_search_result_settings', |
| 315 | [ |
| 316 | 'label' => __('Search Result Box', 'essential-addons-for-elementor-lite'), |
| 317 | ] |
| 318 | ); |
| 319 | |
| 320 | $this->add_responsive_control( |
| 321 | 'result_box_width', |
| 322 | [ |
| 323 | 'label' => __('Width', 'essential-addons-for-elementor-lite'), |
| 324 | 'type' => Controls_Manager::SLIDER, |
| 325 | 'default' => [ |
| 326 | 'size' => 100, |
| 327 | 'unit' => '%', |
| 328 | ], |
| 329 | 'size_units' => ['%', 'px', 'em'], |
| 330 | 'range' => [ |
| 331 | '%' => [ |
| 332 | 'max' => 100, |
| 333 | 'step' => 1, |
| 334 | ], |
| 335 | ], |
| 336 | 'selectors' => [ |
| 337 | '{{WRAPPER}} .betterdocs-live-search .docs-search-result' => 'width: {{SIZE}}{{UNIT}};', |
| 338 | ], |
| 339 | ] |
| 340 | ); |
| 341 | |
| 342 | $this->add_responsive_control( |
| 343 | 'result_box_max_width', |
| 344 | [ |
| 345 | 'label' => __('Max Width', 'essential-addons-for-elementor-lite'), |
| 346 | 'type' => Controls_Manager::SLIDER, |
| 347 | 'default' => [ |
| 348 | 'size' => 1600, |
| 349 | 'unit' => 'px', |
| 350 | ], |
| 351 | 'size_units' => ['px', 'em'], |
| 352 | 'range' => [ |
| 353 | 'px' => [ |
| 354 | 'max' => 1600, |
| 355 | 'step' => 1, |
| 356 | ], |
| 357 | ], |
| 358 | 'selectors' => [ |
| 359 | '{{WRAPPER}} .betterdocs-live-search .docs-search-result' => 'max-width: {{SIZE}}{{UNIT}};', |
| 360 | ], |
| 361 | ] |
| 362 | ); |
| 363 | |
| 364 | $this->add_group_control( |
| 365 | Group_Control_Background::get_type(), |
| 366 | [ |
| 367 | 'name' => 'result_box_bg', |
| 368 | 'types' => ['classic', 'gradient'], |
| 369 | 'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result' |
| 370 | ] |
| 371 | ); |
| 372 | |
| 373 | $this->add_group_control( |
| 374 | Group_Control_Border::get_type(), |
| 375 | [ |
| 376 | 'name' => 'result_box_border', |
| 377 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 378 | 'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result', |
| 379 | ] |
| 380 | ); |
| 381 | |
| 382 | $this->end_controls_section(); # end of 'Search Result Box' |
| 383 | |
| 384 | /** |
| 385 | * ---------------------------------------------------------- |
| 386 | * Section: Search Result Item |
| 387 | * ---------------------------------------------------------- |
| 388 | */ |
| 389 | $this->start_controls_section( |
| 390 | 'section_search_result_item_settings', |
| 391 | [ |
| 392 | 'label' => __('Search Result List', 'essential-addons-for-elementor-lite'), |
| 393 | ] |
| 394 | ); |
| 395 | |
| 396 | $this->start_controls_tabs('item_settings_tab'); |
| 397 | |
| 398 | // Normal State Tab |
| 399 | $this->start_controls_tab( |
| 400 | 'item_normal', |
| 401 | ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')] |
| 402 | ); |
| 403 | |
| 404 | $this->add_control( |
| 405 | 'result_box_item', |
| 406 | [ |
| 407 | 'label' => esc_html__('Item', 'essential-addons-for-elementor-lite'), |
| 408 | 'type' => Controls_Manager::HEADING |
| 409 | ] |
| 410 | ); |
| 411 | |
| 412 | $this->add_group_control( |
| 413 | Group_Control_Typography::get_type(), |
| 414 | [ |
| 415 | 'name' => 'result_box_item_typography', |
| 416 | 'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result li a' |
| 417 | ] |
| 418 | ); |
| 419 | |
| 420 | $this->add_control( |
| 421 | 'result_box_item_color', |
| 422 | [ |
| 423 | 'label' => esc_html__('Item Color', 'essential-addons-for-elementor-lite'), |
| 424 | 'type' => Controls_Manager::COLOR, |
| 425 | 'selectors' => [ |
| 426 | '{{WRAPPER}} .betterdocs-live-search .docs-search-result li a' => 'color: {{VALUE}};', |
| 427 | ], |
| 428 | ] |
| 429 | ); |
| 430 | |
| 431 | $this->add_group_control( |
| 432 | Group_Control_Border::get_type(), |
| 433 | [ |
| 434 | 'name' => 'result_item_border', |
| 435 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 436 | 'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result li' |
| 437 | ] |
| 438 | ); |
| 439 | |
| 440 | $this->add_responsive_control( |
| 441 | 'result_box_item_padding', |
| 442 | [ |
| 443 | 'label' => __('Padding', 'essential-addons-for-elementor-lite'), |
| 444 | 'type' => Controls_Manager::DIMENSIONS, |
| 445 | 'size_units' => ['px', 'em', '%'], |
| 446 | 'selectors' => [ |
| 447 | '{{WRAPPER}} .betterdocs-live-search .docs-search-result li a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 448 | ], |
| 449 | ] |
| 450 | ); |
| 451 | |
| 452 | $this->add_control( |
| 453 | 'search_result_box_item_count', |
| 454 | [ |
| 455 | 'label' => esc_html__('Count', 'essential-addons-for-elementor-lite'), |
| 456 | 'type' => Controls_Manager::HEADING, |
| 457 | 'separator' => 'before' |
| 458 | ] |
| 459 | ); |
| 460 | |
| 461 | $this->add_group_control( |
| 462 | Group_Control_Typography::get_type(), |
| 463 | [ |
| 464 | 'name' => 'result_box_item_count_typography', |
| 465 | 'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result li span' |
| 466 | ] |
| 467 | ); |
| 468 | |
| 469 | $this->add_control( |
| 470 | 'result_box_item_count_color', |
| 471 | [ |
| 472 | 'label' => esc_html__('Item Color', 'essential-addons-for-elementor-lite'), |
| 473 | 'type' => Controls_Manager::COLOR, |
| 474 | 'selectors' => [ |
| 475 | '{{WRAPPER}} .betterdocs-live-search .docs-search-result li span' => 'color: {{VALUE}};', |
| 476 | ], |
| 477 | ] |
| 478 | ); |
| 479 | |
| 480 | $this->end_controls_tab(); |
| 481 | |
| 482 | // Hover State Tab |
| 483 | $this->start_controls_tab( |
| 484 | 'item_hover', |
| 485 | ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')] |
| 486 | ); |
| 487 | |
| 488 | $this->add_responsive_control( |
| 489 | 'result_item_transition', |
| 490 | [ |
| 491 | 'label' => __('Transition', 'essential-addons-for-elementor-lite'), |
| 492 | 'type' => Controls_Manager::SLIDER, |
| 493 | 'default' => [ |
| 494 | 'size' => 300, |
| 495 | 'unit' => '%', |
| 496 | ], |
| 497 | 'size_units' => ['%'], |
| 498 | 'range' => [ |
| 499 | '%' => [ |
| 500 | 'max' => 2500, |
| 501 | 'step' => 1, |
| 502 | ], |
| 503 | ], |
| 504 | 'selectors' => [ |
| 505 | '{{WRAPPER}} .betterdocs-live-search .docs-search-result li, {{WRAPPER}} .betterdocs-live-search .docs-search-result li a, {{WRAPPER}} .betterdocs-live-search .docs-search-result li span, {{WRAPPER}} .betterdocs-live-search .docs-search-result' => 'transition: {{SIZE}}ms;', |
| 506 | ], |
| 507 | ] |
| 508 | ); |
| 509 | |
| 510 | $this->add_control( |
| 511 | 'result_box_item_hover_heading', |
| 512 | [ |
| 513 | 'label' => esc_html__('Item', 'essential-addons-for-elementor-lite'), |
| 514 | 'type' => Controls_Manager::HEADING |
| 515 | ] |
| 516 | ); |
| 517 | |
| 518 | $this->add_group_control( |
| 519 | Group_Control_Background::get_type(), |
| 520 | [ |
| 521 | 'name' => 'result_box_item_hover_bg', |
| 522 | 'types' => ['classic', 'gradient'], |
| 523 | 'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result li:hover', |
| 524 | 'exclude' => [ |
| 525 | 'image' |
| 526 | ] |
| 527 | ] |
| 528 | ); |
| 529 | |
| 530 | $this->add_control( |
| 531 | 'result_box_item_hover_color', |
| 532 | [ |
| 533 | 'label' => esc_html__('Item Color', 'essential-addons-for-elementor-lite'), |
| 534 | 'type' => Controls_Manager::COLOR, |
| 535 | 'selectors' => [ |
| 536 | '{{WRAPPER}} .betterdocs-live-search .docs-search-result li:hover a' => 'color: {{VALUE}};', |
| 537 | ], |
| 538 | ] |
| 539 | ); |
| 540 | |
| 541 | $this->add_group_control( |
| 542 | Group_Control_Border::get_type(), |
| 543 | [ |
| 544 | 'name' => 'result_item_hover_border', |
| 545 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 546 | 'selector' => '{{WRAPPER}} .betterdocs-live-search .docs-search-result li:hover' |
| 547 | ] |
| 548 | ); |
| 549 | |
| 550 | $this->add_control( |
| 551 | 'result_box_item_hover_count_heading', |
| 552 | [ |
| 553 | 'label' => esc_html__('Count', 'essential-addons-for-elementor-lite'), |
| 554 | 'type' => Controls_Manager::HEADING, |
| 555 | 'separator' => 'before' |
| 556 | ] |
| 557 | ); |
| 558 | |
| 559 | $this->add_control( |
| 560 | 'result_box_item_hover_count_color', |
| 561 | [ |
| 562 | 'label' => esc_html__('Item Color', 'essential-addons-for-elementor-lite'), |
| 563 | 'type' => Controls_Manager::COLOR, |
| 564 | 'selectors' => [ |
| 565 | '{{WRAPPER}} .betterdocs-live-search .docs-search-result li:hover span' => 'color: {{VALUE}};', |
| 566 | ], |
| 567 | ] |
| 568 | ); |
| 569 | $this->end_controls_tab(); |
| 570 | $this->end_controls_tabs(); |
| 571 | |
| 572 | $this->end_controls_section(); # end of 'Search Result Item' |
| 573 | |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | protected function render() |
| 578 | { |
| 579 | if (!defined('BETTERDOCS_URL')) return; |
| 580 | $settings = $this->get_settings_for_display(); |
| 581 | $shortcode = sprintf('[betterdocs_search_form placeholder="'.$settings['section_search_field_placeholder'].'"]', apply_filters('eael_betterdocs_search_form_params', [])); |
| 582 | echo do_shortcode(shortcode_unautop($shortcode)); |
| 583 | } |
| 584 | |
| 585 | public function render_plain_content() |
| 586 | { |
| 587 | $settings = $this->get_settings_for_display(); |
| 588 | // In plain mode, render without shortcode |
| 589 | echo '[betterdocs_search_form placeholder="'.$settings['section_search_field_placeholder'].'"]'; |
| 590 | } |
| 591 | } |
| 592 |