Adv_Accordion.php
1 month ago
Adv_Tabs.php
1 month ago
Advanced_Data_Table.php
3 months ago
Better_Payment.php
4 years ago
Betterdocs_Category_Box.php
2 months ago
Betterdocs_Category_Grid.php
2 months ago
Betterdocs_Search_Form.php
2 months ago
Breadcrumbs.php
1 month ago
Business_Reviews.php
2 months ago
Caldera_Forms.php
1 month ago
Career_Page.php
4 years ago
Code_Snippet.php
3 months ago
Contact_Form_7.php
1 month ago
Content_Ticker.php
3 months ago
Countdown.php
1 month ago
Creative_Button.php
1 month ago
Cta_Box.php
1 month ago
Data_Table.php
1 month ago
Dual_Color_Header.php
1 month ago
EmbedPress.php
4 years ago
Event_Calendar.php
2 months ago
Facebook_Feed.php
3 months ago
Fancy_Text.php
1 month ago
Feature_List.php
3 months ago
Filterable_Gallery.php
1 month ago
Flip_Box.php
1 month ago
FluentForm.php
1 month ago
Formstack.php
1 month ago
GravityForms.php
1 month ago
Image_Accordion.php
1 month ago
Info_Box.php
1 month ago
Interactive_Circle.php
1 month ago
Login_Register.php
1 month ago
NFT_Gallery.php
3 months ago
NinjaForms.php
1 month ago
Post_Grid.php
3 months ago
Post_Timeline.php
9 months ago
Pricing_Table.php
1 month ago
Product_Grid.php
3 months ago
Progress_Bar.php
1 month ago
SVG_Draw.php
3 months ago
Simple_Menu.php
2 months ago
Sticky_Video.php
3 months ago
Team_Member.php
3 months ago
Testimonial.php
1 month ago
Tooltip.php
1 month ago
Twitter_Feed.php
3 months ago
TypeForm.php
5 months ago
WeForms.php
1 year ago
Woo_Add_To_Cart.php
1 month ago
Woo_Cart.php
3 months ago
Woo_Checkout.php
3 months ago
Woo_Product_Carousel.php
3 months ago
Woo_Product_Compare.php
1 year ago
Woo_Product_Gallery.php
3 months ago
Woo_Product_Images.php
1 month ago
Woo_Product_List.php
1 month ago
Woo_Product_Price.php
1 month ago
Woo_Product_Rating.php
1 month ago
WpForms.php
1 month ago
index.php
3 years ago
Betterdocs_Category_Box.php
1194 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Essential_Addons_Elementor\Elements; |
| 4 | |
| 5 | // If this file is called directly, abort. |
| 6 | if (!defined('ABSPATH')) |
| 7 | { |
| 8 | exit; |
| 9 | } |
| 10 | |
| 11 | use \Elementor\Controls_Manager; |
| 12 | use \Elementor\Group_Control_Border; |
| 13 | use \Elementor\Group_Control_Box_Shadow; |
| 14 | use \Elementor\Group_Control_Typography; |
| 15 | use \Elementor\Group_Control_Background; |
| 16 | use \Elementor\Widget_Base; |
| 17 | |
| 18 | use \Essential_Addons_Elementor\Classes\Helper; |
| 19 | |
| 20 | class Betterdocs_Category_Box extends Widget_Base { |
| 21 | |
| 22 | |
| 23 | use \Essential_Addons_Elementor\Traits\Template_Query; |
| 24 | |
| 25 | public function get_name() |
| 26 | { |
| 27 | return 'eael-betterdocs-category-box'; |
| 28 | } |
| 29 | |
| 30 | public function get_title() |
| 31 | { |
| 32 | return __('BetterDocs Category Box', 'essential-addons-for-elementor-lite'); |
| 33 | } |
| 34 | |
| 35 | public function get_categories() |
| 36 | { |
| 37 | return ['essential-addons-elementor']; |
| 38 | } |
| 39 | |
| 40 | public function get_icon() |
| 41 | { |
| 42 | return 'eaicon-betterdocs-category-box'; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Get widget keywords. |
| 47 | * |
| 48 | * Retrieve the list of keywords the widget belongs to. |
| 49 | * |
| 50 | * @return array Widget keywords. |
| 51 | * @since 3.5.2 |
| 52 | * @access public |
| 53 | * |
| 54 | */ |
| 55 | public function get_keywords() |
| 56 | { |
| 57 | return [ |
| 58 | 'knowledgebase', |
| 59 | 'knowledge Base', |
| 60 | 'documentation', |
| 61 | 'doc', |
| 62 | 'kb', |
| 63 | 'betterdocs', |
| 64 | 'ea betterdocs', |
| 65 | 'ea', |
| 66 | 'essential addons' |
| 67 | ]; |
| 68 | } |
| 69 | |
| 70 | public function has_widget_inner_wrapper(): bool { |
| 71 | return ! Helper::eael_e_optimized_markup(); |
| 72 | } |
| 73 | |
| 74 | public function get_custom_help_url() |
| 75 | { |
| 76 | return 'https://essential-addons.com/elementor/docs/betterdocs-category-box/'; |
| 77 | } |
| 78 | |
| 79 | protected function register_controls() |
| 80 | { |
| 81 | /*-----------------------------------------------------------------------------------*/ |
| 82 | /* Content Tab |
| 83 | /*-----------------------------------------------------------------------------------*/ |
| 84 | if (!defined('BETTERDOCS_URL')) |
| 85 | { |
| 86 | $this->start_controls_section( |
| 87 | 'eael_global_warning', |
| 88 | [ |
| 89 | 'label' => __('Warning!', 'essential-addons-for-elementor-lite'), |
| 90 | ] |
| 91 | ); |
| 92 | |
| 93 | $this->add_control( |
| 94 | 'eael_global_warning_text', |
| 95 | [ |
| 96 | 'type' => Controls_Manager::RAW_HTML, |
| 97 | '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'), |
| 98 | 'content_classes' => 'eael-warning', |
| 99 | ] |
| 100 | ); |
| 101 | |
| 102 | $this->end_controls_section(); |
| 103 | } else |
| 104 | { |
| 105 | |
| 106 | /** |
| 107 | * Query Controls! |
| 108 | * @source includes/elementor-helper.php |
| 109 | */ |
| 110 | do_action('eael/controls/betterdocs/query', $this); |
| 111 | |
| 112 | /** |
| 113 | * ---------------------------------------------------------- |
| 114 | * Section: Layout Options |
| 115 | * ---------------------------------------------------------- |
| 116 | */ |
| 117 | $this->start_controls_section( |
| 118 | 'section_layout_options', |
| 119 | [ |
| 120 | 'label' => __('Layout Options', 'essential-addons-for-elementor-lite') |
| 121 | ] |
| 122 | ); |
| 123 | |
| 124 | $this->add_control( |
| 125 | 'layout_template', |
| 126 | [ |
| 127 | 'label' => __('Select Layout', 'essential-addons-for-elementor-lite'), |
| 128 | 'type' => Controls_Manager::SELECT2, |
| 129 | 'options' => $this->template_options(), |
| 130 | 'default' => $this->get_default(), |
| 131 | 'label_block' => true |
| 132 | ] |
| 133 | ); |
| 134 | |
| 135 | $this->add_responsive_control( |
| 136 | 'box_column', |
| 137 | [ |
| 138 | 'label' => __('Box Column', 'essential-addons-for-elementor-lite'), |
| 139 | 'type' => Controls_Manager::SELECT, |
| 140 | 'default' => '3', |
| 141 | 'tablet_default' => '2', |
| 142 | 'mobile_default' => '1', |
| 143 | 'options' => [ |
| 144 | '1' => '1', |
| 145 | '2' => '2', |
| 146 | '3' => '3', |
| 147 | '4' => '4' |
| 148 | ], |
| 149 | 'prefix_class' => 'elementor-grid%s-', |
| 150 | 'frontend_available' => true, |
| 151 | 'label_block' => true |
| 152 | ] |
| 153 | ); |
| 154 | |
| 155 | $this->add_control( |
| 156 | 'show_icon', |
| 157 | [ |
| 158 | 'label' => __('Show Icon', 'essential-addons-for-elementor-lite'), |
| 159 | 'type' => Controls_Manager::SWITCHER, |
| 160 | 'label_on' => __('Show', 'essential-addons-for-elementor-lite'), |
| 161 | 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'), |
| 162 | 'return_value' => 'true', |
| 163 | 'default' => 'true' |
| 164 | ] |
| 165 | ); |
| 166 | |
| 167 | $this->add_control( |
| 168 | 'show_title', |
| 169 | [ |
| 170 | 'label' => __('Show Title', 'essential-addons-for-elementor-lite'), |
| 171 | 'type' => Controls_Manager::SWITCHER, |
| 172 | 'label_on' => __('Show', 'essential-addons-for-elementor-lite'), |
| 173 | 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'), |
| 174 | 'return_value' => 'true', |
| 175 | 'default' => 'true' |
| 176 | ] |
| 177 | ); |
| 178 | |
| 179 | $this->add_control( |
| 180 | 'title_tag', |
| 181 | [ |
| 182 | 'label' => __('Select Tag', 'essential-addons-for-elementor-lite'), |
| 183 | 'type' => Controls_Manager::SELECT, |
| 184 | 'default' => 'h2', |
| 185 | 'options' => [ |
| 186 | 'h1' => __('H1', 'essential-addons-for-elementor-lite'), |
| 187 | 'h2' => __('H2', 'essential-addons-for-elementor-lite'), |
| 188 | 'h3' => __('H3', 'essential-addons-for-elementor-lite'), |
| 189 | 'h4' => __('H4', 'essential-addons-for-elementor-lite'), |
| 190 | 'h5' => __('H5', 'essential-addons-for-elementor-lite'), |
| 191 | 'h6' => __('H6', 'essential-addons-for-elementor-lite'), |
| 192 | 'span' => __('Span', 'essential-addons-for-elementor-lite'), |
| 193 | 'p' => __('P', 'essential-addons-for-elementor-lite'), |
| 194 | 'div' => __('Div', 'essential-addons-for-elementor-lite'), |
| 195 | ], |
| 196 | 'condition' => [ |
| 197 | 'show_title' => 'true' |
| 198 | ], |
| 199 | ] |
| 200 | ); |
| 201 | |
| 202 | $this->add_control( |
| 203 | 'show_count', |
| 204 | [ |
| 205 | 'label' => __('Show Count', 'essential-addons-for-elementor-lite'), |
| 206 | 'type' => Controls_Manager::SWITCHER, |
| 207 | 'label_on' => __('Show', 'essential-addons-for-elementor-lite'), |
| 208 | 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'), |
| 209 | 'return_value' => 'true', |
| 210 | 'default' => 'true' |
| 211 | ] |
| 212 | ); |
| 213 | |
| 214 | $this->add_control( |
| 215 | 'count_prefix', |
| 216 | [ |
| 217 | 'label' => __('Prefix', 'essential-addons-for-elementor-lite'), |
| 218 | 'type' => Controls_Manager::TEXT, |
| 219 | 'dynamic' => [ 'active' => true ], |
| 220 | 'condition' => [ |
| 221 | 'show_count' => 'true', |
| 222 | 'layout_template' => 'default' |
| 223 | ], |
| 224 | 'ai' => [ |
| 225 | 'active' => true, |
| 226 | ], |
| 227 | ] |
| 228 | ); |
| 229 | |
| 230 | $this->add_control( |
| 231 | 'count_suffix', |
| 232 | [ |
| 233 | 'label' => __('Suffix', 'essential-addons-for-elementor-lite'), |
| 234 | 'type' => Controls_Manager::TEXT, |
| 235 | 'dynamic' => [ 'active' => true ], |
| 236 | 'default' => __('articles', 'essential-addons-for-elementor-lite'), |
| 237 | 'condition' => [ |
| 238 | 'show_count' => 'true', |
| 239 | 'layout_template' => 'default' |
| 240 | ] |
| 241 | ] |
| 242 | ); |
| 243 | |
| 244 | |
| 245 | $this->end_controls_section(); |
| 246 | |
| 247 | /** |
| 248 | * ---------------------------------------------------------- |
| 249 | * Section: Box Styles |
| 250 | * ---------------------------------------------------------- |
| 251 | */ |
| 252 | $this->start_controls_section( |
| 253 | 'section_card_settings', |
| 254 | [ |
| 255 | 'label' => __('Box', 'essential-addons-for-elementor-lite'), |
| 256 | 'tab' => Controls_Manager::TAB_STYLE, |
| 257 | ] |
| 258 | ); |
| 259 | |
| 260 | $this->add_responsive_control( |
| 261 | 'column_space', // Legacy control id but new control |
| 262 | [ |
| 263 | 'label' => __('Box Spacing', 'essential-addons-for-elementor-lite'), |
| 264 | 'type' => Controls_Manager::DIMENSIONS, |
| 265 | 'size_units' => ['px', '%', 'em'], |
| 266 | 'selectors' => [ |
| 267 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 268 | ] |
| 269 | ] |
| 270 | ); |
| 271 | |
| 272 | $this->add_responsive_control( |
| 273 | 'column_padding', |
| 274 | [ |
| 275 | 'label' => __('Box Padding', 'essential-addons-for-elementor-lite'), |
| 276 | 'type' => Controls_Manager::DIMENSIONS, |
| 277 | 'size_units' => ['px', 'em', '%'], |
| 278 | 'selectors' => [ |
| 279 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 280 | ] |
| 281 | ] |
| 282 | ); |
| 283 | |
| 284 | $this->start_controls_tabs('card_settings_tabs'); |
| 285 | |
| 286 | // Normal State Tab |
| 287 | $this->start_controls_tab( |
| 288 | 'card_normal', |
| 289 | ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')] |
| 290 | ); |
| 291 | |
| 292 | $this->add_group_control( |
| 293 | Group_Control_Background::get_type(), |
| 294 | [ |
| 295 | 'name' => 'card_bg_normal', |
| 296 | 'types' => ['classic', 'gradient'], |
| 297 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner' |
| 298 | ] |
| 299 | ); |
| 300 | |
| 301 | $this->add_group_control( |
| 302 | Group_Control_Border::get_type(), |
| 303 | [ |
| 304 | 'name' => 'card_border_normal', |
| 305 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 306 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner' |
| 307 | ] |
| 308 | ); |
| 309 | |
| 310 | $this->add_responsive_control( |
| 311 | 'card_border_radius_normal', |
| 312 | [ |
| 313 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 314 | 'type' => Controls_Manager::DIMENSIONS, |
| 315 | 'size_units' => ['px', 'em', '%'], |
| 316 | 'selectors' => [ |
| 317 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 318 | ], |
| 319 | ] |
| 320 | ); |
| 321 | |
| 322 | $this->add_group_control( |
| 323 | Group_Control_Box_Shadow::get_type(), |
| 324 | [ |
| 325 | 'name' => 'card_box_shadow_normal', |
| 326 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner' |
| 327 | ] |
| 328 | ); |
| 329 | |
| 330 | $this->end_controls_tab(); |
| 331 | |
| 332 | // Hover State Tab |
| 333 | $this->start_controls_tab( |
| 334 | 'card_hover', |
| 335 | ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')] |
| 336 | ); |
| 337 | |
| 338 | $this->add_control( |
| 339 | 'card_transition', |
| 340 | [ |
| 341 | 'label' => __('Transition', 'essential-addons-for-elementor-lite'), |
| 342 | 'type' => Controls_Manager::SLIDER, |
| 343 | 'default' => [ |
| 344 | 'size' => 300, |
| 345 | 'unit' => '%', |
| 346 | ], |
| 347 | 'size_units' => ['%'], |
| 348 | 'range' => [ |
| 349 | '%' => [ |
| 350 | 'max' => 2500, |
| 351 | 'step' => 1, |
| 352 | ], |
| 353 | ], |
| 354 | 'selectors' => [ |
| 355 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner' => 'transition: {{SIZE}}ms;', |
| 356 | ], |
| 357 | ] |
| 358 | ); |
| 359 | |
| 360 | $this->add_group_control( |
| 361 | Group_Control_Background::get_type(), |
| 362 | [ |
| 363 | 'name' => 'card_bg_hover', |
| 364 | 'types' => ['classic', 'gradient'], |
| 365 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover' |
| 366 | ] |
| 367 | ); |
| 368 | |
| 369 | $this->add_group_control( |
| 370 | Group_Control_Border::get_type(), |
| 371 | [ |
| 372 | 'name' => 'card_border_hover', |
| 373 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 374 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover' |
| 375 | ] |
| 376 | ); |
| 377 | |
| 378 | $this->add_responsive_control( |
| 379 | 'card_border_radius_hover', |
| 380 | [ |
| 381 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 382 | 'type' => Controls_Manager::DIMENSIONS, |
| 383 | 'size_units' => ['px', 'em', '%'], |
| 384 | 'selectors' => [ |
| 385 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 386 | ], |
| 387 | ] |
| 388 | ); |
| 389 | |
| 390 | $this->add_group_control( |
| 391 | Group_Control_Box_Shadow::get_type(), |
| 392 | [ |
| 393 | 'name' => 'card_box_shadow_hover', |
| 394 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover' |
| 395 | ] |
| 396 | ); |
| 397 | |
| 398 | $this->end_controls_tab(); |
| 399 | |
| 400 | $this->end_controls_tabs(); |
| 401 | $this->end_controls_section(); # end of 'Card Settings' |
| 402 | |
| 403 | |
| 404 | /** |
| 405 | * ---------------------------------------------------------- |
| 406 | * Section: Icon Styles |
| 407 | * ---------------------------------------------------------- |
| 408 | */ |
| 409 | $this->start_controls_section( |
| 410 | 'section_box_icon_style', |
| 411 | [ |
| 412 | 'label' => __('Icon', 'essential-addons-for-elementor-lite'), |
| 413 | 'tab' => Controls_Manager::TAB_STYLE, |
| 414 | ] |
| 415 | ); |
| 416 | |
| 417 | $this->add_control( |
| 418 | 'category_settings_area', |
| 419 | [ |
| 420 | 'label' => __( 'Area', 'essential-addons-for-elementor-lite' ), |
| 421 | 'type' => Controls_Manager::HEADING |
| 422 | ] |
| 423 | ); |
| 424 | |
| 425 | $this->add_responsive_control( |
| 426 | 'category_settings_icon_area_size_normal', |
| 427 | [ |
| 428 | 'label' => esc_html__('Size', 'essential-addons-for-elementor-lite'), |
| 429 | 'type' => Controls_Manager::SLIDER, |
| 430 | 'size_units' => ['px', '%', 'em'], |
| 431 | 'range' => [ |
| 432 | 'px' => [ |
| 433 | 'max' => 500, |
| 434 | ], |
| 435 | ], |
| 436 | 'selectors' => [ |
| 437 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};', |
| 438 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon__layout-2' => 'flex-basis: {{SIZE}}{{UNIT}};' |
| 439 | ], |
| 440 | ] |
| 441 | ); |
| 442 | |
| 443 | $this->add_control( |
| 444 | 'category_settings_icon', |
| 445 | [ |
| 446 | 'label' => __( 'Icon', 'essential-addons-for-elementor-lite' ), |
| 447 | 'type' => Controls_Manager::HEADING, |
| 448 | 'separator' => 'before', |
| 449 | ] |
| 450 | ); |
| 451 | |
| 452 | $this->start_controls_tabs('box_icon_styles_tab'); |
| 453 | |
| 454 | // Normal State Tab |
| 455 | $this->start_controls_tab( |
| 456 | 'icon_normal', |
| 457 | ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')] |
| 458 | ); |
| 459 | |
| 460 | $this->add_responsive_control( |
| 461 | 'category_settings_icon_size_normal', |
| 462 | [ |
| 463 | 'label' => esc_html__('Size', 'essential-addons-for-elementor-lite'), |
| 464 | 'type' => Controls_Manager::SLIDER, |
| 465 | 'size_units' => ['px', '%', 'em'], |
| 466 | 'range' => [ |
| 467 | 'px' => [ |
| 468 | 'max' => 500, |
| 469 | ], |
| 470 | ], |
| 471 | 'selectors' => [ |
| 472 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon img' => 'width: {{SIZE}}{{UNIT}};', |
| 473 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon__layout-2 img' => 'width: {{SIZE}}{{UNIT}};' |
| 474 | ], |
| 475 | ] |
| 476 | ); |
| 477 | |
| 478 | $this->add_group_control( |
| 479 | Group_Control_Background::get_type(), |
| 480 | [ |
| 481 | 'name' => 'icon_background_normal', |
| 482 | 'types' => ['classic', 'gradient'], |
| 483 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon, {{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon__layout-2', |
| 484 | 'exclude' => [ |
| 485 | 'image' |
| 486 | ] |
| 487 | ] |
| 488 | ); |
| 489 | |
| 490 | $this->add_group_control( |
| 491 | Group_Control_Border::get_type(), |
| 492 | [ |
| 493 | 'name' => 'icon_border_normal', |
| 494 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 495 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon, {{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon__layout-2' |
| 496 | ] |
| 497 | ); |
| 498 | |
| 499 | $this->add_responsive_control( |
| 500 | 'icon_border_radius_normal', |
| 501 | [ |
| 502 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 503 | 'type' => Controls_Manager::DIMENSIONS, |
| 504 | 'size_units' => ['px', 'em', '%'], |
| 505 | 'selectors' => [ |
| 506 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 507 | ], |
| 508 | 'condition' => [ |
| 509 | 'layout_template' => 'default' |
| 510 | ] |
| 511 | ] |
| 512 | ); |
| 513 | |
| 514 | $this->add_responsive_control( |
| 515 | 'icon_padding', |
| 516 | [ |
| 517 | 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), |
| 518 | 'type' => Controls_Manager::DIMENSIONS, |
| 519 | 'size_units' => ['px', 'em', '%'], |
| 520 | 'selectors' => [ |
| 521 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 522 | ], |
| 523 | 'condition' => [ |
| 524 | 'layout_template' => 'default' |
| 525 | ] |
| 526 | ] |
| 527 | ); |
| 528 | |
| 529 | $this->add_responsive_control( |
| 530 | 'icon_spacing', |
| 531 | [ |
| 532 | 'label' => esc_html__('Spacing', 'essential-addons-for-elementor-lite'), |
| 533 | 'type' => Controls_Manager::DIMENSIONS, |
| 534 | 'size_units' => ['px', 'em', '%'], |
| 535 | 'allowed_dimensions' => [ |
| 536 | 'top', |
| 537 | 'bottom' |
| 538 | ], |
| 539 | 'selectors' => [ |
| 540 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon' => 'margin: {{TOP}}{{UNIT}} auto {{BOTTOM}}{{UNIT}} auto;' |
| 541 | ], |
| 542 | 'condition' => [ |
| 543 | 'layout_template' => 'default' |
| 544 | ] |
| 545 | ] |
| 546 | ); |
| 547 | |
| 548 | $this->end_controls_tab(); |
| 549 | |
| 550 | // Hover State Tab |
| 551 | $this->start_controls_tab( |
| 552 | 'icon_hover', |
| 553 | ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')] |
| 554 | ); |
| 555 | |
| 556 | $this->add_group_control( |
| 557 | Group_Control_Background::get_type(), |
| 558 | [ |
| 559 | 'name' => 'icon_background_hover', |
| 560 | 'types' => ['classic', 'gradient'], |
| 561 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover .eael-bd-cb-cat-icon, |
| 562 | {{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover .eael-bd-cb-cat-icon__layout-2' |
| 563 | ] |
| 564 | ); |
| 565 | |
| 566 | $this->add_group_control( |
| 567 | Group_Control_Border::get_type(), |
| 568 | [ |
| 569 | 'name' => 'icon_border_hover', |
| 570 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 571 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover .eael-bd-cb-cat-icon, |
| 572 | {{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover .eael-bd-cb-cat-icon__layout-2' |
| 573 | ] |
| 574 | ); |
| 575 | |
| 576 | $this->add_responsive_control( |
| 577 | 'icon_border_radius_hover', |
| 578 | [ |
| 579 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 580 | 'type' => Controls_Manager::DIMENSIONS, |
| 581 | 'size_units' => ['px', 'em', '%'], |
| 582 | 'selectors' => [ |
| 583 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover .eael-bd-cb-cat-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 584 | ], |
| 585 | 'condition' => [ |
| 586 | 'layout_template' => 'default' |
| 587 | ] |
| 588 | ] |
| 589 | ); |
| 590 | |
| 591 | $this->add_control( |
| 592 | 'category_settings_icon_size_transition', |
| 593 | [ |
| 594 | 'label' => __('Transition', 'essential-addons-for-elementor-lite'), |
| 595 | 'type' => Controls_Manager::SLIDER, |
| 596 | 'default' => [ |
| 597 | 'size' => 300, |
| 598 | 'unit' => '%', |
| 599 | ], |
| 600 | 'size_units' => ['%'], |
| 601 | 'range' => [ |
| 602 | '%' => [ |
| 603 | 'max' => 2500, |
| 604 | 'step' => 1, |
| 605 | ], |
| 606 | ], |
| 607 | 'selectors' => [ |
| 608 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .eael-bd-cb-cat-icon' => 'transition: {{SIZE}}ms;', |
| 609 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .eael-bd-cb-cat-icon img' => 'transition: {{SIZE}}ms;', |
| 610 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon__layout-2' => 'transition: {{SIZE}}ms;', |
| 611 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-icon__layout-2 img' => 'transition: {{SIZE}}ms;' |
| 612 | ], |
| 613 | ] |
| 614 | ); |
| 615 | |
| 616 | $this->end_controls_tab(); |
| 617 | |
| 618 | $this->end_controls_tabs(); |
| 619 | |
| 620 | |
| 621 | $this->end_controls_section(); # end of 'Icon Styles' |
| 622 | |
| 623 | |
| 624 | /** |
| 625 | * ---------------------------------------------------------- |
| 626 | * Section: Title Styles |
| 627 | * ---------------------------------------------------------- |
| 628 | */ |
| 629 | $this->start_controls_section( |
| 630 | 'section_box_title_styles', |
| 631 | [ |
| 632 | 'label' => __('Title', 'essential-addons-for-elementor-lite'), |
| 633 | 'tab' => Controls_Manager::TAB_STYLE, |
| 634 | ] |
| 635 | ); |
| 636 | |
| 637 | $this->add_control( |
| 638 | 'title_styles_area_heading', |
| 639 | [ |
| 640 | 'label' => __( 'Area', 'essential-addons-for-elementor-lite' ), |
| 641 | 'type' => Controls_Manager::HEADING, |
| 642 | 'condition' => [ |
| 643 | 'layout_template' => 'Layout_2' |
| 644 | ] |
| 645 | ] |
| 646 | ); |
| 647 | |
| 648 | $this->add_responsive_control( |
| 649 | 'title_area_size', |
| 650 | [ |
| 651 | 'label' => esc_html__('Area Size', 'essential-addons-for-elementor-lite'), |
| 652 | 'type' => Controls_Manager::SLIDER, |
| 653 | 'size_units' => ['px', '%', 'em'], |
| 654 | 'range' => [ |
| 655 | 'px' => [ |
| 656 | 'max' => 500, |
| 657 | ], |
| 658 | ], |
| 659 | 'selectors' => [ |
| 660 | '{{WRAPPER}} .layout__2 .eael-bd-cb-cat-title__layout-2' => 'flex-basis: {{SIZE}}{{UNIT}};' |
| 661 | ], |
| 662 | 'condition' => [ |
| 663 | 'layout_template' => 'Layout_2' |
| 664 | ] |
| 665 | ] |
| 666 | ); |
| 667 | |
| 668 | $this->add_control( |
| 669 | 'title_styles_heading', |
| 670 | [ |
| 671 | 'label' => __( 'Title', 'essential-addons-for-elementor-lite' ), |
| 672 | 'type' => Controls_Manager::HEADING, |
| 673 | 'separator' => 'before' |
| 674 | ] |
| 675 | ); |
| 676 | |
| 677 | $this->start_controls_tabs('box_title_styles_tab'); |
| 678 | |
| 679 | // Normal State Tab |
| 680 | $this->start_controls_tab( |
| 681 | 'title_normal', |
| 682 | ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')] |
| 683 | ); |
| 684 | |
| 685 | $this->add_control( |
| 686 | 'cat_title_color_normal', |
| 687 | [ |
| 688 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 689 | 'type' => Controls_Manager::COLOR, |
| 690 | 'selectors' => [ |
| 691 | '{{WRAPPER}} .eael-bd-cb-inner .eael-bd-cb-cat-title' => 'color: {{VALUE}};', |
| 692 | '{{WRAPPER}} .layout__2 .eael-bd-cb-cat-title__layout-2' => 'color: {{VALUE}};' |
| 693 | ], |
| 694 | ] |
| 695 | ); |
| 696 | |
| 697 | $this->add_responsive_control( |
| 698 | 'title_spacing', |
| 699 | [ |
| 700 | 'label' => __('Spacing', 'essential-addons-for-elementor-lite'), |
| 701 | 'type' => Controls_Manager::DIMENSIONS, |
| 702 | 'size_units' => ['px', '%', 'em'], |
| 703 | 'selectors' => [ |
| 704 | '{{WRAPPER}} .eael-bd-cb-inner .eael-bd-cb-cat-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 705 | '{{WRAPPER}} .layout__2 .eael-bd-cb-cat-title__layout-2 span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 706 | ] |
| 707 | ] |
| 708 | ); |
| 709 | |
| 710 | $this->end_controls_tab(); |
| 711 | |
| 712 | // Hover State Tab |
| 713 | $this->start_controls_tab( |
| 714 | 'title_hover', |
| 715 | ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')] |
| 716 | ); |
| 717 | |
| 718 | $this->add_control( |
| 719 | 'cat_title_color_hover', |
| 720 | [ |
| 721 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 722 | 'type' => Controls_Manager::COLOR, |
| 723 | 'selectors' => [ |
| 724 | '{{WRAPPER}} .eael-bd-cb-inner:hover .eael-bd-cb-cat-title' => 'color: {{VALUE}};', |
| 725 | '{{WRAPPER}} .eael-bd-cb-inner:hover .eael-bd-cb-cat-title__layout-2' => 'color: {{VALUE}};' |
| 726 | ], |
| 727 | ] |
| 728 | ); |
| 729 | |
| 730 | $this->add_control( |
| 731 | 'category_title_transition', |
| 732 | [ |
| 733 | 'label' => __('Transition', 'essential-addons-for-elementor-lite'), |
| 734 | 'type' => Controls_Manager::SLIDER, |
| 735 | 'default' => [ |
| 736 | 'size' => 300, |
| 737 | 'unit' => '%', |
| 738 | ], |
| 739 | 'size_units' => ['%'], |
| 740 | 'range' => [ |
| 741 | '%' => [ |
| 742 | 'max' => 2500, |
| 743 | 'step' => 1, |
| 744 | ], |
| 745 | ], |
| 746 | 'selectors' => [ |
| 747 | '{{WRAPPER}} .eael-bd-cb-inner .eael-bd-cb-cat-title' => 'transition: {{SIZE}}ms;', |
| 748 | '{{WRAPPER}} .eael-bd-cb-inner:hover .eael-bd-cb-cat-title__layout-2' => 'transition: {{SIZE}}ms;', |
| 749 | ], |
| 750 | ] |
| 751 | ); |
| 752 | |
| 753 | $this->end_controls_tab(); |
| 754 | |
| 755 | $this->end_controls_tabs(); |
| 756 | |
| 757 | $this->add_group_control( |
| 758 | Group_Control_Typography::get_type(), |
| 759 | [ |
| 760 | 'name' => 'cat_title_typography_normal', |
| 761 | 'selector' => '{{WRAPPER}} .eael-bd-cb-inner .eael-bd-cb-cat-title, {{WRAPPER}} .layout__2 .eael-bd-cb-cat-title__layout-2' |
| 762 | ] |
| 763 | ); |
| 764 | |
| 765 | $this->add_responsive_control( |
| 766 | 'title_alignment', |
| 767 | [ |
| 768 | 'label' => __('Text Alignment', 'essential-addons-for-elementor-lite'), |
| 769 | 'type' => Controls_Manager::CHOOSE, |
| 770 | 'options' => [ |
| 771 | 'flex-start' => [ |
| 772 | 'title' => __('Left', 'essential-addons-for-elementor-lite'), |
| 773 | 'icon' => 'eicon-text-align-left', |
| 774 | ], |
| 775 | 'center' => [ |
| 776 | 'title' => __('Center', 'essential-addons-for-elementor-lite'), |
| 777 | 'icon' => 'eicon-text-align-center', |
| 778 | ], |
| 779 | 'flex-end' => [ |
| 780 | 'title' => __('Right', 'essential-addons-for-elementor-lite'), |
| 781 | 'icon' => 'eicon-text-align-right', |
| 782 | ], |
| 783 | ], |
| 784 | 'selectors' => [ |
| 785 | '{{WRAPPER}} .layout__2 .eael-bd-cb-cat-title__layout-2' => 'justify-content: {{VALUE}};', |
| 786 | ], |
| 787 | 'condition' => [ |
| 788 | 'layout_template' => 'Layout_2' |
| 789 | ], |
| 790 | 'separator' => 'before' |
| 791 | ] |
| 792 | ); |
| 793 | |
| 794 | $this->end_controls_section(); # end of 'Icon Styles' |
| 795 | |
| 796 | /** |
| 797 | * ---------------------------------------------------------- |
| 798 | * Section: Count Styles |
| 799 | * ---------------------------------------------------------- |
| 800 | */ |
| 801 | $this->start_controls_section( |
| 802 | 'section_box_count_styles', |
| 803 | [ |
| 804 | 'label' => __('Count', 'essential-addons-for-elementor-lite'), |
| 805 | 'tab' => Controls_Manager::TAB_STYLE, |
| 806 | ] |
| 807 | ); |
| 808 | |
| 809 | $this->add_control( |
| 810 | 'count_styles_area_heading', |
| 811 | [ |
| 812 | 'label' => __( 'Area', 'essential-addons-for-elementor-lite' ), |
| 813 | 'type' => Controls_Manager::HEADING |
| 814 | ] |
| 815 | ); |
| 816 | |
| 817 | $this->add_responsive_control( |
| 818 | 'count_area_size', |
| 819 | [ |
| 820 | 'label' => esc_html__('Size', 'essential-addons-for-elementor-lite'), |
| 821 | 'type' => Controls_Manager::SLIDER, |
| 822 | 'size_units' => ['px', '%', 'em'], |
| 823 | 'range' => [ |
| 824 | 'px' => [ |
| 825 | 'max' => 500, |
| 826 | ], |
| 827 | ], |
| 828 | 'selectors' => [ |
| 829 | '{{WRAPPER}} .layout__2 .eael-bd-cb-cat-count__layout-2' => 'flex-basis: {{SIZE}}{{UNIT}};' |
| 830 | ], |
| 831 | 'condition' => [ |
| 832 | 'layout_template' => 'Layout_2' |
| 833 | ] |
| 834 | ] |
| 835 | ); |
| 836 | |
| 837 | $this->add_control( |
| 838 | 'count_styles_heading', |
| 839 | [ |
| 840 | 'label' => __( 'Count', 'essential-addons-for-elementor-lite' ), |
| 841 | 'type' => Controls_Manager::HEADING, |
| 842 | 'separator' => 'before' |
| 843 | ] |
| 844 | ); |
| 845 | |
| 846 | $this->start_controls_tabs('box_count_styles_tab'); |
| 847 | |
| 848 | // Normal State Tab |
| 849 | $this->start_controls_tab( |
| 850 | 'count_normal', |
| 851 | ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')] |
| 852 | ); |
| 853 | |
| 854 | $this->add_group_control( |
| 855 | Group_Control_Typography::get_type(), |
| 856 | [ |
| 857 | 'name' => 'count_typography_normal', |
| 858 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .eael-bd-cb-cat-count, {{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .count-inner__layout-2' |
| 859 | ] |
| 860 | ); |
| 861 | |
| 862 | $this->add_control( |
| 863 | 'count_color_normal', |
| 864 | [ |
| 865 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 866 | 'type' => Controls_Manager::COLOR, |
| 867 | 'selectors' => [ |
| 868 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .eael-bd-cb-cat-count' => 'color: {{VALUE}};', |
| 869 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .count-inner__layout-2' => 'color: {{VALUE}};' |
| 870 | ], |
| 871 | ] |
| 872 | ); |
| 873 | |
| 874 | $this->add_group_control( |
| 875 | Group_Control_Background::get_type(), |
| 876 | [ |
| 877 | 'name' => 'count_box_bg', |
| 878 | 'types' => ['classic', 'gradient'], |
| 879 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .count-inner__layout-2', |
| 880 | 'condition' => [ |
| 881 | 'layout_template' => 'Layout_2' |
| 882 | ] |
| 883 | ] |
| 884 | ); |
| 885 | |
| 886 | $this->add_group_control( |
| 887 | Group_Control_Border::get_type(), |
| 888 | [ |
| 889 | 'name' => 'count_box_border', |
| 890 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 891 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .count-inner__layout-2', |
| 892 | 'condition' => [ |
| 893 | 'layout_template' => 'Layout_2' |
| 894 | ] |
| 895 | ] |
| 896 | ); |
| 897 | |
| 898 | $this->add_responsive_control( |
| 899 | 'count_box_border_radius', |
| 900 | [ |
| 901 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 902 | 'type' => Controls_Manager::DIMENSIONS, |
| 903 | 'size_units' => ['px', 'em', '%'], |
| 904 | 'selectors' => [ |
| 905 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .count-inner__layout-2' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 906 | ], |
| 907 | 'condition' => [ |
| 908 | 'layout_template' => 'Layout_2' |
| 909 | ] |
| 910 | ] |
| 911 | ); |
| 912 | |
| 913 | $this->add_group_control( |
| 914 | Group_Control_Box_Shadow::get_type(), |
| 915 | [ |
| 916 | 'name' => 'count_box_box_shadow', |
| 917 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .count-inner__layout-2', |
| 918 | 'condition' => [ |
| 919 | 'layout_template' => 'Layout_2' |
| 920 | ] |
| 921 | ] |
| 922 | ); |
| 923 | |
| 924 | $this->add_responsive_control( |
| 925 | 'count_box_size', |
| 926 | [ |
| 927 | 'label' => esc_html__('Size', 'essential-addons-for-elementor-lite'), |
| 928 | 'type' => Controls_Manager::SLIDER, |
| 929 | 'size_units' => ['px', '%', 'em'], |
| 930 | 'range' => [ |
| 931 | 'px' => [ |
| 932 | 'max' => 500, |
| 933 | ], |
| 934 | ], |
| 935 | 'selectors' => [ |
| 936 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .count-inner__layout-2' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};' |
| 937 | ], |
| 938 | 'condition' => [ |
| 939 | 'layout_template' => 'Layout_2' |
| 940 | ] |
| 941 | ] |
| 942 | ); |
| 943 | |
| 944 | $this->add_responsive_control( |
| 945 | 'count_spacing', |
| 946 | [ |
| 947 | 'label' => __('Spacing', 'essential-addons-for-elementor-lite'), |
| 948 | 'type' => Controls_Manager::DIMENSIONS, |
| 949 | 'size_units' => ['px', '%', 'em'], |
| 950 | 'selectors' => [ |
| 951 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner .eael-bd-cb-cat-count' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 952 | ], |
| 953 | 'condition' => [ |
| 954 | 'layout_template!' => 'Layout_2' |
| 955 | ] |
| 956 | ] |
| 957 | ); |
| 958 | |
| 959 | $this->end_controls_tab(); |
| 960 | |
| 961 | // Hover State Tab |
| 962 | $this->start_controls_tab( |
| 963 | 'count_hover', |
| 964 | ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')] |
| 965 | ); |
| 966 | |
| 967 | $this->add_control( |
| 968 | 'count_color_hover', |
| 969 | [ |
| 970 | 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'), |
| 971 | 'type' => Controls_Manager::COLOR, |
| 972 | 'selectors' => [ |
| 973 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover .eael-bd-cb-cat-count' => 'color: {{VALUE}};', |
| 974 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover .count-inner__layout-2' => 'color: {{VALUE}};' |
| 975 | ], |
| 976 | ] |
| 977 | ); |
| 978 | |
| 979 | $this->add_group_control( |
| 980 | Group_Control_Background::get_type(), |
| 981 | [ |
| 982 | 'name' => 'count_box_bg_hover', |
| 983 | 'types' => ['classic', 'gradient'], |
| 984 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover .count-inner__layout-2', |
| 985 | 'condition' => [ |
| 986 | 'layout_template' => 'Layout_2' |
| 987 | ] |
| 988 | ] |
| 989 | ); |
| 990 | |
| 991 | $this->add_group_control( |
| 992 | Group_Control_Border::get_type(), |
| 993 | [ |
| 994 | 'name' => 'count_box_border_hover', |
| 995 | 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'), |
| 996 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover .count-inner__layout-2', |
| 997 | 'condition' => [ |
| 998 | 'layout_template' => 'Layout_2' |
| 999 | ] |
| 1000 | ] |
| 1001 | ); |
| 1002 | |
| 1003 | $this->add_responsive_control( |
| 1004 | 'count_box_border_radius_hover', |
| 1005 | [ |
| 1006 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 1007 | 'type' => Controls_Manager::DIMENSIONS, |
| 1008 | 'size_units' => ['px', 'em', '%'], |
| 1009 | 'selectors' => [ |
| 1010 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover .count-inner__layout-2' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' |
| 1011 | ], |
| 1012 | 'condition' => [ |
| 1013 | 'layout_template' => 'Layout_2' |
| 1014 | ] |
| 1015 | ] |
| 1016 | ); |
| 1017 | |
| 1018 | $this->add_group_control( |
| 1019 | Group_Control_Box_Shadow::get_type(), |
| 1020 | [ |
| 1021 | 'name' => 'count_box_box_shadow_hover', |
| 1022 | 'selector' => '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-inner:hover .count-inner__layout-2', |
| 1023 | 'condition' => [ |
| 1024 | 'layout_template' => 'Layout_2' |
| 1025 | ] |
| 1026 | ] |
| 1027 | ); |
| 1028 | |
| 1029 | $this->add_control( |
| 1030 | 'category_count_transition', |
| 1031 | [ |
| 1032 | 'label' => __('Transition', 'essential-addons-for-elementor-lite'), |
| 1033 | 'type' => Controls_Manager::SLIDER, |
| 1034 | 'default' => [ |
| 1035 | 'size' => 300, |
| 1036 | 'unit' => '%', |
| 1037 | ], |
| 1038 | 'size_units' => ['%'], |
| 1039 | 'range' => [ |
| 1040 | '%' => [ |
| 1041 | 'max' => 2500, |
| 1042 | 'step' => 1, |
| 1043 | ], |
| 1044 | ], |
| 1045 | 'selectors' => [ |
| 1046 | '{{WRAPPER}} .eael-better-docs-category-box-post .eael-bd-cb-cat-count' => 'transition: {{SIZE}}ms;', |
| 1047 | '{{WRAPPER}} .layout__2 .eael-bd-cb-cat-count__layout-2 .count-inner__layout-2' => 'transition: {{SIZE}}ms;', |
| 1048 | ], |
| 1049 | ] |
| 1050 | ); |
| 1051 | |
| 1052 | $this->end_controls_tab(); |
| 1053 | |
| 1054 | $this->end_controls_tabs(); |
| 1055 | |
| 1056 | $this->end_controls_section(); # end of 'Count Styles' |
| 1057 | |
| 1058 | } |
| 1059 | |
| 1060 | } |
| 1061 | |
| 1062 | protected function render() |
| 1063 | { |
| 1064 | if (!defined('BETTERDOCS_URL')) return; |
| 1065 | $settings = $this->get_settings_for_display(); |
| 1066 | |
| 1067 | $this->add_render_attribute( |
| 1068 | 'bd_category_box_wrapper', |
| 1069 | [ |
| 1070 | 'id' => 'eael-bd-cat-box-' . esc_attr($this->get_id()), |
| 1071 | 'class' => [ |
| 1072 | 'eael-better-docs-category-box-wrapper', |
| 1073 | ], |
| 1074 | ] |
| 1075 | ); |
| 1076 | |
| 1077 | $this->add_render_attribute( |
| 1078 | 'bd_category_box_inner', |
| 1079 | [ |
| 1080 | 'class' => [ |
| 1081 | 'eael-better-docs-category-box' |
| 1082 | ] |
| 1083 | ] |
| 1084 | ); |
| 1085 | |
| 1086 | |
| 1087 | $terms_object = array( |
| 1088 | 'taxonomy' => 'doc_category', |
| 1089 | 'order' => $settings['order'], |
| 1090 | 'offset' => $settings['offset'], |
| 1091 | 'number' => $settings['box_per_page'] |
| 1092 | ); |
| 1093 | |
| 1094 | if ($settings['include']) { |
| 1095 | $terms_object['include'] = array_diff($settings['include'], (array) $settings['exclude']); |
| 1096 | } |
| 1097 | |
| 1098 | if ($settings['exclude']) { |
| 1099 | $terms_object['exclude'] = $settings['exclude']; |
| 1100 | } |
| 1101 | |
| 1102 | if ($settings['orderby'] == 'betterdocs_order') { |
| 1103 | $terms_object['meta_key'] = 'doc_category_order'; |
| 1104 | $terms_object['orderby'] = 'meta_value_num'; |
| 1105 | $terms_object['order'] = 'ASC'; |
| 1106 | } else { |
| 1107 | $terms_object['orderby'] = $settings['orderby']; |
| 1108 | } |
| 1109 | |
| 1110 | |
| 1111 | $default_multiple_kb = Helper::get_betterdocs_multiple_kb_status(); |
| 1112 | |
| 1113 | if ($settings['layout_template'] == 'Layout_2') { |
| 1114 | $settings['layout_template'] = 'layout-2'; |
| 1115 | } |
| 1116 | |
| 1117 | if($default_multiple_kb) { |
| 1118 | |
| 1119 | $taxonomy_objects = Helper::get_multiple_kb_terms(false, false); |
| 1120 | |
| 1121 | $meta_query = ''; |
| 1122 | |
| 1123 | if(!empty($settings['selected_knowledge_base'])){ |
| 1124 | $terms_object['meta_query'] = array( |
| 1125 | array( |
| 1126 | 'relation' => 'OR', |
| 1127 | array( |
| 1128 | 'key' => 'doc_category_knowledge_base', |
| 1129 | 'value' => $settings['selected_knowledge_base'], |
| 1130 | 'compare' => 'LIKE' |
| 1131 | ) |
| 1132 | ), |
| 1133 | ); |
| 1134 | } |
| 1135 | |
| 1136 | $taxonomy_objects = get_terms( $terms_object ); |
| 1137 | |
| 1138 | echo '<div '; $this->print_render_attribute_string('bd_category_box_wrapper'); echo '>'; |
| 1139 | echo '<div '; $this->print_render_attribute_string('bd_category_box_inner'); echo '>'; |
| 1140 | |
| 1141 | if ( file_exists( $this->get_template( $settings['layout_template'] ) ) ) { |
| 1142 | if ( $taxonomy_objects && !is_wp_error( $taxonomy_objects ) ) { |
| 1143 | foreach ( $taxonomy_objects as $term) { |
| 1144 | ob_start(); |
| 1145 | include( $this->get_template( $settings['layout_template'] ) ); |
| 1146 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 1147 | echo ob_get_clean(); |
| 1148 | } |
| 1149 | } else { |
| 1150 | echo '<p class="no-posts-found">' . esc_html__( 'No posts found!', 'essential-addons-for-elementor-lite' ) . '</p>'; |
| 1151 | } |
| 1152 | |
| 1153 | wp_reset_postdata(); |
| 1154 | |
| 1155 | } else { |
| 1156 | echo '<h4>' . esc_html__('File Not Found', 'essential-addons-for-elementor-lite') . '</h4>'; |
| 1157 | } |
| 1158 | |
| 1159 | echo '</div>'; |
| 1160 | echo '</div>'; |
| 1161 | |
| 1162 | } else { |
| 1163 | $taxonomy_objects = get_terms($terms_object); |
| 1164 | |
| 1165 | echo '<div '; $this->print_render_attribute_string('bd_category_box_wrapper'); echo '>'; |
| 1166 | echo '<div '; $this->print_render_attribute_string('bd_category_box_inner'); echo '>'; |
| 1167 | |
| 1168 | if ( file_exists( $this->get_template( $settings['layout_template'] ) ) ) { |
| 1169 | |
| 1170 | if ( $taxonomy_objects && !is_wp_error( $taxonomy_objects ) ) { |
| 1171 | foreach ( $taxonomy_objects as $term ) { |
| 1172 | ob_start(); |
| 1173 | include( $this->get_template( $settings['layout_template'] ) ); |
| 1174 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 1175 | echo ob_get_clean(); |
| 1176 | } |
| 1177 | } else { |
| 1178 | echo '<p class="no-posts-found">' . esc_html__( 'No posts found!', 'essential-addons-for-elementor-lite' ) . '</p>'; |
| 1179 | } |
| 1180 | |
| 1181 | wp_reset_postdata(); |
| 1182 | |
| 1183 | } else { |
| 1184 | echo '<h4>' . esc_html__('File Not Found', 'essential-addons-for-elementor-lite') . '</h4>'; |
| 1185 | } |
| 1186 | |
| 1187 | echo '</div>'; |
| 1188 | echo '</div>'; |
| 1189 | } |
| 1190 | |
| 1191 | } |
| 1192 | |
| 1193 | } |
| 1194 |