PluginProbe ʕ •ᴥ•ʔ
Essential Addons for Elementor – Popular Elementor Templates & Widgets / 4.1.0
Essential Addons for Elementor – Popular Elementor Templates & Widgets v4.1.0
6.6.5 6.6.4 6.6.3 5.7.3 5.7.4 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.15 5.8.16 5.8.18 5.8.2 5.8.3 5.8.4 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9 5.9.0 5.9.1 5.9.10 5.9.11 5.9.12 5.9.13 5.9.14 5.9.15 5.9.16 5.9.17 5.9.18 5.9.19 5.9.2 5.9.20 5.9.21 5.9.22 5.9.23 5.9.24 5.9.25 5.9.26 5.9.27 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9 6.0.0 6.0.1 6.0.10 6.0.11 6.0.12 6.0.13 6.0.14 6.0.15 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 6.0.8 6.0.9 6.1.0 6.1.1 6.1.10 6.1.11 trunk 6.1.12 1.0.0 6.1.13 1.0.1 6.1.14 1.1.0 6.1.15 2.0 6.1.17 2.1 6.1.18 2.10.0 6.1.19 2.10.1 6.1.2 2.10.2 6.1.20 2.10.3 6.1.3 2.10.4 6.1.4 2.10.5 6.1.5 2.2.0 6.1.6 2.2.1 6.1.7 2.2.2 6.1.8 2.2.3 6.1.9 2.2.4 6.2.0 2.2.5 6.2.1 2.3.0 6.2.2 2.3.1 6.2.3 2.4.0 6.2.4 2.4.1 6.3.0 2.4.2 6.3.1 2.4.3 6.3.2 2.5.0 6.3.3 2.6.0 6.4.0 2.7.0 6.5.0 2.7.1 6.5.1 2.7.10 6.5.10 2.7.11 6.5.11 2.7.2 6.5.12 2.7.3 6.5.13 2.7.4 6.5.2 2.7.5 6.5.3 2.7.6 6.5.4 2.7.7 6.5.5 2.7.8 6.5.6 2.7.9 6.5.7 2.8.0 6.5.8 2.8.1 6.5.9 2.8.2 6.6.0 2.8.3 6.6.1 2.8.4 6.6.2 2.8.5 2.8.6 2.8.7 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.4.1 3.1.5 3.2.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.5.0 3.5.1 3.5.2 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1 3.7.2 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.9.0 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.6 4.9.7 5.0.0 5.0.1 5.0.10 5.0.11 5.0.12 5.0.13 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.4.6 5.5.5 5.6.5 5.7.2
essential-addons-for-elementor-lite / includes / Elements / Betterdocs_Category_Grid.php
essential-addons-for-elementor-lite / includes / Elements Last commit date
Adv_Accordion.php 5 years ago Adv_Tabs.php 5 years ago Advanced_Data_Table.php 5 years ago Betterdocs_Category_Box.php 5 years ago Betterdocs_Category_Grid.php 5 years ago Betterdocs_Search_Form.php 5 years ago Caldera_Forms.php 5 years ago Contact_Form_7.php 5 years ago Content_Ticker.php 5 years ago Countdown.php 5 years ago Creative_Button.php 5 years ago Cta_Box.php 5 years ago Data_Table.php 5 years ago Dual_Color_Header.php 5 years ago EmbedPress.php 5 years ago Event_Calendar.php 5 years ago Facebook_Feed.php 5 years ago Fancy_Text.php 5 years ago Feature_List.php 5 years ago Filterable_Gallery.php 5 years ago Flip_Box.php 5 years ago FluentForm.php 5 years ago Formstack.php 5 years ago GravityForms.php 5 years ago Image_Accordion.php 5 years ago Info_Box.php 5 years ago NinjaForms.php 5 years ago Post_Grid.php 5 years ago Post_Timeline.php 5 years ago Pricing_Table.php 5 years ago Product_Grid.php 5 years ago Progress_Bar.php 5 years ago Sticky_Video.php 5 years ago Team_Member.php 5 years ago Testimonial.php 5 years ago Tooltip.php 5 years ago Twitter_Feed.php 5 years ago TypeForm.php 5 years ago WeForms.php 5 years ago Woo_Checkout.php 5 years ago WpForms.php 5 years ago
Betterdocs_Category_Grid.php
1557 lines
1 <?php
2 namespace Essential_Addons_Elementor\Elements;
3
4 // If this file is called directly, abort.
5 if (!defined('ABSPATH')) {
6 exit;
7 }
8
9 use \Elementor\Controls_Manager as Controls_Manager;
10 use \Elementor\Group_Control_Background;
11 use \Elementor\Group_Control_Border as Group_Control_Border;
12 use \Elementor\Group_Control_Typography as Group_Control_Typography;
13 use \Elementor\Widget_Base as Widget_Base;
14 use \Elementor\Group_Control_Box_Shadow;
15
16 class Betterdocs_Category_Grid extends Widget_Base
17 {
18
19 use \Essential_Addons_Elementor\Traits\Helper;
20 use \Essential_Addons_Elementor\Traits\Template_Query;
21
22 public function get_name()
23 {
24 return 'eael-betterdocs-category-grid';
25 }
26
27 public function get_title()
28 {
29 return __('BetterDocs Category Grid', '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-category-grid';
40 }
41
42 public function get_style_depends()
43 {
44 return [
45 'font-awesome-5-all',
46 'font-awesome-4-shim',
47 ];
48 }
49
50 /**
51 * Get widget keywords.
52 *
53 * Retrieve the list of keywords the widget belongs to.
54 *
55 * @since 3.5.2
56 * @access public
57 *
58 * @return array Widget keywords.
59 */
60 public function get_keywords()
61 {
62 return [
63 'knowledgebase',
64 'knowledge base',
65 'documentation',
66 'Doc',
67 'kb',
68 'betterdocs',
69 'ea betterdocs',
70 'ea',
71 'essential addons',
72 ];
73 }
74
75 public function get_custom_help_url()
76 {
77 return 'https://essential-addons.com/elementor/docs/betterdocs-category-grid/';
78 }
79
80 protected function _register_controls()
81 {
82 /*-----------------------------------------------------------------------------------*/
83 /* Content Tab
84 /*-----------------------------------------------------------------------------------*/
85 if (!defined('BETTERDOCS_URL')) {
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 * Query Controls!
107 * @source includes/elementor-helper.php
108 */
109 $this->eael_betterdocs_query_controls();
110
111 /**
112 * ----------------------------------------------------------
113 * Section: Layout Options
114 * ----------------------------------------------------------
115 */
116 $this->start_controls_section(
117 'select_layout',
118 [
119 'label' => __('Layout Options', 'essential-addons-for-elementor-lite'),
120 ]
121 );
122
123 $this->add_control(
124 'layout_template',
125 [
126 'label' => __('Select Layout', 'essential-addons-for-elementor-lite'),
127 'type' => Controls_Manager::SELECT2,
128 'options' => $this->template_list(),
129 'default' => $this->get_default(),
130 'label_block' => true
131 ]
132 );
133
134 $this->add_control(
135 'layout_mode',
136 [
137 'label' => __('Layout Mode', 'essential-addons-for-elementor-lite'),
138 'type' => Controls_Manager::SELECT2,
139 'options' => [
140 'grid' => __('Grid', 'essential-addons-for-elementor-lite'),
141 'fit-to-screen' => __( 'Fit to Screen', 'essential-addons-for-elementor-lite' ),
142 'masonry' => __('Masonry', 'essential-addons-for-elementor-lite'),
143 ],
144 'default' => 'grid',
145 'label_block' => true,
146 ]
147 );
148
149 $this->add_responsive_control(
150 'grid_column',
151 [
152 'label' => __('Grid Column', 'essential-addons-for-elementor-lite'),
153 'type' => Controls_Manager::SELECT,
154 'default' => '3',
155 'tablet_default' => '2',
156 'mobile_default' => '1',
157 'options' => [
158 '1' => '1',
159 '2' => '2',
160 '3' => '3',
161 '4' => '4',
162 '5' => '5',
163 '6' => '6',
164 ],
165 'prefix_class' => 'elementor-grid%s-',
166 'frontend_available' => true,
167 'label_block' => true
168 ]
169 );
170
171 $this->add_control(
172 'show_header',
173 [
174 'label' => __('Show Header', 'essential-addons-for-elementor-lite'),
175 'type' => Controls_Manager::SWITCHER,
176 'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
177 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
178 'return_value' => 'true',
179 'default' => 'true',
180 ]
181 );
182
183
184 $this->add_control(
185 'show_icon',
186 [
187 'label' => __('Show Icon', 'essential-addons-for-elementor-lite'),
188 'type' => Controls_Manager::SWITCHER,
189 'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
190 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
191 'return_value' => 'true',
192 'default' => 'true',
193 'condition' => [
194 'show_header' => 'true'
195 ]
196 ]
197 );
198
199 $this->add_control(
200 'show_title',
201 [
202 'label' => __('Show Title', 'essential-addons-for-elementor-lite'),
203 'type' => Controls_Manager::SWITCHER,
204 'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
205 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
206 'return_value' => 'true',
207 'default' => 'true',
208 'condition' => [
209 'show_header' => 'true'
210 ]
211 ]
212 );
213
214 $this->add_control(
215 'title_tag',
216 [
217 'label' => __('Select Tag', 'essential-addons-for-elementor-lite'),
218 'type' => Controls_Manager::SELECT,
219 'default' => 'h2',
220 'options' => [
221 'h1' => __('H1', 'essential-addons-for-elementor-lite'),
222 'h2' => __('H2', 'essential-addons-for-elementor-lite'),
223 'h3' => __('H3', 'essential-addons-for-elementor-lite'),
224 'h4' => __('H4', 'essential-addons-for-elementor-lite'),
225 'h5' => __('H5', 'essential-addons-for-elementor-lite'),
226 'h6' => __('H6', 'essential-addons-for-elementor-lite'),
227 'span' => __('Span', 'essential-addons-for-elementor-lite'),
228 'p' => __('P', 'essential-addons-for-elementor-lite'),
229 'div' => __('Div', 'essential-addons-for-elementor-lite'),
230 ],
231 'condition' => [
232 'show_title' => 'true',
233 'show_header' => 'true'
234 ],
235 ]
236 );
237
238 $this->add_control(
239 'show_count',
240 [
241 'label' => __('Show Count', 'essential-addons-for-elementor-lite'),
242 'type' => Controls_Manager::SWITCHER,
243 'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
244 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
245 'return_value' => 'true',
246 'default' => 'true',
247 'condition' => [
248 'show_header' => 'true'
249 ]
250 ]
251 );
252
253
254 $this->add_control(
255 'show_list',
256 [
257 'label' => __('Show List', 'essential-addons-for-elementor-lite'),
258 'type' => Controls_Manager::SWITCHER,
259 'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
260 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
261 'return_value' => 'true',
262 'default' => 'true',
263 ]
264 );
265
266 $this->add_control(
267 'show_button',
268 [
269 'label' => __('Show Button', 'essential-addons-for-elementor-lite'),
270 'type' => Controls_Manager::SWITCHER,
271 'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
272 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
273 'return_value' => 'true',
274 'default' => 'true',
275 ]
276 );
277
278 $this->add_control(
279 'button_text',
280 [
281 'label' => __('Button Text', 'essential-addons-for-elementor-lite'),
282 'type' => Controls_Manager::TEXT,
283 'default' => __('Explore More', 'essential-addons-for-elementor-lite'),
284 'condition' => [
285 'show_button' => 'true',
286 ],
287 ]
288 );
289
290 $this->end_controls_section(); #end of section 'Layout Options'
291
292 /**
293 * ----------------------------------------------------------
294 * Section: Column Settings
295 * ----------------------------------------------------------
296 */
297 $this->start_controls_section(
298 'section_column_settings',
299 [
300 'label' => __('Grid', 'essential-addons-for-elementor-lite'),
301 'tab' => Controls_Manager::TAB_STYLE,
302 ]
303 );
304
305
306 $this->start_controls_tabs('grid_style_tab');
307
308 // Normal State Tab
309 $this->start_controls_tab(
310 'grid_normal',
311 ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]
312 );
313
314 $this->add_group_control(
315 Group_Control_Background::get_type(),
316 [
317 'name' => 'grid_bg', // Legacy control id 'content_area_bg'
318 'types' => ['classic', 'gradient'],
319 'selector' => '{{WRAPPER}} .eael-better-docs-category-grid-post .eael-bd-cg-inner',
320 ]
321 );
322
323 $this->add_group_control(
324 Group_Control_Box_Shadow::get_type(),
325 [
326 'name' => 'grid_box_shadow',
327 'label' => __( 'Box Shadow', 'essential-addons-for-elementor-lite' ),
328 'selector' => '{{WRAPPER}} .eael-better-docs-category-grid-wrapper .eael-bd-cg-inner',
329 ]
330 );
331
332
333 $this->add_group_control(
334 Group_Control_Border::get_type(),
335 [
336 'name' => 'grid_border',
337 'label' => __( 'Border', 'essential-addons-for-elementor-lite' ),
338 'selector' => '{{WRAPPER}} .eael-better-docs-category-grid-wrapper .eael-bd-cg-inner',
339 ]
340 );
341
342 $this->add_responsive_control(
343 'grid_border_radius',
344 [
345 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ),
346 'type' => Controls_Manager::DIMENSIONS,
347 'size_units' => [ 'px', '%', 'em' ],
348 'selectors' => [
349 '{{WRAPPER}} .eael-better-docs-category-grid-wrapper .eael-bd-cg-inner' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
350 ]
351 ]
352 );
353
354 $this->end_controls_tab();
355
356 // Hover State Tab
357 $this->start_controls_tab(
358 'grid_hover',
359 ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]
360 );
361
362 $this->add_group_control(
363 Group_Control_Background::get_type(),
364 [
365 'name' => 'grid_bg_hover',
366 'types' => ['classic', 'gradient'],
367 'selector' => '{{WRAPPER}} .eael-better-docs-category-grid-post .eael-bd-cg-inner:hover',
368 ]
369 );
370
371 $this->add_group_control(
372 Group_Control_Box_Shadow::get_type(),
373 [
374 'name' => 'grid_hover_box_shadow',
375 'label' => __( 'Box Shadow', 'essential-addons-for-elementor-lite' ),
376 'selector' => '{{WRAPPER}} .eael-better-docs-category-grid-wrapper .eael-bd-cg-inner:hover',
377 ]
378 );
379
380
381 $this->add_group_control(
382 Group_Control_Border::get_type(),
383 [
384 'name' => 'grid_hover_border',
385 'label' => __( 'Border', 'essential-addons-for-elementor-lite' ),
386 'selector' => '{{WRAPPER}} .eael-better-docs-category-grid-wrapper .eael-bd-cg-inner:hover',
387 ]
388 );
389
390 $this->add_responsive_control(
391 'grid_hover_border_radius',
392 [
393 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ),
394 'type' => Controls_Manager::DIMENSIONS,
395 'size_units' => [ 'px', '%', 'em' ],
396 'selectors' => [
397 '{{WRAPPER}} .eael-better-docs-category-grid-wrapper .eael-bd-cg-inner:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
398 ]
399 ]
400 );
401
402 $this->end_controls_tab();
403
404 $this->end_controls_tabs(); # end of $this->start_controls_tabs('grid_style_tab');
405
406 $this->add_responsive_control(
407 'grid_padding',
408 [
409 'label' => __( 'Grid Padding', 'essential-addons-for-elementor-lite' ),
410 'type' => Controls_Manager::DIMENSIONS,
411 'size_units' => [ 'px', '%', 'em' ],
412 'selectors' => [
413 '{{WRAPPER}} .eael-better-docs-category-grid-wrapper .eael-bd-cg-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
414 ],
415 'separator' => 'before'
416 ]
417 );
418
419 $this->add_responsive_control(
420 'column_padding', // Legacy control id
421 [
422 'label' => __( 'Grid Spacing', 'essential-addons-for-elementor-lite' ),
423 'type' => Controls_Manager::DIMENSIONS,
424 'size_units' => [ 'px', '%', 'em' ],
425 'selectors' => [
426 '{{WRAPPER}} .eael-better-docs-category-grid-wrapper .eael-bd-cg-inner' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
427 ]
428 ]
429 );
430
431 $this->end_controls_section(); # end of 'Column Settings'
432
433
434 $this->start_controls_section(
435 'section_icon_settings',
436 [
437 'label' => __('Icon', 'essential-addons-for-elementor-lite'),
438 'tab' => Controls_Manager::TAB_STYLE,
439 'condition' => [
440 'show_icon' => 'true',
441 'layout_template' => 'Layout_Default'
442 ]
443 ]
444 );
445
446 $this->start_controls_tabs('icon_settings_tabs');
447
448 // Normal State Tab
449 $this->start_controls_tab(
450 'icon_normal',
451 ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]
452 );
453
454 $this->add_group_control(
455 Group_Control_Background::get_type(),
456 [
457 'name' => 'header_icon_bg',
458 'types' => ['classic', 'gradient'],
459 'selector' => '{{WRAPPER}} .eael-bd-cg-header .eael-docs-cat-icon',
460 'exclude' => [
461 'image'
462 ]
463 ]
464 );
465
466 $this->add_group_control(
467 Group_Control_Border::get_type(),
468 [
469 'name' => 'header_icon_border', // Legacy control name change it with 'border_size' if anything happens.
470 'label' => __( 'Border', 'essential-addons-for-elementor-lite' ),
471 'selector' => '{{WRAPPER}} .eael-bd-cg-header .eael-docs-cat-icon',
472 ]
473 );
474
475 $this->add_control(
476 'header_icon_border_radius',
477 [
478 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ),
479 'type' => Controls_Manager::DIMENSIONS,
480 'size_units' => [ 'px', '%', 'em' ],
481 'selectors' => [
482 '{{WRAPPER}} .eael-bd-cg-header .eael-docs-cat-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
483 ]
484 ]
485 );
486
487 $this->end_controls_tab();
488
489 // Hover State Tab
490 $this->start_controls_tab(
491 'icon_hover',
492 ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]
493 );
494
495 $this->add_group_control(
496 Group_Control_Background::get_type(),
497 [
498 'name' => 'header_icon_bg_hover',
499 'types' => ['classic', 'gradient'],
500 'selector' => '{{WRAPPER}} .eael-bd-cg-header .eael-docs-cat-icon:hover',
501 'exclude' => [
502 'image'
503 ]
504 ]
505 );
506
507 $this->add_group_control(
508 Group_Control_Border::get_type(),
509 [
510 'name' => 'header_icon_border_hover', // Legacy control name change it with 'border_size' if anything happens.
511 'label' => __( 'Border', 'essential-addons-for-elementor-lite' ),
512 'selector' => '{{WRAPPER}} .eael-bd-cg-header .eael-docs-cat-icon:hover',
513 ]
514 );
515
516 $this->add_control(
517 'header_icon_border_radius_hover',
518 [
519 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ),
520 'type' => Controls_Manager::DIMENSIONS,
521 'size_units' => [ 'px', '%', 'em' ],
522 'selectors' => [
523 '{{WRAPPER}} .eael-bd-cg-header .eael-docs-cat-icon:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
524 ]
525 ]
526 );
527
528 $this->end_controls_tab();
529
530 $this->end_controls_tabs();
531
532 $this->add_responsive_control(
533 'header_icon_size',
534 [
535 'label' => __('Size', 'essential-addons-for-elementor-lite'),
536 'type' => Controls_Manager::SLIDER,
537 'size_units' => ['px', '%', 'em'],
538 'range' => [
539 '%' => [
540 'max' => 100,
541 'step' => 1,
542 ],
543 ],
544 'selectors' => [
545 '{{WRAPPER}} .eael-bd-cg-header .eael-docs-cat-icon' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
546 ],
547 'separator' => 'before'
548 ]
549 );
550
551 $this->add_responsive_control(
552 'header_icon_padding',
553 [
554 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
555 'type' => Controls_Manager::DIMENSIONS,
556 'size_units' => ['px', 'em', '%'],
557 'selectors' => [
558 '{{WRAPPER}} .eael-bd-cg-header .eael-docs-cat-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
559 ]
560 ]
561 );
562
563 $this->add_responsive_control(
564 'header_icon_margin',
565 [
566 'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'),
567 'type' => Controls_Manager::DIMENSIONS,
568 'size_units' => ['px', 'em', '%'],
569 'selectors' => [
570 '{{WRAPPER}} .eael-bd-cg-header .eael-docs-cat-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
571 ],
572 ]
573 );
574
575 $this->end_controls_section(); # end of 'Column Settings'
576
577 /**
578 * ----------------------------------------------------------
579 * Section: Title Settinggs
580 * ----------------------------------------------------------
581 */
582 $this->start_controls_section(
583 'section_title_settings',
584 [
585 'label' => __('Title', 'essential-addons-for-elementor-lite'),
586 'tab' => Controls_Manager::TAB_STYLE,
587 'condition' => [
588 'show_title' => 'true'
589 ]
590 ]
591 );
592
593 $this->add_group_control(
594 Group_Control_Typography::get_type(),
595 [
596 'name' => 'cat_list_typography',
597 'selector' => '{{WRAPPER}} .eael-docs-cat-title',
598 ]
599 );
600
601 $this->start_controls_tabs('title_settings_tabs');
602
603 // Normal State Tab
604 $this->start_controls_tab(
605 'title_normal',
606 ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]
607 );
608
609 $this->add_control(
610 'cat_title_color',
611 [
612 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'),
613 'type' => Controls_Manager::COLOR,
614 'selectors' => [
615 '{{WRAPPER}} .eael-docs-cat-title' => 'color: {{VALUE}};',
616 ],
617 ]
618 );
619
620 $this->add_group_control(
621 Group_Control_Background::get_type(),
622 [
623 'name' => 'cat_title_bg',
624 'types' => ['classic', 'gradient'],
625 'selector' => '{{WRAPPER}} .eael-better-docs-category-grid-post:not(.layout-2) .eael-bd-cg-header, {{WRAPPER}} .eael-better-docs-category-grid-post.layout-2 .eael-docs-cat-title',
626 'exclude' => [
627 'image'
628 ]
629 ]
630 );
631
632 $this->add_group_control(
633 Group_Control_Border::get_type(),
634 [
635 'name' => 'title_border', // Legacy control name change it with 'border_size' if anything happens.
636 'label' => __( 'Border', 'essential-addons-for-elementor-lite' ),
637 'selector' => '{{WRAPPER}} .eael-bd-cg-header-inner, {{WRAPPER}} .layout-2 .eael-docs-cat-title',
638 ]
639 );
640
641 $this->add_control(
642 'title_border_radius',
643 [
644 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ),
645 'type' => Controls_Manager::DIMENSIONS,
646 'size_units' => [ 'px', '%', 'em' ],
647 'selectors' => [
648 '{{WRAPPER}} .layout-2 .eael-docs-cat-title' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
649 '{{WRAPPER}} .eael-bd-cg-header' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
650 ]
651 ]
652 );
653
654 $this->end_controls_tab();
655
656 // Hover State Tab
657 $this->start_controls_tab(
658 'title_hover',
659 ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]
660 );
661
662 $this->add_control(
663 'cat_title_color_hover',
664 [
665 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'),
666 'type' => Controls_Manager::COLOR,
667 'selectors' => [
668 '{{WRAPPER}} .eael-docs-cat-title:hover' => 'color: {{VALUE}};',
669 ],
670 ]
671 );
672
673 $this->add_group_control(
674 Group_Control_Background::get_type(),
675 [
676 'name' => 'cat_title_bg_hover',
677 'types' => ['classic', 'gradient'],
678 'selector' => '{{WRAPPER}} .eael-better-docs-category-grid-post:not(.layout-2) .eael-bd-cg-header:hover, {{WRAPPER}} .eael-better-docs-category-grid-post.layout-2 .eael-docs-cat-title:hover',
679 'exclude' => [
680 'image'
681 ]
682 ]
683 );
684
685 $this->add_group_control(
686 Group_Control_Border::get_type(),
687 [
688 'name' => 'title_border_hover', // Legacy control name change it with 'border_size' if anything happens.
689 'label' => __( 'Border', 'essential-addons-for-elementor-lite' ),
690 'selector' => '{{WRAPPER}} .eael-bd-cg-header-inner:hover, {{WRAPPER}} .layout-2 .eael-docs-cat-title:hover',
691 ]
692 );
693
694 $this->add_control(
695 'title_border_radius_hover',
696 [
697 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ),
698 'type' => Controls_Manager::DIMENSIONS,
699 'size_units' => [ 'px', '%', 'em' ],
700 'selectors' => [
701 '{{WRAPPER}} .layout-2 .eael-docs-cat-title:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
702 ],
703 'condition' => [
704 'layout_template' => 'Layout_2'
705 ]
706 ]
707 );
708
709 $this->end_controls_tab();
710
711 $this->end_controls_tabs();
712
713
714 $this->add_responsive_control(
715 'cat_title_padding',
716 [
717 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
718 'type' => Controls_Manager::DIMENSIONS,
719 'size_units' => ['px', 'em', '%'],
720 'selectors' => [
721 '{{WRAPPER}} .eael-bd-cg-header-inner' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
722 '{{WRAPPER}} .eael-better-docs-category-grid-post.layout-2 .eael-docs-cat-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
723 ],
724 'separator' => 'before'
725 ]
726 );
727
728 $this->add_responsive_control(
729 'cat_title_margin',
730 [
731 'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'),
732 'type' => Controls_Manager::DIMENSIONS,
733 'size_units' => ['px', 'em', '%'],
734 'selectors' => [
735 '{{WRAPPER}} .eael-bd-cg-header' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
736 '{{WRAPPER}} .eael-better-docs-category-grid-post.layout-2 .eael-docs-cat-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
737 ],
738 ]
739 );
740
741 $this->end_controls_section(); # end of 'Title Settings'
742
743
744 /**
745 * ----------------------------------------------------------
746 * Section: Count Settinggs
747 * ----------------------------------------------------------
748 */
749 $this->start_controls_section(
750 'section_count_settings',
751 [
752 'label' => __('Count', 'essential-addons-for-elementor-lite'),
753 'tab' => Controls_Manager::TAB_STYLE,
754 'condition' => [
755 'show_count' => 'true'
756 ]
757 ]
758 );
759
760 $this->add_control(
761 'count_color',
762 [
763 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'),
764 'type' => Controls_Manager::COLOR,
765 'selectors' => [
766 '{{WRAPPER}} .eael-docs-item-count' => 'color: {{VALUE}};',
767 ],
768 ]
769 );
770
771 $this->add_group_control(
772 Group_Control_Background::get_type(),
773 [
774 'name' => 'count_bg',
775 'types' => ['classic', 'gradient'],
776 'selector' => '{{WRAPPER}} .eael-docs-item-count, {{WRAPPER}} .layout-2 .eael-docs-item-count:before',
777 'exclude' => [
778 'image',
779 ],
780 ]
781 );
782
783 $this->add_control(
784 'count_ticker_color',
785 [
786 'label' => esc_html__('Ticker Background', 'essential-addons-for-elementor-lite'),
787 'type' => Controls_Manager::COLOR,
788 'selectors' => [
789 '{{WRAPPER}} .layout-2 .eael-docs-item-count:after' => 'border-top-color: {{VALUE}};',
790 ],
791 'condition' => [
792 'layout_template' => 'Layout_2'
793 ]
794 ]
795 );
796
797 $this->add_responsive_control(
798 'count_font_size',
799 [
800 'label' => __('Font Size', 'essential-addons-for-elementor-lite'),
801 'type' => Controls_Manager::SLIDER,
802 'size_units' => ['px', '%', 'em'],
803 'range' => [
804 '%' => [
805 'max' => 100,
806 'step' => 1,
807 ],
808 ],
809 'selectors' => [
810 '{{WRAPPER}} .eael-docs-item-count' => 'font-size: {{SIZE}}{{UNIT}};',
811 ],
812 ]
813 );
814
815 $this->add_responsive_control(
816 'count_size',
817 [
818 'label' => __('Size', 'essential-addons-for-elementor-lite'),
819 'type' => Controls_Manager::SLIDER,
820 'size_units' => ['px', '%', 'em'],
821 'range' => [
822 '%' => [
823 'max' => 100,
824 'step' => 1,
825 ],
826 ],
827 'selectors' => [
828 '{{WRAPPER}} .eael-docs-item-count' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};'
829 ],
830 'condition' => [
831 'layout_template!' => 'Layout_2'
832 ]
833 ]
834 );
835
836 $this->add_group_control(
837 Group_Control_Border::get_type(),
838 [
839 'name' => 'count_border', // Legacy control name change it with 'border_size' if anything happens.
840 'label' => __( 'Border', 'essential-addons-for-elementor-lite' ),
841 'selector' => '{{WRAPPER}} .eael-docs-item-count',
842 'condition' => [
843 'layout_template!' => 'Layout_2'
844 ]
845 ]
846 );
847
848 $this->add_control(
849 'count_border_radius',
850 [
851 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ),
852 'type' => Controls_Manager::DIMENSIONS,
853 'size_units' => [ 'px', '%', 'em' ],
854 'selectors' => [
855 '{{WRAPPER}} .eael-docs-item-count' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
856 ],
857 'condition' => [
858 'layout_template!' => 'Layout_2'
859 ]
860 ]
861 );
862
863 $this->end_controls_section(); # end of 'Count Settings'
864
865 /**
866 * ----------------------------------------------------------
867 * Section: List Settinggs
868 * ----------------------------------------------------------
869 */
870 $this->start_controls_section(
871 'section_article_settings',
872 [
873 'label' => __('List', 'essential-addons-for-elementor-lite'),
874 'tab' => Controls_Manager::TAB_STYLE,
875 'condition' => [
876 'show_list' => 'true'
877 ]
878 ]
879 );
880
881 $this->add_control(
882 'list_settings_heading',
883 [
884 'label' => esc_html__('List', 'essential-addons-for-elementor-lite'),
885 'type' => Controls_Manager::HEADING,
886 ]
887 );
888
889 $this->add_group_control(
890 Group_Control_Typography::get_type(),
891 [
892 'name' => 'list_item_typography',
893 'selector' => '{{WRAPPER}} .eael-bd-cg-body ul li a',
894 ]
895 );
896
897 $this->add_control(
898 'list_color',
899 [
900 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'),
901 'type' => Controls_Manager::COLOR,
902 'selectors' => [
903 '{{WRAPPER}} .eael-bd-cg-body ul li a' => 'color: {{VALUE}};',
904 ],
905 ]
906 );
907
908 $this->add_control(
909 'list_hover_color',
910 [
911 'label' => esc_html__('Hover Color', 'essential-addons-for-elementor-lite'),
912 'type' => Controls_Manager::COLOR,
913 'selectors' => [
914 '{{WRAPPER}} .eael-bd-cg-body ul li a:hover' => 'color: {{VALUE}};',
915 ],
916 ]
917 );
918
919 $this->add_responsive_control(
920 'list_margin',
921 [
922 'label' => esc_html__('List Item Spacing', 'essential-addons-for-elementor-lite'),
923 'type' => Controls_Manager::DIMENSIONS,
924 'size_units' => ['px', 'em', '%'],
925 'selectors' => [
926 '{{WRAPPER}} .eael-bd-cg-body ul li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
927 ],
928 ]
929 );
930
931 $this->add_group_control(
932 Group_Control_Background::get_type(),
933 [
934 'name' => 'list_bg',
935 'types' => ['classic', 'gradient'],
936 'selector' => '{{WRAPPER}} .eael-bd-cg-body',
937 'exclude' => [
938 'image',
939 ],
940 ]
941 );
942
943 $this->add_responsive_control(
944 'list_area_padding',
945 [
946 'label' => esc_html__('List Area Padding', 'essential-addons-for-elementor-lite'),
947 'type' => Controls_Manager::DIMENSIONS,
948 'allowed_dimensions' => 'vertical',
949 'size_units' => ['px', 'em', '%'],
950 'selectors' => [
951 '{{WRAPPER}} .eael-bd-cg-body' => 'padding-top: {{TOP}}{{UNIT}}; padding-bottom: {{BOTTOM}}{{UNIT}};',
952 ],
953 ]
954 );
955
956 $this->add_control(
957 'icon_settings_heading',
958 [
959 'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'),
960 'type' => Controls_Manager::HEADING,
961 'separator' => 'before',
962 ]
963 );
964
965 $this->add_control(
966 'list_icon',
967 [
968 'label' => __( 'Icon', 'essential-addons-for-elementor-lite' ),
969 'type' => Controls_Manager::ICONS,
970 'default' => [
971 'value' => 'far fa-file-alt',
972 'library' => 'fa-regular'
973 ]
974 ]
975 );
976
977 $this->add_control(
978 'list_icon_color',
979 [
980 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'),
981 'type' => Controls_Manager::COLOR,
982 'selectors' => [
983 '{{WRAPPER}} .eael-bd-cg-body .eael-bd-cg-post-list-icon' => 'color: {{VALUE}};',
984 ],
985 ]
986 );
987
988 $this->add_responsive_control(
989 'list_icon_size',
990 [
991 'label' => __('Size', 'essential-addons-for-elementor-lite'),
992 'type' => Controls_Manager::SLIDER,
993 'size_units' => ['px', '%', 'em'],
994 'range' => [
995 '%' => [
996 'max' => 100,
997 'step' => 1,
998 ],
999 ],
1000 'selectors' => [
1001 '{{WRAPPER}} .eael-bd-cg-body .eael-bd-cg-post-list-icon' => 'font-size: {{SIZE}}{{UNIT}};',
1002 '{{WRAPPER}} .eael-bd-cg-body img.eael-bd-cg-post-list-icon' => 'width: {{SIZE}}{{UNIT}};'
1003 ],
1004 ]
1005 );
1006
1007 $this->add_responsive_control(
1008 'list_icon_spacing',
1009 [
1010 'label' => esc_html__('Spacing', 'essential-addons-for-elementor-lite'),
1011 'type' => Controls_Manager::DIMENSIONS,
1012 'size_units' => ['px', 'em', '%'],
1013 'selectors' => [
1014 '{{WRAPPER}} .eael-bd-cg-body .eael-bd-cg-post-list-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1015 ],
1016 ]
1017 );
1018
1019 $this->end_controls_section(); # end of 'Column Settings'
1020
1021 /**
1022 * ----------------------------------------------------------
1023 * Section: Nested List Settinggs
1024 * ----------------------------------------------------------
1025 */
1026 $this->start_controls_section(
1027 'section_nested_list_settings',
1028 [
1029 'label' => __('Nested List', 'essential-addons-for-elementor-lite'),
1030 'tab' => Controls_Manager::TAB_STYLE,
1031 'condition' => [
1032 'nested_subcategory' => 'true'
1033 ]
1034 ]
1035 );
1036
1037 $this->add_control(
1038 'section_nested_list_title',
1039 [
1040 'label' => esc_html__('Title', 'essential-addons-for-elementor-lite'),
1041 'type' => Controls_Manager::HEADING,
1042 ]
1043 );
1044
1045 $this->add_group_control(
1046 Group_Control_Typography::get_type(),
1047 [
1048 'name' => 'nested_list_title_typography',
1049 'selector' => '{{WRAPPER}} .eael-bd-grid-sub-cat-title a',
1050 ]
1051 );
1052
1053 $this->add_control(
1054 'nested_list_title_color',
1055 [
1056 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'),
1057 'type' => Controls_Manager::COLOR,
1058 'selectors' => [
1059 '{{WRAPPER}} .eael-bd-grid-sub-cat-title a' => 'color: {{VALUE}};',
1060 ],
1061 ]
1062 );
1063
1064 $this->add_group_control(
1065 Group_Control_Background::get_type(),
1066 [
1067 'name' => 'nested_list_title_background',
1068 'types' => ['classic', 'gradient'],
1069 'selector' => '{{WRAPPER}} .eael-bd-grid-sub-cat-title',
1070 'exclude' => [
1071 'image',
1072 ],
1073 ]
1074 );
1075
1076 $this->add_group_control(
1077 Group_Control_Border::get_type(),
1078 [
1079 'name' => 'nested_list_title_border',
1080 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'),
1081 'selector' => '{{WRAPPER}} .eael-bd-grid-sub-cat-title'
1082 ]
1083 );
1084
1085 $this->add_responsive_control(
1086 'nested_list_title_spacing',
1087 [
1088 'label' => esc_html__('Spacing', 'essential-addons-for-elementor-lite'),
1089 'type' => Controls_Manager::DIMENSIONS,
1090 'size_units' => ['px', 'em', '%'],
1091 'selectors' => [
1092 '{{WRAPPER}} .eael-bd-grid-sub-cat-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1093 ],
1094 ]
1095 );
1096
1097 $this->add_control(
1098 'section_nested_list_icon',
1099 [
1100 'label' => esc_html__('Icon', 'essential-addons-for-elementor-lite'),
1101 'type' => Controls_Manager::HEADING,
1102 'separator' => 'before'
1103 ]
1104 );
1105
1106 $this->add_control(
1107 'nested_list_title_closed_icon',
1108 [
1109 'label' => __( 'Collapse Icon', 'essential-addons-for-elementor-lite' ),
1110 'type' => Controls_Manager::ICONS,
1111 'default' => [
1112 'value' => 'fas fa-angle-right',
1113 'library' => 'fa-regular'
1114 ]
1115 ]
1116 );
1117
1118 $this->add_control(
1119 'nested_list_title_open_icon',
1120 [
1121 'label' => __( 'Open Icon', 'essential-addons-for-elementor-lite' ),
1122 'type' => Controls_Manager::ICONS,
1123 'default' => [
1124 'value' => 'fas fa-angle-down',
1125 'library' => 'fa-regular'
1126 ]
1127 ]
1128 );
1129
1130 $this->add_control(
1131 'nested_list_icon_color',
1132 [
1133 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'),
1134 'type' => Controls_Manager::COLOR,
1135 'selectors' => [
1136 '{{WRAPPER}} .eael-bd-grid-sub-cat-title .toggle-arrow' => 'color: {{VALUE}};',
1137 ],
1138 ]
1139 );
1140
1141 $this->add_responsive_control(
1142 'nested_list_icon_size',
1143 [
1144 'label' => __('Size', 'essential-addons-for-elementor-lite'),
1145 'type' => Controls_Manager::SLIDER,
1146 'size_units' => ['px', '%', 'em'],
1147 'range' => [
1148 '%' => [
1149 'max' => 100,
1150 'step' => 1,
1151 ],
1152 ],
1153 'selectors' => [
1154 '{{WRAPPER}} .eael-bd-grid-sub-cat-title .toggle-arrow' => 'font-size: {{SIZE}}{{UNIT}};',
1155 '{{WRAPPER}} .eael-bd-grid-sub-cat-title img.toggle-arrow' => 'width: {{SIZE}}{{UNIT}};'
1156 ],
1157 ]
1158 );
1159
1160 $this->add_responsive_control(
1161 'nested_list_icon_margin',
1162 [
1163 'label' => esc_html__('Area Spacing', 'essential-addons-for-elementor-lite'),
1164 'type' => Controls_Manager::DIMENSIONS,
1165 'size_units' => ['px', 'em', '%'],
1166 'selectors' => [
1167 '{{WRAPPER}} .eael-bd-grid-sub-cat-title .toggle-arrow' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1168 ],
1169 ]
1170 );
1171
1172
1173
1174 $this->end_controls_section(); # end of 'Column Settings'
1175
1176 /**
1177 * ----------------------------------------------------------
1178 * Section: Button Settings
1179 * ----------------------------------------------------------
1180 */
1181 $this->start_controls_section(
1182 'section_button_settings',
1183 [
1184 'label' => __('Button', 'essential-addons-for-elementor-lite'),
1185 'tab' => Controls_Manager::TAB_STYLE,
1186 'condition' => [
1187 'show_button' => 'true'
1188 ]
1189 ]
1190 );
1191
1192 $this->add_control(
1193 'show_button_icon',
1194 [
1195 'label' => __('Show Icon', 'essential-addons-for-elementor-lite'),
1196 'type' => Controls_Manager::SWITCHER,
1197 'label_on' => __('Show', 'essential-addons-for-elementor-lite'),
1198 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'),
1199 'return_value' => 'true',
1200 'default' => 'true'
1201 ]
1202 );
1203
1204 $this->add_control(
1205 'button_icon',
1206 [
1207 'label' => __( 'Icon', 'essential-addons-for-elementor-lite' ),
1208 'type' => Controls_Manager::ICONS,
1209 'default' => [
1210 'value' => 'fas fa-angle-right',
1211 'library' => 'fa-solid'
1212 ],
1213 'condition' => [
1214 'show_button_icon' => 'true'
1215 ]
1216 ]
1217 );
1218
1219 $this->add_control(
1220 'icon_position',
1221 [
1222 'label' => __('Icon Position', 'essential-addons-for-elementor-lite'),
1223 'type' => Controls_Manager::SELECT,
1224 'default' => 'after',
1225 'options' => [
1226 'before' => __( 'Before', 'essential-addons-for-elementor-lite' ),
1227 'after' => __( 'After', 'essential-addons-for-elementor-lite' )
1228 ],
1229 'condition' => [
1230 'show_button_icon' => 'true'
1231 ]
1232 ]
1233 );
1234
1235 $this->start_controls_tabs(
1236 'button_settings_tabs'
1237 );
1238
1239 // Normal State Tab
1240 $this->start_controls_tab(
1241 'button_normal',
1242 ['label' => esc_html__('Normal', 'essential-addons-for-elementor-lite')]
1243 );
1244
1245 $this->add_group_control(
1246 Group_Control_Typography::get_type(),
1247 [
1248 'name' => 'button_typography_normal',
1249 'selector' => '{{WRAPPER}} .eael-bd-cg-button',
1250 ]
1251 );
1252
1253 $this->add_control(
1254 'button_color_normal',
1255 [
1256 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'),
1257 'type' => Controls_Manager::COLOR,
1258 'selectors' => [
1259 '{{WRAPPER}} .eael-bd-cg-button' => 'color: {{VALUE}};',
1260 ],
1261 ]
1262 );
1263
1264 $this->add_group_control(
1265 Group_Control_Background::get_type(),
1266 [
1267 'name' => 'button_background_normal',
1268 'types' => ['classic', 'gradient'],
1269 'selector' => '{{WRAPPER}} .eael-bd-cg-button',
1270 'exclude' => [
1271 'image',
1272 ],
1273 ]
1274 );
1275
1276 $this->add_group_control(
1277 Group_Control_Border::get_type(),
1278 [
1279 'name' => 'button_border_normal',
1280 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'),
1281 'selector' => '{{WRAPPER}} .eael-bd-cg-button',
1282 ]
1283 );
1284
1285 $this->add_responsive_control(
1286 'button_border_radius',
1287 [
1288 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
1289 'type' => Controls_Manager::DIMENSIONS,
1290 'size_units' => ['px', 'em', '%'],
1291 'selectors' => [
1292 '{{WRAPPER}} .eael-bd-cg-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1293 ],
1294 ]
1295 );
1296
1297 $this->add_responsive_control(
1298 'button_padding',
1299 [
1300 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
1301 'type' => Controls_Manager::DIMENSIONS,
1302 'size_units' => ['px', 'em', '%'],
1303 'selectors' => [
1304 '{{WRAPPER}} .eael-bd-cg-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1305 ],
1306 ]
1307 );
1308
1309 $this->add_responsive_control(
1310 'button_area_margin',
1311 [
1312 'label' => esc_html__('Area Spacing', 'essential-addons-for-elementor-lite'),
1313 'type' => Controls_Manager::DIMENSIONS,
1314 'size_units' => ['px', 'em', '%'],
1315 'selectors' => [
1316 '{{WRAPPER}} .eael-bd-cg-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1317 ],
1318 ]
1319 );
1320
1321 $this->end_controls_tab();
1322
1323 // Normal State Tab
1324 $this->start_controls_tab(
1325 'button_hover',
1326 ['label' => esc_html__('Hover', 'essential-addons-for-elementor-lite')]
1327 );
1328
1329 $this->add_control(
1330 'button_color_hover',
1331 [
1332 'label' => esc_html__('Color', 'essential-addons-for-elementor-lite'),
1333 'type' => Controls_Manager::COLOR,
1334 'selectors' => [
1335 '{{WRAPPER}} .eael-bd-cg-button:hover' => 'color: {{VALUE}};',
1336 ],
1337 ]
1338 );
1339
1340 $this->add_group_control(
1341 Group_Control_Background::get_type(),
1342 [
1343 'name' => 'button_background_hover',
1344 'types' => ['classic', 'gradient'],
1345 'selector' => '{{WRAPPER}} .eael-bd-cg-button:hover',
1346 'exclude' => [
1347 'image',
1348 ],
1349 ]
1350 );
1351
1352 $this->add_group_control(
1353 Group_Control_Border::get_type(),
1354 [
1355 'name' => 'button_border_hover',
1356 'label' => esc_html__('Border', 'essential-addons-for-elementor-lite'),
1357 'selector' => '{{WRAPPER}} .eael-bd-cg-button:hover',
1358 ]
1359 );
1360
1361 $this->add_responsive_control(
1362 'button_hover_border_radius',
1363 [
1364 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'),
1365 'type' => Controls_Manager::DIMENSIONS,
1366 'size_units' => ['px', 'em', '%'],
1367 'selectors' => [
1368 '{{WRAPPER}} .eael-bd-cg-button:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1369 ],
1370 ]
1371 );
1372
1373 $this->end_controls_tab();
1374
1375 $this->end_controls_tabs();
1376
1377 $this->add_responsive_control(
1378 'button_text_alignment',
1379 [
1380 'label' => __('Text Alignment', 'essential-addons-for-elementor-lite'),
1381 'type' => Controls_Manager::CHOOSE,
1382 'options' => [
1383 'left' => [
1384 'title' => __('Left', 'essential-addons-for-elementor-lite'),
1385 'icon' => 'fa fa-align-left',
1386 ],
1387 'center' => [
1388 'title' => __('Center', 'essential-addons-for-elementor-lite'),
1389 'icon' => 'fa fa-align-center',
1390 ],
1391 'right' => [
1392 'title' => __('Right', 'essential-addons-for-elementor-lite'),
1393 'icon' => 'fa fa-align-right',
1394 ],
1395 ],
1396 'selectors' => [
1397 '{{WRAPPER}} .eael-bd-cg-footer .eael-bd-cg-button' => 'text-align: {{VALUE}};',
1398 ],
1399 ]
1400 );
1401
1402 $this->add_responsive_control(
1403 'button_alignment',
1404 [
1405 'label' => __('Button Alignment', 'essential-addons-for-elementor-lite'),
1406 'type' => Controls_Manager::CHOOSE,
1407 'options' => [
1408 'left' => [
1409 'title' => __('Left', 'essential-addons-for-elementor-lite'),
1410 'icon' => 'fa fa-align-left',
1411 ],
1412 'center' => [
1413 'title' => __('Center', 'essential-addons-for-elementor-lite'),
1414 'icon' => 'fa fa-align-center',
1415 ],
1416 'right' => [
1417 'title' => __('Right', 'essential-addons-for-elementor-lite'),
1418 'icon' => 'fa fa-align-right',
1419 ],
1420 ],
1421 'selectors' => [
1422 '{{WRAPPER}} .eael-bd-cg-footer' => 'text-align: {{VALUE}};',
1423 ],
1424 ]
1425 );
1426
1427 $this->end_controls_section(); # end of 'Button Settings'
1428
1429 }
1430
1431 }
1432
1433 protected function render()
1434 {
1435
1436 if (!defined('BETTERDOCS_URL')) {
1437 return;
1438 }
1439
1440 $settings = $this->get_settings_for_display();
1441
1442 $this->add_render_attribute(
1443 'bd_category_grid_wrapper',
1444 [
1445 'id' => 'eael-bd-cat-grid-' . esc_attr($this->get_id()),
1446 'class' => [
1447 'eael-better-docs-category-grid-wrapper',
1448 ],
1449 ]
1450 );
1451
1452 $this->add_render_attribute(
1453 'bd_category_grid_inner',
1454 [
1455 'class' => [
1456 'eael-better-docs-category-grid',
1457 $settings['layout_mode']
1458 ],
1459 'data-layout-mode' => $settings['layout_mode']
1460 ]
1461 );
1462
1463
1464 $terms_object = array(
1465 'parent' => 0,
1466 'taxonomy' => 'doc_category',
1467 'order' => $settings['order'],
1468 'orderby' => $settings['orderby'],
1469 'offset' => $settings['offset'],
1470 'number' => $settings['grid_per_page']
1471 );
1472
1473 if ( $settings['include'] ) {
1474 unset($terms_object['parent']);
1475 $terms_object['include'] = array_diff($settings['include'], (array) $settings['exclude']);
1476 $terms_object['orderby'] = 'include';
1477 }
1478
1479 if($settings['exclude']) {
1480 unset($terms_object['parent']);
1481 $terms_object['exclude'] = $settings['exclude'];
1482 $terms_object['orderby'] = 'exclude';
1483 }
1484
1485 $taxonomy_objects = get_terms($terms_object);
1486
1487
1488 $html = '<div ' . $this->get_render_attribute_string('bd_category_grid_wrapper') . '>';
1489 $html .= '<div '.$this->get_render_attribute_string('bd_category_grid_inner').'>';
1490 if(file_exists($this->get_template($settings['layout_template']))) {
1491
1492 if($taxonomy_objects && ! is_wp_error( $taxonomy_objects )) {
1493 foreach($taxonomy_objects as $term) {
1494 ob_start();
1495 include($this->get_template($settings['layout_template']));
1496 $html .= ob_get_clean();
1497 }
1498 }else {
1499 _e('<p class="no-posts-found">No posts found!</p>', 'essential-addons-for-elementor-lite');
1500 }
1501
1502 wp_reset_postdata();
1503
1504 }else {
1505 $html .= '<h4>'.__( 'File Not Found', 'essential-addons-for-elementor-lite' ).'</h4>';
1506 }
1507 $html .= '</div>';
1508 $html .= '<div class="clearfix"></div>';
1509
1510 if (\Elementor\Plugin::instance()->editor->is_edit_mode()) {
1511 $this->render_editor_script();
1512 }
1513 $html .= '</div>';
1514
1515 echo $html;
1516
1517 }
1518
1519 protected function render_editor_script()
1520 {
1521 ?>
1522 <script type="text/javascript">
1523 jQuery(document).ready(function($) {
1524 $('.eael-better-docs-category-grid').each(function() {
1525 var $scope = jQuery(".elementor-element-<?php echo $this->get_id(); ?>"),
1526 $gallery = $(this);
1527 $layout_mode = $gallery.data('layout-mode');
1528
1529 console.log($layout_mode);
1530
1531
1532 if($layout_mode === 'masonry') {
1533 // init isotope
1534 var $isotope_gallery = $gallery.isotope({
1535 itemSelector: ".eael-better-docs-category-grid-post",
1536 layoutMode: $layout_mode,
1537 percentPosition: true
1538 });
1539
1540 // layout gal, while images are loading
1541 $isotope_gallery.imagesLoaded().progress(function() {
1542 $isotope_gallery.isotope("layout");
1543 });
1544
1545 $('.eael-better-docs-category-grid-post', $gallery).resize(function() {
1546 $isotope_gallery.isotope('layout');
1547 });
1548 }
1549
1550 });
1551 });
1552 </script>
1553 <?php
1554 }
1555
1556 }
1557