Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/bdthemes-element-pack/modules/elementor/module.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
namespace ElementPack\Modules\Elementor;
3
+
4
+
use Elementor;
5
+
use Elementor\Elementor_Base;
6
+
use Elementor\Controls_Manager;
7
+
use Elementor\Element_Base;
8
+
use ElementPack\Base\Module_Base;
9
+
use Elementor\Group_Control_Typography;
10
+
use Elementor\Group_Control_Background;
11
+
use Elementor\Group_Control_Border;
12
+
use Elementor\Group_Control_Box_Shadow;
13
+
use ElementPack;
14
+
use ElementPack\Plugin;
15
+
use ElementPack\Base\Element_Pack_Module_Base;
16
+
use ElementPack\Element_Pack_Loader;
17
+
18
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
19
+
20
+
class Module extends Element_Pack_Module_Base {
21
+
22
+
public $sections_data = [];
23
+
24
+
public function __construct() {
25
+
parent::__construct();
26
+
$this->add_actions();
27
+
}
28
+
29
+
public function get_name() {
30
+
return 'bdt-elementor';
31
+
}
32
+
33
+
34
+
protected function add_actions() {
35
+
36
+
add_action( 'elementor/element/after_section_end', [$this, 'lightbox_settings'],10, 3);
37
+
add_action( 'elementor/element/after_section_end', [$this, 'tooltip_settings'],10, 3);
38
+
39
+
}
40
+
41
+
public function lightbox_settings($section, $section_id) {
42
+
43
+
static $layout_sections = [ 'section_page_style'];
44
+
45
+
if ( ! in_array( $section_id, $layout_sections ) ) { return; }
46
+
47
+
$section->start_controls_section(
48
+
'element_pack_lightbox_style',
49
+
[
50
+
'label' => BDTEP_CP . esc_html__( 'Lightbox Global Style', 'bdthemes-element-pack' ),
51
+
'tab' => Controls_Manager::TAB_STYLE,
52
+
]
53
+
);
54
+
55
+
$section->add_control(
56
+
'element_pack_lightbox_bg',
57
+
[
58
+
'label' => esc_html__( 'Lightbox Background', 'bdthemes-element-pack' ),
59
+
'type' => Controls_Manager::COLOR,
60
+
'selectors' => [
61
+
'.bdt-lightbox' => 'background-color: {{VALUE}};',
62
+
],
63
+
]
64
+
);
65
+
66
+
67
+
$section->add_control(
68
+
'element_pack_cb_color',
69
+
[
70
+
'label' => esc_html__( 'Close Button Color', 'bdthemes-element-pack' ),
71
+
'type' => Controls_Manager::COLOR,
72
+
'selectors' => [
73
+
'.bdt-lightbox .bdt-close.bdt-icon' => 'color: {{VALUE}};',
74
+
],
75
+
]
76
+
);
77
+
78
+
$section->add_control(
79
+
'element_pack_cb_bg',
80
+
[
81
+
'label' => esc_html__( 'Close Button Background', 'bdthemes-element-pack' ),
82
+
'type' => Controls_Manager::COLOR,
83
+
'selectors' => [
84
+
'.bdt-lightbox .bdt-close.bdt-icon' => 'background-color: {{VALUE}};',
85
+
],
86
+
]
87
+
);
88
+
89
+
$section->add_group_control(
90
+
Group_Control_Border::get_type(), [
91
+
'name' => 'element_pack_cb_border',
92
+
'label' => esc_html__( 'Close Button Border', 'bdthemes-element-pack' ),
93
+
'placeholder' => '1px',
94
+
'default' => '1px',
95
+
'selector' => '.bdt-lightbox .bdt-close.bdt-icon',
96
+
]
97
+
);
98
+
99
+
$section->add_control(
100
+
'element_pack_cb_radius',
101
+
[
102
+
'label' => esc_html__( 'Border Radius', 'bdthemes-element-pack' ),
103
+
'type' => Controls_Manager::DIMENSIONS,
104
+
'size_units' => [ 'px', '%' ],
105
+
'selectors' => [
106
+
'.bdt-lightbox .bdt-close.bdt-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
107
+
],
108
+
]
109
+
);
110
+
111
+
$section->add_control(
112
+
'element_pack_cb_padding',
113
+
[
114
+
'label' => esc_html__( 'Padding', 'bdthemes-element-pack' ),
115
+
'type' => Controls_Manager::DIMENSIONS,
116
+
'size_units' => [ 'px', 'em', '%' ],
117
+
'selectors' => [
118
+
'.bdt-lightbox .bdt-close.bdt-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
119
+
],
120
+
]
121
+
);
122
+
123
+
124
+
$section->add_control(
125
+
'element_pack_toolbar_color',
126
+
[
127
+
'label' => esc_html__( 'Toolbar Color', 'bdthemes-element-pack' ),
128
+
'type' => Controls_Manager::COLOR,
129
+
'selectors' => [
130
+
'.bdt-lightbox .bdt-lightbox-toolbar' => 'color: {{VALUE}};',
131
+
],
132
+
]
133
+
);
134
+
135
+
$section->add_control(
136
+
'element_pack_toolbar_bg',
137
+
[
138
+
'label' => esc_html__( 'Toolbar Background', 'bdthemes-element-pack' ),
139
+
'type' => Controls_Manager::COLOR,
140
+
'selectors' => [
141
+
'.bdt-lightbox .bdt-lightbox-toolbar' => 'background-color: {{VALUE}};',
142
+
],
143
+
]
144
+
);
145
+
146
+
$section->add_group_control(
147
+
Group_Control_Typography::get_type(),
148
+
[
149
+
'name' => 'element_pack_toolbar_typography',
150
+
'label' => esc_html__( 'Typography', 'bdthemes-element-pack' ),
151
+
'selector' => '.bdt-lightbox .bdt-lightbox-toolbar',
152
+
]
153
+
);
154
+
155
+
$section->add_control(
156
+
'element_pack_lightbox_max_height',
157
+
[
158
+
'label' => esc_html__( 'Max Height (vh)', 'bdthemes-element-pack' ),
159
+
'type' => Controls_Manager::SLIDER,
160
+
'size_units' => [
161
+
'vh',
162
+
],
163
+
'range' => [
164
+
'vh' => [
165
+
'min' => 10,
166
+
'max' => 100,
167
+
],
168
+
],
169
+
'selectors' => [
170
+
'.bdt-lightbox .bdt-lightbox-items>*>*' => 'max-height: {{SIZE}}vh;',
171
+
],
172
+
'render_type'=> 'template',
173
+
'separator' => 'before',
174
+
]
175
+
);
176
+
177
+
$section->add_control(
178
+
'hr_1',
179
+
[
180
+
'type' => Controls_Manager::DIVIDER,
181
+
]
182
+
);
183
+
184
+
$section->add_control(
185
+
'element_pack_navigation_heading',
186
+
[
187
+
'label' => esc_html__( 'N a v i g a t i o n', 'bdthemes-element-pack' ) . BDTEP_NC,
188
+
'type' => Controls_Manager::HEADING,
189
+
]
190
+
);
191
+
192
+
$section->start_controls_tabs( 'element_pack_navigation_tabs_style' );
193
+
194
+
$section->start_controls_tab(
195
+
'element_pack_navigation_tab_normal',
196
+
[
197
+
'label' => __( 'Normal', 'bdthemes-element-pack' ),
198
+
]
199
+
);
200
+
201
+
$section->add_control(
202
+
'element_pack_navigation_color',
203
+
[
204
+
'label' => esc_html__( 'Color', 'bdthemes-element-pack' ),
205
+
'type' => Controls_Manager::COLOR,
206
+
'selectors' => [
207
+
'.bdt-lightbox .bdt-lightbox-button' => 'color: {{VALUE}};',
208
+
],
209
+
]
210
+
);
211
+
212
+
$section->add_group_control(
213
+
Group_Control_Background::get_type(),
214
+
[
215
+
'name' => 'element_pack_navigation_bg_color',
216
+
'selector' => '.bdt-lightbox .bdt-lightbox-button',
217
+
]
218
+
);
219
+
220
+
$section->add_group_control(
221
+
Group_Control_Border::get_type(), [
222
+
'name' => 'element_pack_navigation_border',
223
+
'placeholder' => '1px',
224
+
'default' => '1px',
225
+
'selector' => '.bdt-lightbox .bdt-lightbox-button',
226
+
]
227
+
);
228
+
229
+
$section->add_control(
230
+
'element_pack_navigation_radius',
231
+
[
232
+
'label' => esc_html__( 'Border Radius', 'bdthemes-element-pack' ),
233
+
'type' => Controls_Manager::DIMENSIONS,
234
+
'size_units' => [ 'px', '%' ],
235
+
'selectors' => [
236
+
'.bdt-lightbox .bdt-lightbox-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
237
+
],
238
+
]
239
+
);
240
+
241
+
$section->add_control(
242
+
'element_pack_navigation_size',
243
+
[
244
+
'label' => esc_html__( 'Size', 'bdthemes-element-pack' ),
245
+
'type' => Controls_Manager::SLIDER,
246
+
'selectors' => [
247
+
'.bdt-lightbox .bdt-lightbox-button' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}};',
248
+
],
249
+
]
250
+
);
251
+
252
+
$section->add_control(
253
+
'element_pack_navigation_icon_size',
254
+
[
255
+
'label' => esc_html__( 'Icon Size', 'bdthemes-element-pack' ),
256
+
'type' => Controls_Manager::SLIDER,
257
+
'selectors' => [
258
+
'.bdt-lightbox .bdt-lightbox-button' => 'font-size: {{SIZE}}{{UNIT}};',
259
+
],
260
+
]
261
+
);
262
+
263
+
$section->end_controls_tab();
264
+
265
+
$section->start_controls_tab(
266
+
'element_pack_navigation_tab_hover',
267
+
[
268
+
'label' => __( 'Hover', 'bdthemes-element-pack' ),
269
+
]
270
+
);
271
+
272
+
$section->add_control(
273
+
'element_pack_navigation_hover_color',
274
+
[
275
+
'label' => esc_html__( 'Color', 'bdthemes-element-pack' ),
276
+
'type' => Controls_Manager::COLOR,
277
+
'selectors' => [
278
+
'.bdt-lightbox .bdt-lightbox-button:hover' => 'color: {{VALUE}};',
279
+
],
280
+
]
281
+
);
282
+
283
+
$section->add_group_control(
284
+
Group_Control_Background::get_type(),
285
+
[
286
+
'name' => 'element_pack_navigation_hover_bg_color',
287
+
'selector' => '.bdt-lightbox .bdt-lightbox-button:hover',
288
+
]
289
+
);
290
+
291
+
$section->add_control(
292
+
'element_pack_navigation_hover_border_color',
293
+
[
294
+
'label' => esc_html__( 'Border Color', 'bdthemes-element-pack' ),
295
+
'type' => Controls_Manager::COLOR,
296
+
'selectors' => [
297
+
'.bdt-lightbox .bdt-lightbox-button:hover' => 'border-color: {{VALUE}};',
298
+
],
299
+
'condition' => [
300
+
'element_pack_navigation_border_border!' => ''
301
+
]
302
+
]
303
+
);
304
+
305
+
$section->end_controls_tab();
306
+
307
+
$section->end_controls_tabs();
308
+
309
+
$section->end_controls_section();
310
+
}
311
+
312
+
public function tooltip_settings($section, $section_id) {
313
+
314
+
static $layout_sections = [ 'section_page_style'];
315
+
316
+
if ( ! in_array( $section_id, $layout_sections ) ) { return; }
317
+
318
+
319
+
$section->start_controls_section(
320
+
'element_pack_global_tooltip_style',
321
+
[
322
+
'label' => BDTEP_CP . esc_html__( 'Tooltip Global Style', 'bdthemes-element-pack' ),
323
+
'tab' => Controls_Manager::TAB_STYLE,
324
+
]
325
+
);
326
+
327
+
$section->add_responsive_control(
328
+
'element_pack_global_tooltip_width',
329
+
[
330
+
'label' => esc_html__( 'Width', 'bdthemes-element-pack' ),
331
+
'type' => Controls_Manager::SLIDER,
332
+
'size_units' => [
333
+
'px', 'em',
334
+
],
335
+
'range' => [
336
+
'px' => [
337
+
'min' => 50,
338
+
'max' => 500,
339
+
],
340
+
],
341
+
'selectors' => [
342
+
'.elementor-widget .tippy-tooltip' => 'width: {{SIZE}}{{UNIT}};',
343
+
],
344
+
'render_type' => 'template',
345
+
'frontend_available' => true,
346
+
]
347
+
);
348
+
349
+
$section->add_control(
350
+
'element_pack_global_tooltip_color',
351
+
[
352
+
'label' => esc_html__( 'Text Color', 'bdthemes-element-pack' ),
353
+
'type' => Controls_Manager::COLOR,
354
+
'selectors' => [
355
+
'.elementor-widget .tippy-tooltip' => 'color: {{VALUE}}',
356
+
],
357
+
]
358
+
);
359
+
360
+
$section->add_group_control(
361
+
Group_Control_Background::get_type(),
362
+
[
363
+
'name' => 'element_pack_global_tooltip_background',
364
+
'selector' => '.elementor-widget .tippy-tooltip, .elementor-widget .tippy-tooltip .tippy-backdrop',
365
+
]
366
+
);
367
+
368
+
$section->add_control(
369
+
'element_pack_global_tooltip_arrow_color',
370
+
[
371
+
'label' => esc_html__( 'Arrow Color', 'bdthemes-element-pack' ),
372
+
'type' => Controls_Manager::COLOR,
373
+
'selectors' => [
374
+
'.elementor-widget .tippy-popper[x-placement^=left] .tippy-arrow' => 'border-left-color: {{VALUE}}',
375
+
'.elementor-widget .tippy-popper[x-placement^=right] .tippy-arrow' => 'border-right-color: {{VALUE}}',
376
+
'.elementor-widget .tippy-popper[x-placement^=top] .tippy-arrow' => 'border-top-color: {{VALUE}}',
377
+
'.elementor-widget .tippy-popper[x-placement^=bottom] .tippy-arrow'=> 'border-bottom-color: {{VALUE}}',
378
+
],
379
+
'condition' => [
380
+
'element_pack_global_tooltip' => 'yes',
381
+
],
382
+
]
383
+
);
384
+
385
+
$section->add_responsive_control(
386
+
'element_pack_global_tooltip_padding',
387
+
[
388
+
'label' => __( 'Padding', 'bdthemes-element-pack' ),
389
+
'type' => Controls_Manager::DIMENSIONS,
390
+
'size_units' => [ 'px', '%' ],
391
+
'selectors' => [
392
+
'.elementor-widget .tippy-tooltip' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
393
+
],
394
+
'render_type' => 'template',
395
+
'separator' => 'before',
396
+
'frontend_available' => true,
397
+
]
398
+
);
399
+
400
+
$section->add_group_control(
401
+
Group_Control_Border::get_type(),
402
+
[
403
+
'name' => 'element_pack_global_tooltip_border',
404
+
'label' => esc_html__( 'Border', 'bdthemes-element-pack' ),
405
+
'placeholder' => '1px',
406
+
'default' => '1px',
407
+
'selector' => '.elementor-widget .tippy-tooltip',
408
+
]
409
+
);
410
+
411
+
$section->add_responsive_control(
412
+
'element_pack_global_tooltip_border_radius',
413
+
[
414
+
'label' => __( 'Border Radius', 'bdthemes-element-pack' ),
415
+
'type' => Controls_Manager::DIMENSIONS,
416
+
'size_units' => [ 'px', '%' ],
417
+
'selectors' => [
418
+
'.elementor-widget .tippy-tooltip' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
419
+
],
420
+
'frontend_available' => true,
421
+
]
422
+
);
423
+
424
+
$section->add_control(
425
+
'element_pack_global_tooltip_text_align',
426
+
[
427
+
'label' => esc_html__( 'Text Alignment', 'bdthemes-element-pack' ),
428
+
'type' => Controls_Manager::CHOOSE,
429
+
'default' => 'center',
430
+
'options' => [
431
+
'left' => [
432
+
'title' => esc_html__( 'Left', 'bdthemes-element-pack' ),
433
+
'icon' => 'eicon-text-align-left',
434
+
],
435
+
'center' => [
436
+
'title' => esc_html__( 'Center', 'bdthemes-element-pack' ),
437
+
'icon' => 'eicon-text-align-center',
438
+
],
439
+
'right' => [
440
+
'title' => esc_html__( 'Right', 'bdthemes-element-pack' ),
441
+
'icon' => 'eicon-text-align-right',
442
+
],
443
+
],
444
+
'selectors' => [
445
+
'.elementor-widget .tippy-tooltip .tippy-content' => 'text-align: {{VALUE}};',
446
+
],
447
+
'separator' => 'before',
448
+
]
449
+
);
450
+
451
+
452
+
$section->add_group_control(
453
+
Group_Control_Box_Shadow::get_type(),
454
+
[
455
+
'name' => 'element_pack_global_tooltip_box_shadow',
456
+
'selector' => '.elementor-widget .tippy-tooltip',
457
+
]
458
+
);
459
+
460
+
$section->add_group_control(
461
+
Group_Control_Typography::get_type(),
462
+
[
463
+
'name' => 'element_pack_global_tooltip_typography',
464
+
'selector' => '.elementor-widget .tippy-tooltip .tippy-content',
465
+
]
466
+
);
467
+
468
+
$section->end_controls_section();
469
+
470
+
}
471
+
472
+
}
473
+