PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.11.77
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.11.77
4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-modalbox.php
premium-addons-for-elementor / widgets Last commit date
dep 1 month ago premium-banner.php 3 weeks ago premium-blog.php 3 weeks ago premium-button.php 3 weeks ago premium-carousel.php 3 weeks ago premium-contactform.php 3 weeks ago premium-countdown.php 3 weeks ago premium-counter.php 3 weeks ago premium-dual-header.php 3 weeks ago premium-fancytext.php 3 weeks ago premium-grid.php 3 weeks ago premium-icon-list.php 3 weeks ago premium-image-button.php 3 weeks ago premium-image-scroll.php 3 weeks ago premium-image-separator.php 3 weeks ago premium-lottie.php 3 weeks ago premium-maps.php 3 weeks ago premium-media-wheel.php 3 weeks ago premium-mobile-menu.php 3 weeks ago premium-modalbox.php 3 weeks ago premium-nav-menu.php 3 weeks ago premium-notifications.php 3 weeks ago premium-person.php 3 weeks ago premium-pinterest-feed.php 3 weeks ago premium-post-ticker.php 3 weeks ago premium-pricing-table.php 3 weeks ago premium-progressbar.php 3 weeks ago premium-search-form.php 3 weeks ago premium-svg-drawer.php 3 weeks ago premium-tcloud.php 3 weeks ago premium-testimonials.php 3 weeks ago premium-textual-showcase.php 3 weeks ago premium-tiktok-feed.php 3 weeks ago premium-title.php 3 weeks ago premium-videobox.php 3 weeks ago premium-vscroll.php 3 weeks ago premium-weather.php 3 weeks ago premium-world-clock.php 3 weeks ago
premium-modalbox.php
2792 lines
1 <?php
2 /**
3 * Premium Modal Box.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Plugin;
10 use Elementor\Icons_Manager;
11 use Elementor\Widget_Base;
12 use Elementor\Utils;
13 use Elementor\Control_Media;
14 use Elementor\Controls_Manager;
15 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
16 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
17 use Elementor\Group_Control_Border;
18 use Elementor\Group_Control_Css_Filter;
19 use Elementor\Group_Control_Typography;
20 use Elementor\Group_Control_Text_Shadow;
21 use Elementor\Group_Control_Box_Shadow;
22 use Elementor\Group_Control_Background;
23
24 // PremiumAddons Classes.
25 use PremiumAddons\Admin\Includes\Admin_Helper;
26 use PremiumAddons\Includes\Helper_Functions;
27 use PremiumAddons\Includes\Controls\Premium_Post_Filter;
28
29 if ( ! defined( 'ABSPATH' ) ) {
30 exit; // If this file is called directly, abort.
31 }
32
33 /**
34 * Class Premium_Modalbox
35 */
36 class Premium_Modalbox extends Widget_Base {
37
38 /**
39 * Check if the icon draw is enabled.
40 *
41 * @since 4.9.26
42 * @access private
43 *
44 * @var bool
45 */
46 private $is_draw_enabled = null;
47
48 /**
49 * Check Icon Draw Option.
50 *
51 * @since 4.9.26
52 * @access public
53 */
54 public function check_icon_draw() {
55
56 if ( null === $this->is_draw_enabled ) {
57 $this->is_draw_enabled = Admin_Helper::check_svg_draw( 'premium-modalbox' );
58 }
59
60 return $this->is_draw_enabled;
61 }
62
63 /**
64 * Retrieve Widget Name.
65 *
66 * @since 1.0.0
67 * @access public
68 */
69 public function get_name() {
70 return 'premium-addon-modal-box';
71 }
72
73 /**
74 * Check RTL
75 *
76 * @since 1.0.0
77 * @access public
78 */
79 public function check_rtl() {
80 return is_rtl();
81 }
82
83 /**
84 * Retrieve Widget Title.
85 *
86 * @since 1.0.0
87 * @access public
88 */
89 public function get_title() {
90 return __( 'Modal Box', 'premium-addons-for-elementor' );
91 }
92
93 /**
94 * Retrieve Widget Icon.
95 *
96 * @since 1.0.0
97 * @access public
98 *
99 * @return string widget icon.
100 */
101 public function get_icon() {
102 return 'pa-modal-box';
103 }
104
105 /**
106 * Retrieve Widget Dependent CSS.
107 *
108 * @since 1.0.0
109 * @access public
110 *
111 * @return array CSS style handles.
112 */
113 public function get_style_depends() {
114 return array(
115 'pa-glass',
116 'pa-btn',
117 'premium-addons',
118 );
119 }
120
121 /**
122 * Retrieve Widget Dependent JS.
123 *
124 * @since 1.0.0
125 * @access public
126 *
127 * @return array JS script handles.
128 */
129 public function get_script_depends() {
130
131 $is_edit = Helper_Functions::is_edit_mode();
132
133 $scripts = array();
134
135 if ( $is_edit ) {
136
137 $draw_scripts = $this->check_icon_draw() ? array( 'pa-tweenmax', 'pa-motionpath' ) : array();
138
139 $scripts = array_merge( $draw_scripts, array( 'pa-glass', 'pa-modal', 'lottie-js' ) );
140
141 } else {
142 $settings = $this->get_settings();
143
144 $scripts[] = 'pa-modal';
145
146 if ( 'yes' === $settings['draw_svg'] ) {
147 $scripts[] = 'pa-tweenmax';
148 $scripts[] = 'pa-motionpath';
149 }
150
151 if ( 'animation' === $settings['premium_modal_box_icon_selection'] || 'animation' === $settings['premium_modal_box_display_on'] ) {
152 $scripts[] = 'lottie-js';
153 }
154
155 if ( 'none' !== $settings['body_lq_effect'] ) {
156 $scripts[] = 'pa-glass';
157 }
158 }
159
160 $scripts[] = 'premium-addons';
161
162 return $scripts;
163 }
164
165 /**
166 * Retrieve Widget Keywords.
167 *
168 * @since 1.0.0
169 * @access public
170 *
171 * @return string Widget keywords.
172 */
173 public function get_keywords() {
174 return array( 'pa', 'premium', 'premium modal box', 'popup', 'lightbox', 'advanced', 'embed' );
175 }
176
177
178 /**
179 * Dynamic Content.
180 *
181 * @since 4.9.26
182 * @access protected
183 * @return bool
184 */
185 protected function is_dynamic_content(): bool {
186
187 $is_edit = Plugin::instance()->editor->is_edit_mode();
188
189 if ( $is_edit ) {
190 return false;
191 }
192
193 $content_type = $this->get_settings( 'premium_modal_box_content_type' );
194 $is_dynamic_content = false;
195
196 if ( 'editor' !== $content_type ) {
197 $is_dynamic_content = true;
198 }
199
200 return $is_dynamic_content;
201 }
202
203 /**
204 * Retrieve Widget Categories.
205 *
206 * @since 1.5.1
207 * @access public
208 *
209 * @return array Widget categories.
210 */
211 public function get_categories() {
212 return array( 'premium-elements' );
213 }
214
215 /**
216 * Retrieve Widget Support URL.
217 *
218 * @access public
219 *
220 * @return string support URL.
221 */
222 public function get_custom_help_url() {
223 return 'https://premiumaddons.com/support/';
224 }
225
226
227 /**
228 * Has Widget Inner Wrapper.
229 *
230 * @access public
231 *
232 * @return bool
233 */
234 public function has_widget_inner_wrapper(): bool {
235 return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' );
236 }
237
238 /**
239 * Register Modal Box controls.
240 *
241 * @since 1.0.0
242 * @access protected
243 */
244 protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
245
246 $draw_icon = $this->check_icon_draw();
247
248 $this->start_controls_section(
249 'premium_modal_box_content_section',
250 array(
251 'label' => __( 'Trigger', 'premium-addons-for-elementor' ),
252 )
253 );
254
255 $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/modal-box-widget-for-elementor-page-builder/', 'modal-box', 'wp-editor', 'demo' );
256 Helper_Functions::add_templates_controls( $this, 'modal-box', $demo );
257
258 $this->add_control(
259 'premium_modal_box_display_on',
260 array(
261 'label' => __( 'Trigger', 'premium-addons-for-elementor' ),
262 'type' => Controls_Manager::SELECT,
263 'description' => __( 'Choose where would you like the modal box appear on', 'premium-addons-for-elementor' ),
264 'options' => array(
265 'button' => __( 'Button', 'premium-addons-for-elementor' ),
266 'image' => __( 'Image', 'premium-addons-for-elementor' ),
267 'text' => __( 'Text', 'premium-addons-for-elementor' ),
268 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
269 'pageload' => __( 'On Page Load', 'premium-addons-for-elementor' ),
270 'exit' => apply_filters( 'pa_pro_label', __( 'On Page Exit Intent (Pro)', 'premium-addons-for-elementor' ) ),
271 ),
272 'label_block' => true,
273 'default' => 'button',
274 )
275 );
276
277 $this->add_control(
278 'show_again_exit',
279 array(
280 'label' => apply_filters( 'pa_pro_label', __( 'Show Again on Page Exit (Pro)', 'premium-addons-for-elementor' ) ),
281 'type' => Controls_Manager::SWITCHER,
282 'condition' => array(
283 'premium_modal_box_display_on!' => 'exit',
284 ),
285 )
286 );
287
288 $this->add_control(
289 'page_exit_notice',
290 array(
291 'raw' => __( 'When you are logged in, the modal box will normally show on page load. To try this option, you need to be logged out. This option uses localstorage to show the modal box for the first time only.', 'premium-addons-for-elementor' ),
292 'type' => Controls_Manager::RAW_HTML,
293 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
294 'conditions' => array(
295 'relation' => 'or',
296 'terms' => array(
297 array(
298 'name' => 'premium_modal_box_display_on',
299 'value' => 'exit',
300 ),
301 array(
302 'name' => 'show_again_exit',
303 'value' => 'yes',
304 ),
305 ),
306 ),
307 )
308 );
309
310 $this->add_control(
311 'premium_modal_box_button_text',
312 array(
313 'label' => __( 'Button Text', 'premium-addons-for-elementor' ),
314 'default' => __( 'Premium Addons', 'premium-addons-for-elementor' ),
315 'type' => Controls_Manager::TEXT,
316 'dynamic' => array( 'active' => true ),
317 'label_block' => true,
318 'condition' => array(
319 'premium_modal_box_display_on' => 'button',
320 ),
321 )
322 );
323
324 $this->add_control(
325 'premium_modal_box_icon_switcher',
326 array(
327 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
328 'type' => Controls_Manager::SWITCHER,
329 'condition' => array(
330 'premium_modal_box_display_on' => 'button',
331 ),
332 'description' => __( 'Enable or disable button icon', 'premium-addons-for-elementor' ),
333 )
334 );
335
336 $this->add_control(
337 'icon_type',
338 array(
339 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
340 'type' => Controls_Manager::SELECT,
341 'options' => array(
342 'icon' => __( 'Font Awesome Icon', 'premium-addons-for-elementor' ),
343 'svg' => __( 'SVG Code', 'premium-addons-for-elementor' ),
344 ),
345 'default' => 'icon',
346 'condition' => array(
347 'premium_modal_box_icon_switcher' => 'yes',
348 'premium_modal_box_display_on' => 'button',
349 ),
350 )
351 );
352
353 $this->add_control(
354 'premium_modal_box_button_icon_selection_updated',
355 array(
356 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
357 'type' => Controls_Manager::ICONS,
358 'fa4compatibility' => 'premium_modal_box_button_icon_selection',
359 'default' => array(
360 'value' => 'fas fa-star',
361 'library' => 'fa-solid',
362 ),
363 'label_block' => true,
364 'condition' => array(
365 'premium_modal_box_display_on' => 'button',
366 'premium_modal_box_icon_switcher' => 'yes',
367 'icon_type' => 'icon',
368 ),
369 )
370 );
371
372 $this->add_control(
373 'custom_svg',
374 array(
375 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ),
376 'type' => Controls_Manager::TEXTAREA,
377 'description' => 'You can use these sites to create SVGs: <a href="https://danmarshall.github.io/google-font-to-svg-path/" target="_blank">Google Fonts</a> and <a href="https://boxy-svg.com/" target="_blank">Boxy SVG</a>',
378 'condition' => array(
379 'premium_modal_box_display_on' => 'button',
380 'premium_modal_box_icon_switcher' => 'yes',
381 'icon_type' => 'svg',
382 ),
383 'ai' => array(
384 'active' => false,
385 ),
386 )
387 );
388
389 $common_conditions = array(
390 'premium_modal_box_display_on' => 'button',
391 'premium_modal_box_icon_switcher' => 'yes',
392 );
393
394 $this->add_control(
395 'draw_svg',
396 array(
397 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ),
398 'type' => Controls_Manager::SWITCHER,
399 'description' => __( 'Enable this option to make the icon drawable. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=ZLr0bRe0RAY" target="_blank">tutorial</a>',
400 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled',
401 'condition' => array_merge(
402 $common_conditions,
403 array(
404 'icon_type' => array( 'icon', 'svg' ),
405 'premium_modal_box_button_icon_selection_updated[library]!' => 'svg',
406 )
407 ),
408 )
409 );
410
411 if ( $draw_icon ) {
412 $this->add_control(
413 'path_width',
414 array(
415 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ),
416 'type' => Controls_Manager::SLIDER,
417 'range' => array(
418 'px' => array(
419 'min' => 0,
420 'max' => 50,
421 'step' => 0.1,
422 ),
423 ),
424 'condition' => array_merge(
425 $common_conditions,
426 array(
427 'icon_type' => array( 'icon', 'svg' ),
428 )
429 ),
430 'selectors' => array(
431 '{{WRAPPER}} .premium-modal-trigger-btn svg:not(.premium-btn-svg) *' => 'stroke-width: {{SIZE}}',
432 ),
433 )
434 );
435
436 $this->add_control(
437 'svg_sync',
438 array(
439 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ),
440 'type' => Controls_Manager::SWITCHER,
441 'condition' => array_merge(
442 $common_conditions,
443 array(
444 'icon_type' => array( 'icon', 'svg' ),
445 'draw_svg' => 'yes',
446 )
447 ),
448 )
449 );
450
451 $this->add_control(
452 'frames',
453 array(
454 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
455 'type' => Controls_Manager::NUMBER,
456 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ),
457 'default' => 5,
458 'min' => 1,
459 'max' => 100,
460 'condition' => array_merge(
461 $common_conditions,
462 array(
463 'icon_type' => array( 'icon', 'svg' ),
464 'draw_svg' => 'yes',
465 )
466 ),
467 )
468 );
469
470 $this->add_control(
471 'svg_loop',
472 array(
473 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
474 'type' => Controls_Manager::SWITCHER,
475 'return_value' => 'true',
476 'default' => 'true',
477 'condition' => array_merge(
478 $common_conditions,
479 array(
480 'icon_type' => array( 'icon', 'svg' ),
481 'draw_svg' => 'yes',
482 )
483 ),
484 )
485 );
486
487 $this->add_control(
488 'svg_reverse',
489 array(
490 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
491 'type' => Controls_Manager::SWITCHER,
492 'return_value' => 'true',
493 'condition' => array_merge(
494 $common_conditions,
495 array(
496 'icon_type' => array( 'icon', 'svg' ),
497 'draw_svg' => 'yes',
498 )
499 ),
500 )
501 );
502
503 $this->add_control(
504 'start_point',
505 array(
506 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ),
507 'type' => Controls_Manager::SLIDER,
508 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ),
509 'default' => array(
510 'unit' => '%',
511 'size' => 0,
512 ),
513 'condition' => array_merge(
514 $common_conditions,
515 array(
516 'icon_type' => array( 'icon', 'svg' ),
517 'draw_svg' => 'yes',
518 'svg_reverse!' => 'true',
519 )
520 ),
521 )
522 );
523
524 $this->add_control(
525 'end_point',
526 array(
527 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ),
528 'type' => Controls_Manager::SLIDER,
529 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ),
530 'default' => array(
531 'unit' => '%',
532 'size' => 0,
533 ),
534 'condition' => array_merge(
535 $common_conditions,
536 array(
537 'icon_type' => array( 'icon', 'svg' ),
538 'draw_svg' => 'yes',
539 'svg_reverse' => 'true',
540 )
541 ),
542
543 )
544 );
545
546 $this->add_control(
547 'svg_hover',
548 array(
549 'label' => __( 'Only Play on Hover', 'premium-addons-for-elementor' ),
550 'type' => Controls_Manager::SWITCHER,
551 'return_value' => 'true',
552 'condition' => array_merge(
553 $common_conditions,
554 array(
555 'icon_type' => array( 'icon', 'svg' ),
556 'draw_svg' => 'yes',
557 )
558 ),
559 )
560 );
561
562 $this->add_control(
563 'svg_yoyo',
564 array(
565 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ),
566 'type' => Controls_Manager::SWITCHER,
567 'condition' => array_merge(
568 $common_conditions,
569 array(
570 'icon_type' => array( 'icon', 'svg' ),
571 'draw_svg' => 'yes',
572 'svg_loop' => 'true',
573 )
574 ),
575 )
576 );
577 } else {
578
579 Helper_Functions::get_draw_svg_notice(
580 $this,
581 'modal',
582 array_merge(
583 $common_conditions,
584 array(
585 'icon_type' => array( 'icon', 'svg' ),
586 'premium_modal_box_button_icon_selection_updated[library]!' => 'svg',
587 )
588 )
589 );
590
591 }
592
593 $this->add_control(
594 'premium_modal_box_icon_position',
595 array(
596 'label' => __( 'Icon Position', 'premium-addons-for-elementor' ),
597 'type' => Controls_Manager::SELECT,
598 'default' => 'before',
599 'options' => array(
600 'before' => __( 'Before', 'premium-addons-for-elementor' ),
601 'after' => __( 'After', 'premium-addons-for-elementor' ),
602 ),
603 'label_block' => true,
604 'condition' => array(
605 'premium_modal_box_display_on' => 'button',
606 'premium_modal_box_icon_switcher' => 'yes',
607 ),
608 )
609 );
610
611 $this->add_control(
612 'premium_modal_box_icon_before_size',
613 array(
614 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ),
615 'type' => Controls_Manager::SLIDER,
616 'selectors' => array(
617 '{{WRAPPER}} .premium-modal-trigger-btn i' => 'font-size: {{SIZE}}px',
618 '{{WRAPPER}} .premium-modal-trigger-btn svg' => 'width: {{SIZE}}px !important; height: {{SIZE}}px !important',
619 ),
620 'condition' => array(
621 'premium_modal_box_display_on' => 'button',
622 'icon_type' => 'icon',
623 'premium_modal_box_icon_switcher' => 'yes',
624 ),
625 )
626 );
627
628 $this->add_responsive_control(
629 'svg_icon_width',
630 array(
631 'label' => __( 'Icon Width', 'premium-addons-for-elementor' ),
632 'type' => Controls_Manager::SLIDER,
633 'size_units' => array( 'px', 'em', '%' ),
634 'range' => array(
635 'px' => array(
636 'min' => 1,
637 'max' => 600,
638 ),
639 'em' => array(
640 'min' => 1,
641 'max' => 30,
642 ),
643 ),
644 'default' => array(
645 'size' => 100,
646 'unit' => 'px',
647 ),
648 'condition' => array(
649 'premium_modal_box_display_on' => 'button',
650 'premium_modal_box_icon_switcher' => 'yes',
651 'icon_type' => 'svg',
652 ),
653 'selectors' => array(
654 '{{WRAPPER}} .premium-modal-trigger-btn svg' => 'width: {{SIZE}}{{UNIT}};',
655 ),
656 )
657 );
658
659 $this->add_responsive_control(
660 'svg_icon_height',
661 array(
662 'label' => __( 'Icon Height', 'premium-addons-for-elementor' ),
663 'type' => Controls_Manager::SLIDER,
664 'size_units' => array( 'px', 'em' ),
665 'range' => array(
666 'px' => array(
667 'min' => 1,
668 'max' => 300,
669 ),
670 'em' => array(
671 'min' => 1,
672 'max' => 30,
673 ),
674 ),
675 'condition' => array(
676 'premium_modal_box_display_on' => 'button',
677 'premium_modal_box_icon_switcher' => 'yes',
678 'icon_type' => 'svg',
679 ),
680 'selectors' => array(
681 '{{WRAPPER}} .premium-modal-trigger-btn svg' => 'height: {{SIZE}}{{UNIT}}',
682 ),
683 )
684 );
685
686 if ( ! $this->check_rtl() ) {
687 $this->add_control(
688 'premium_modal_box_icon_before_spacing',
689 array(
690 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ),
691 'type' => Controls_Manager::SLIDER,
692 'condition' => array(
693 'premium_modal_box_display_on' => 'button',
694 'premium_modal_box_icon_switcher' => 'yes',
695 'premium_modal_box_icon_position' => 'before',
696 ),
697 'default' => array(
698 'size' => 15,
699 ),
700 'selectors' => array(
701 '{{WRAPPER}} .premium-modal-trigger-btn i, {{WRAPPER}} .premium-modal-trigger-btn svg' => 'margin-right: {{SIZE}}px',
702 '{{WRAPPER}} .premium-modal-trigger-btn' => '--pa-btn-line6-translate-x: {{SIZE}}px',
703 ),
704 'separator' => 'after',
705 )
706 );
707
708 $this->add_control(
709 'premium_modal_box_icon_after_spacing',
710 array(
711 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ),
712 'type' => Controls_Manager::SLIDER,
713 'default' => array(
714 'size' => 15,
715 ),
716 'selectors' => array(
717 '{{WRAPPER}} .premium-modal-trigger-btn i, {{WRAPPER}} .premium-modal-trigger-btn svg' => 'margin-left: {{SIZE}}px;',
718 '{{WRAPPER}} .premium-modal-trigger-btn' => '--pa-btn-line6-translate-x: -{{SIZE}}px;',
719 ),
720 'separator' => 'after',
721 'condition' => array(
722 'premium_modal_box_display_on' => 'button',
723 'premium_modal_box_icon_switcher' => 'yes',
724 'premium_modal_box_icon_position' => 'after',
725 ),
726 )
727 );
728 }
729
730 if ( $this->check_rtl() ) {
731 $this->add_control(
732 'premium_modal_box_icon_rtl_before_spacing',
733 array(
734 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ),
735 'type' => Controls_Manager::SLIDER,
736 'condition' => array(
737 'premium_modal_box_display_on' => 'button',
738 'premium_modal_box_icon_switcher' => 'yes',
739 'premium_modal_box_icon_position' => 'before',
740 ),
741 'default' => array(
742 'size' => 15,
743 ),
744 'selectors' => array(
745 '{{WRAPPER}} .premium-modal-trigger-btn i, {{WRAPPER}} .premium-modal-trigger-btn svg' => 'margin-left: {{SIZE}}px',
746 '{{WRAPPER}} .premium-modal-trigger-btn' => '--pa-btn-line6-translate-x: -{{SIZE}}px',
747 ),
748 'separator' => 'after',
749 )
750 );
751
752 $this->add_control(
753 'premium_modal_box_icon_rtl_after_spacing',
754 array(
755 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ),
756 'type' => Controls_Manager::SLIDER,
757 'default' => array(
758 'size' => 15,
759 ),
760 'selectors' => array(
761 '{{WRAPPER}} .premium-modal-trigger-btn i, {{WRAPPER}} .premium-modal-trigger-btn svg' => 'margin-right: {{SIZE}}px',
762 '{{WRAPPER}} .premium-modal-trigger-btn' => '--pa-btn-line6-translate-x: {{SIZE}}px',
763 ),
764 'separator' => 'after',
765 'condition' => array(
766 'premium_modal_box_display_on' => 'button',
767 'premium_modal_box_icon_switcher' => 'yes',
768 'premium_modal_box_icon_position' => 'after',
769 ),
770 )
771 );
772 }
773
774 Helper_Functions::add_btn_hover_controls( $this, array( 'premium_modal_box_display_on' => 'button' ) );
775
776 $this->add_control(
777 'premium_modal_box_button_size',
778 array(
779 'label' => __( 'Button Size', 'premium-addons-for-elementor' ),
780 'type' => Controls_Manager::SELECT,
781 'options' => array(
782 'sm' => __( 'Small', 'premium-addons-for-elementor' ),
783 'md' => __( 'Medium', 'premium-addons-for-elementor' ),
784 'lg' => __( 'Large', 'premium-addons-for-elementor' ),
785 'block' => __( 'Block', 'premium-addons-for-elementor' ),
786 ),
787 'label_block' => true,
788 'default' => 'lg',
789 'condition' => array(
790 'premium_modal_box_display_on' => 'button',
791 ),
792 )
793 );
794
795 $this->add_control(
796 'premium_modal_box_image_src',
797 array(
798 'label' => __( 'Image', 'premium-addons-for-elementor' ),
799 'type' => Controls_Manager::MEDIA,
800 'dynamic' => array( 'active' => true ),
801 'default' => array(
802 'url' => Utils::get_placeholder_image_src(),
803 ),
804 'label_block' => true,
805 'condition' => array(
806 'premium_modal_box_display_on' => 'image',
807 ),
808 )
809 );
810
811 $this->add_control(
812 'premium_modal_box_selector_text',
813 array(
814 'label' => __( 'Text', 'premium-addons-for-elementor' ),
815 'type' => Controls_Manager::TEXT,
816 'dynamic' => array( 'active' => true ),
817 'label_block' => true,
818 'default' => __( 'Premium Addons', 'premium-addons-for-elementor' ),
819 'condition' => array(
820 'premium_modal_box_display_on' => 'text',
821 ),
822 )
823 );
824
825 $this->add_control(
826 'lottie_url',
827 array(
828 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
829 'type' => Controls_Manager::TEXT,
830 'dynamic' => array( 'active' => true ),
831 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
832 'label_block' => true,
833 'condition' => array(
834 'premium_modal_box_display_on' => 'animation',
835 ),
836 'ai' => array(
837 'active' => false,
838 ),
839 )
840 );
841
842 $this->add_control(
843 'lottie_loop',
844 array(
845 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
846 'type' => Controls_Manager::SWITCHER,
847 'return_value' => 'true',
848 'default' => 'true',
849 'condition' => array(
850 'premium_modal_box_display_on' => 'animation',
851 ),
852 )
853 );
854
855 $this->add_control(
856 'lottie_reverse',
857 array(
858 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
859 'type' => Controls_Manager::SWITCHER,
860 'return_value' => 'true',
861 'condition' => array(
862 'premium_modal_box_display_on' => 'animation',
863 ),
864 )
865 );
866
867 $this->add_control(
868 'lottie_hover',
869 array(
870 'label' => __( 'Only Play on Hover', 'premium-addons-for-elementor' ),
871 'type' => Controls_Manager::SWITCHER,
872 'return_value' => 'true',
873 'condition' => array(
874 'premium_modal_box_display_on' => 'animation',
875 ),
876 )
877 );
878
879 $this->add_responsive_control(
880 'trigger_image_animation_size',
881 array(
882 'label' => __( 'Size', 'premium-addons-for-elementor' ),
883 'type' => Controls_Manager::SLIDER,
884 'size_units' => array( 'px', 'em', '%' ),
885 'range' => array(
886 'px' => array(
887 'min' => 1,
888 'max' => 800,
889 ),
890 'em' => array(
891 'min' => 1,
892 'max' => 30,
893 ),
894 ),
895 'selectors' => array(
896 '{{WRAPPER}} .premium-modal-trigger-img, {{WRAPPER}} .premium-modal-trigger-animation svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important',
897 ),
898 'condition' => array(
899 'premium_modal_box_display_on' => array( 'image', 'animation' ),
900 ),
901 )
902 );
903
904 $this->add_control(
905 'premium_modal_box_popup_delay',
906 array(
907 'label' => __( 'Delay in Popup Display (Sec)', 'premium-addons-for-elementor' ),
908 'type' => Controls_Manager::NUMBER,
909 'description' => __( 'When should the popup appear during page load? The value is counted in seconds', 'premium-addons-for-elementor' ),
910 'default' => 1,
911 'condition' => array(
912 'premium_modal_box_display_on' => 'pageload',
913 ),
914 )
915 );
916
917 $this->add_responsive_control(
918 'premium_modal_box_selector_align',
919 array(
920 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
921 'type' => Controls_Manager::CHOOSE,
922 'options' => array(
923 'left' => array(
924 'title' => __( 'Left', 'premium-addons-for-elementor' ),
925 'icon' => 'eicon-text-align-left',
926 ),
927 'center' => array(
928 'title' => __( 'Center', 'premium-addons-for-elementor' ),
929 'icon' => 'eicon-text-align-center',
930 ),
931 'right' => array(
932 'title' => __( 'Right', 'premium-addons-for-elementor' ),
933 'icon' => 'eicon-text-align-right',
934 ),
935 ),
936 'toggle' => false,
937 'default' => 'center',
938 'selectors' => array(
939 '{{WRAPPER}} .premium-modal-trigger-container' => 'text-align: {{VALUE}};',
940 ),
941 'conditions' => array(
942 'relation' => 'or',
943 'terms' => array(
944 array(
945 'terms' => array(
946 array(
947 'name' => 'premium_modal_box_display_on',
948 'operator' => '!=',
949 'value' => 'button',
950 ),
951 array(
952 'name' => 'premium_modal_box_display_on',
953 'operator' => '!=',
954 'value' => 'pageload',
955 ),
956 array(
957 'name' => 'premium_modal_box_display_on',
958 'operator' => '!=',
959 'value' => 'exit',
960 ),
961 ),
962 ),
963 array(
964 'relation' => 'and',
965 'terms' => array(
966 array(
967 'name' => 'premium_modal_box_display_on',
968 'value' => 'button',
969 ),
970 array(
971 'name' => 'premium_modal_box_button_size',
972 'operator' => '!=',
973 'value' => 'block',
974 ),
975 ),
976 ),
977 ),
978 ),
979 )
980 );
981
982 $this->add_control(
983 'trigger_zindex',
984 array(
985 'label' => __( 'Trigger Z-Index', 'premium-addons-for-elementor' ),
986 'type' => Controls_Manager::NUMBER,
987 'condition' => array(
988 'premium_modal_box_display_on!' => array( 'pageload', 'exit' ),
989 ),
990 'selectors' => array(
991 '{{WRAPPER}} .premium-modal-trigger-container' => 'position:relative; z-index: {{VALUE}};',
992 ),
993 )
994 );
995
996 $this->end_controls_section();
997
998 $this->start_controls_section(
999 'premium_modal_box_selector_content_section',
1000 array(
1001 'label' => __( 'Content', 'premium-addons-for-elementor' ),
1002 )
1003 );
1004
1005 $this->add_control(
1006 'premium_modal_box_header_switcher',
1007 array(
1008 'label' => __( 'Header', 'premium-addons-for-elementor' ),
1009 'type' => Controls_Manager::SWITCHER,
1010 'label_on' => 'show',
1011 'label_off' => 'hide',
1012 'default' => 'yes',
1013 'description' => __( 'Enable or disable modal header', 'premium-addons-for-elementor' ),
1014 )
1015 );
1016
1017 $this->add_control(
1018 'premium_modal_box_icon_selection',
1019 array(
1020 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
1021 'type' => Controls_Manager::SELECT,
1022 'options' => array(
1023 'noicon' => __( 'None', 'premium-addons-for-elementor' ),
1024 'fonticon' => __( 'Icon', 'premium-addons-for-elementor' ),
1025 'image' => __( 'Custom Image', 'premium-addons-for-elementor' ),
1026 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
1027 ),
1028 'default' => 'noicon',
1029 'condition' => array(
1030 'premium_modal_box_header_switcher' => 'yes',
1031 ),
1032 'label_block' => true,
1033 )
1034 );
1035
1036 $this->add_control(
1037 'premium_modal_box_font_icon_updated',
1038 array(
1039 'label' => __( 'Select Icon', 'premium-addons-for-elementor' ),
1040 'type' => Controls_Manager::ICONS,
1041 'fa4compatibility' => 'premium_modal_box_font_icon',
1042 'condition' => array(
1043 'premium_modal_box_icon_selection' => 'fonticon',
1044 'premium_modal_box_header_switcher' => 'yes',
1045 ),
1046 'label_block' => true,
1047 )
1048 );
1049
1050 $this->add_control(
1051 'premium_modal_box_image_icon',
1052 array(
1053 'label' => __( 'Upload Image', 'premium-addons-for-elementor' ),
1054 'type' => Controls_Manager::MEDIA,
1055 'dynamic' => array( 'active' => true ),
1056 'default' => array(
1057 'url' => Utils::get_placeholder_image_src(),
1058 ),
1059 'condition' => array(
1060 'premium_modal_box_icon_selection' => 'image',
1061 'premium_modal_box_header_switcher' => 'yes',
1062 ),
1063 'label_block' => true,
1064 )
1065 );
1066
1067 $this->add_control(
1068 'header_lottie_url',
1069 array(
1070 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
1071 'type' => Controls_Manager::TEXT,
1072 'dynamic' => array( 'active' => true ),
1073 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
1074 'label_block' => true,
1075 'condition' => array(
1076 'premium_modal_box_icon_selection' => 'animation',
1077 'premium_modal_box_header_switcher' => 'yes',
1078 ),
1079 'ai' => array(
1080 'active' => false,
1081 ),
1082 )
1083 );
1084
1085 $this->add_control(
1086 'header_lottie_loop',
1087 array(
1088 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
1089 'type' => Controls_Manager::SWITCHER,
1090 'return_value' => 'true',
1091 'default' => 'true',
1092 'condition' => array(
1093 'premium_modal_box_icon_selection' => 'animation',
1094 'premium_modal_box_header_switcher' => 'yes',
1095 ),
1096 )
1097 );
1098
1099 $this->add_control(
1100 'header_lottie_reverse',
1101 array(
1102 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
1103 'type' => Controls_Manager::SWITCHER,
1104 'return_value' => 'true',
1105 'condition' => array(
1106 'premium_modal_box_icon_selection' => 'animation',
1107 'premium_modal_box_header_switcher' => 'yes',
1108 ),
1109 )
1110 );
1111
1112 $this->add_responsive_control(
1113 'premium_modal_box_font_icon_size',
1114 array(
1115 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ),
1116 'type' => Controls_Manager::SLIDER,
1117 'size_units' => array( 'px', 'em' ),
1118 'selectors' => array(
1119 '{{WRAPPER}} .premium-modal-box-modal-title i' => 'font-size: {{SIZE}}{{UNIT}}',
1120 '{{WRAPPER}} .premium-modal-box-modal-title img' => 'width: {{SIZE}}{{UNIT}}',
1121 '{{WRAPPER}} .premium-modal-box-modal-title svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important',
1122 ),
1123 'condition' => array(
1124 'premium_modal_box_icon_selection!' => 'noicon',
1125 'premium_modal_box_header_switcher' => 'yes',
1126 ),
1127 )
1128 );
1129
1130 $this->add_control(
1131 'premium_modal_box_title',
1132 array(
1133 'label' => __( 'Title', 'premium-addons-for-elementor' ),
1134 'type' => Controls_Manager::TEXT,
1135 'dynamic' => array( 'active' => true ),
1136 'description' => __( 'Add a title for the modal box', 'premium-addons-for-elementor' ),
1137 'default' => 'Modal Box Title',
1138 'condition' => array(
1139 'premium_modal_box_header_switcher' => 'yes',
1140 ),
1141 'label_block' => true,
1142 )
1143 );
1144
1145 $this->add_control(
1146 'premium_modal_box_content_type',
1147 array(
1148 'label' => __( 'Content to Show', 'premium-addons-for-elementor' ),
1149 'type' => Controls_Manager::SELECT,
1150 'options' => array(
1151 'editor' => __( 'Text Editor', 'premium-addons-for-elementor' ),
1152 'template' => __( 'Elementor Template', 'premium-addons-for-elementor' ),
1153 'id' => __( 'Container ID', 'premium-addons-for-elementor' ),
1154 ),
1155 'default' => 'editor',
1156 'separator' => 'before',
1157 'label_block' => true,
1158 )
1159 );
1160
1161 $this->add_control(
1162 'live_temp_content',
1163 array(
1164 'label' => __( 'Template Title', 'premium-addons-for-elementor' ),
1165 'type' => Controls_Manager::TEXT,
1166 'classes' => 'premium-live-temp-title control-hidden',
1167 'label_block' => true,
1168 'condition' => array(
1169 'premium_modal_box_content_type' => 'template',
1170 ),
1171 'ai' => array(
1172 'active' => false,
1173 ),
1174 )
1175 );
1176
1177 $this->add_control(
1178 'modal_temp_live_btn',
1179 array(
1180 'type' => Controls_Manager::BUTTON,
1181 'label_block' => true,
1182 'button_type' => 'default papro-btn-block',
1183 'text' => __( 'Create / Edit Template', 'premium-addons-for-elementor' ),
1184 'event' => 'createLiveTemp',
1185 'condition' => array(
1186 'premium_modal_box_content_type' => 'template',
1187 ),
1188 )
1189 );
1190
1191 $this->add_control(
1192 'premium_modal_box_content_temp',
1193 array(
1194 'label' => __( 'Templates', 'premium-addons-for-elementor' ),
1195 'type' => Premium_Post_Filter::TYPE,
1196 'classes' => 'premium-live-temp-label',
1197 'label_block' => true,
1198 'multiple' => false,
1199 'source' => 'elementor_library',
1200 'condition' => array(
1201 'premium_modal_box_content_type' => 'template',
1202 ),
1203 )
1204 );
1205
1206 $this->add_control(
1207 'premium_modal_box_content',
1208 array(
1209 'type' => Controls_Manager::WYSIWYG,
1210 'default' => 'Modal Box Content',
1211 'selector' => '{{WRAPPER}} .premium-modal-box-modal-body',
1212 'dynamic' => array( 'active' => true ),
1213 'condition' => array(
1214 'premium_modal_box_content_type' => 'editor',
1215 ),
1216 'show_label' => false,
1217 )
1218 );
1219
1220 $this->add_control(
1221 'container_id',
1222 array(
1223 'label' => __( 'Container ID', 'premium-addons-for-elementor' ),
1224 'type' => Controls_Manager::TEXT,
1225 'description' => __( 'Use the container ID added from container settings -> Advanced tab -> CSS ID ', 'premium-addons-for-elementor' ),
1226 'label_block' => true,
1227 'ai' => array(
1228 'active' => false,
1229 ),
1230 'condition' => array(
1231 'premium_modal_box_content_type' => 'id',
1232 ),
1233 )
1234 );
1235
1236 $this->add_control(
1237 'container_id_notice',
1238 array(
1239 'raw' => __( 'Use this option to load content from a container on the current page (example: container-1). The container must be added to the page before the Modal Box widget.', 'premium-addons-for-elementor' ),
1240 'type' => Controls_Manager::RAW_HTML,
1241 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
1242 'condition' => array(
1243 'premium_modal_box_content_type' => 'id',
1244 ),
1245 )
1246 );
1247
1248 $this->add_control(
1249 'dismissible',
1250 array(
1251 'label' => __( 'Dismissible', 'premium-addons-for-elementor' ),
1252 'type' => Controls_Manager::SWITCHER,
1253 'prefix_class' => 'premium-modal-dismissible-',
1254 'default' => 'yes',
1255 'separator' => 'before',
1256 )
1257 );
1258
1259 $this->add_control(
1260 'premium_modal_box_upper_close',
1261 array(
1262 'label' => __( 'Upper Close Button', 'premium-addons-for-elementor' ),
1263 'type' => Controls_Manager::SWITCHER,
1264 'default' => 'yes',
1265 'condition' => array(
1266 'dismissible' => 'yes',
1267 'premium_modal_box_header_switcher' => 'yes',
1268 ),
1269 )
1270 );
1271
1272 $this->add_control(
1273 'premium_modal_box_lower_close',
1274 array(
1275 'label' => __( 'Lower Close Button', 'premium-addons-for-elementor' ),
1276 'type' => Controls_Manager::SWITCHER,
1277 'default' => 'yes',
1278 'condition' => array(
1279 'dismissible' => 'yes',
1280 ),
1281 )
1282 );
1283
1284 $this->add_control(
1285 'premium_modal_close_text',
1286 array(
1287 'label' => __( 'Text', 'premium-addons-for-elementor' ),
1288 'default' => __( 'Close', 'premium-addons-for-elementor' ),
1289 'type' => Controls_Manager::TEXT,
1290 'dynamic' => array( 'active' => true ),
1291 'label_block' => true,
1292 'condition' => array(
1293 'dismissible' => 'yes',
1294 'premium_modal_box_lower_close' => 'yes',
1295 ),
1296 )
1297 );
1298
1299 $this->add_control(
1300 'premium_modal_box_animation',
1301 array(
1302 'label' => __( 'Entrance Animation', 'premium-addons-for-elementor' ),
1303 'type' => Controls_Manager::ANIMATION,
1304 'default' => 'fadeInDown',
1305 'label_block' => true,
1306 'frontend_available' => true,
1307 'render_type' => 'template',
1308
1309 )
1310 );
1311
1312 $this->add_control(
1313 'premium_modal_box_animation_duration',
1314 array(
1315 'label' => __( 'Animation Duration', 'premium-addons-for-elementor' ),
1316 'type' => Controls_Manager::SELECT,
1317 'default' => 'fast',
1318 'options' => array(
1319 'slow' => __( 'Slow', 'premium-addons-for-elementor' ),
1320 '' => __( 'Normal', 'premium-addons-for-elementor' ),
1321 'fast' => __( 'Fast', 'premium-addons-for-elementor' ),
1322 ),
1323 'condition' => array(
1324 'premium_modal_box_animation!' => '',
1325 ),
1326 )
1327 );
1328
1329 $this->add_control(
1330 'premium_modal_box_animation_delay',
1331 array(
1332 'label' => __( 'Animation Delay', 'premium-addons-for-elementor' ) . ' (s)',
1333 'type' => Controls_Manager::NUMBER,
1334 'default' => '',
1335 'step' => 0.1,
1336 'condition' => array(
1337 'premium_modal_box_animation!' => '',
1338 ),
1339 'frontend_available' => true,
1340 )
1341 );
1342
1343 $this->end_controls_section();
1344
1345 $this->start_controls_section(
1346 'section_pa_docs',
1347 array(
1348 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
1349 )
1350 );
1351
1352 $docs = array(
1353 'https://premiumaddons.com/docs/modal-box-widget-tutorial/' => __( 'Getting started »', 'premium-addons-for-elementor' ),
1354 'https://premiumaddons.com/docs/how-to-create-elementor-template-to-be-used-with-premium-addons' => __( 'How to create an Elementor template to be used in Modal Box widget »', 'premium-addons-for-elementor' ),
1355 'https://premiumaddons.com/docs/how-can-i-insert-a-video-box-inside-premium-modal-box-widget/' => __( 'How Can I Insert a Video Box inside Premium Modal Box Widget »', 'premium-addons-for-elementor' ),
1356 );
1357
1358 $doc_index = 1;
1359 foreach ( $docs as $url => $title ) {
1360
1361 $doc_url = Helper_Functions::get_campaign_link( $url, 'modal-widget', 'wp-editor', 'get-support' );
1362
1363 $this->add_control(
1364 'doc_' . $doc_index,
1365 array(
1366 'type' => Controls_Manager::RAW_HTML,
1367 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ),
1368 'content_classes' => 'editor-pa-doc',
1369 )
1370 );
1371
1372 ++$doc_index;
1373
1374 }
1375
1376 Helper_Functions::register_element_feedback_controls( $this );
1377
1378 $this->end_controls_section();
1379
1380 $this->start_controls_section(
1381 'premium_modal_box_selector_style_section',
1382 array(
1383 'label' => __( 'Trigger', 'premium-addons-for-elementor' ),
1384 'tab' => Controls_Manager::TAB_STYLE,
1385 'condition' => array(
1386 'premium_modal_box_display_on!' => array( 'pageload', 'exit' ),
1387 ),
1388 )
1389 );
1390
1391 $this->add_group_control(
1392 Group_Control_Css_Filter::get_type(),
1393 array(
1394 'name' => 'trigger_css_filters',
1395 'selector' => '{{WRAPPER}} .premium-modal-trigger-animation',
1396 'condition' => array(
1397 'premium_modal_box_display_on' => 'animation',
1398 ),
1399 )
1400 );
1401
1402 $this->add_group_control(
1403 Group_Control_Css_Filter::get_type(),
1404 array(
1405 'name' => 'trigger_hover_css_filters',
1406 'label' => __( 'Hover CSS Filters', 'premium-addons-for-elementor' ),
1407 'selector' => '{{WRAPPER}} .premium-modal-trigger-animation:hover',
1408 'condition' => array(
1409 'premium_modal_box_display_on' => 'animation',
1410 ),
1411 )
1412 );
1413
1414 $this->add_group_control(
1415 Group_Control_Typography::get_type(),
1416 array(
1417 'name' => 'selectortext',
1418 'global' => array(
1419 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1420 ),
1421 'selector' => '{{WRAPPER}} .premium-modal-trigger-btn, {{WRAPPER}} .premium-modal-trigger-text',
1422 'condition' => array(
1423 'premium_modal_box_display_on' => array( 'button', 'text' ),
1424 ),
1425 )
1426 );
1427
1428 $this->add_control(
1429 'svg_color',
1430 array(
1431 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ),
1432 'type' => Controls_Manager::COLOR,
1433 'global' => false,
1434 'separator' => 'after',
1435 'condition' => array(
1436 'premium_modal_box_icon_switcher' => 'yes',
1437 'premium_modal_box_display_on' => 'button',
1438 'icon_type' => array( 'icon', 'svg' ),
1439 'draw_svg' => 'yes',
1440 ),
1441 )
1442 );
1443
1444 $this->start_controls_tabs( 'premium_modal_box_button_style' );
1445
1446 $this->start_controls_tab(
1447 'premium_modal_box_tab_selector_normal',
1448 array(
1449 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
1450 'condition' => array(
1451 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1452 ),
1453 )
1454 );
1455
1456 $this->add_control(
1457 'premium_modal_box_button_text_color',
1458 array(
1459 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1460 'type' => Controls_Manager::COLOR,
1461 'global' => array(
1462 'default' => Global_Colors::COLOR_SECONDARY,
1463 ),
1464 'selectors' => array(
1465 '{{WRAPPER}} .premium-modal-trigger-btn, {{WRAPPER}} .premium-modal-trigger-text' => 'color:{{VALUE}};',
1466 ),
1467 'condition' => array(
1468 'premium_modal_box_display_on' => array( 'button', 'text' ),
1469 ),
1470 )
1471 );
1472
1473 $this->add_control(
1474 'premium_modal_box_button_icon_color',
1475 array(
1476 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
1477 'type' => Controls_Manager::COLOR,
1478 'global' => array(
1479 'default' => Global_Colors::COLOR_SECONDARY,
1480 ),
1481 'selectors' => array(
1482 '{{WRAPPER}} .premium-modal-trigger-btn i' => 'color:{{VALUE}}',
1483 '{{WRAPPER}} .premium-modal-trigger-btn svg:not(.premium-btn-svg), {{WRAPPER}} .premium-modal-trigger-btn svg:not(.premium-btn-svg) *' => 'fill: {{VALUE}};',
1484 ),
1485 'condition' => array(
1486 'premium_modal_box_icon_switcher' => 'yes',
1487 'premium_modal_box_display_on' => 'button',
1488 ),
1489 )
1490 );
1491
1492 if ( $draw_icon ) {
1493 $this->add_control(
1494 'stroke_color',
1495 array(
1496 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1497 'type' => Controls_Manager::COLOR,
1498 'global' => array(
1499 'default' => Global_Colors::COLOR_ACCENT,
1500 ),
1501 'condition' => array(
1502 'premium_modal_box_icon_switcher' => 'yes',
1503 'premium_modal_box_display_on' => 'button',
1504 'icon_type' => array( 'icon', 'svg' ),
1505 ),
1506 'selectors' => array(
1507 '{{WRAPPER}} .premium-modal-trigger-btn svg:not(.premium-btn-svg) *' => 'stroke: {{VALUE}};',
1508 ),
1509 )
1510 );
1511 }
1512
1513 $this->add_control(
1514 'premium_modal_box_selector_background',
1515 array(
1516 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1517 'type' => Controls_Manager::COLOR,
1518 'global' => array(
1519 'default' => Global_Colors::COLOR_PRIMARY,
1520 ),
1521 'selectors' => array(
1522 '{{WRAPPER}} .premium-modal-trigger-btn, {{WRAPPER}} .premium-button-style2-shutinhor:before, {{WRAPPER}} .premium-button-style2-shutinver:before, {{WRAPPER}} .premium-button-style5-radialin:before, {{WRAPPER}} .premium-button-style5-rectin:before' => 'background-color: {{VALUE}};',
1523 ),
1524 'condition' => array(
1525 'premium_modal_box_display_on' => 'button',
1526 ),
1527 )
1528 );
1529
1530 $this->add_group_control(
1531 Group_Control_Border::get_type(),
1532 array(
1533 'name' => 'selector_border',
1534 'selector' => '{{WRAPPER}} .premium-modal-trigger-btn,{{WRAPPER}} .premium-modal-trigger-text, {{WRAPPER}} .premium-modal-trigger-img',
1535 'condition' => array(
1536 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1537 ),
1538 )
1539 );
1540
1541 $this->add_control(
1542 'premium_modal_box_selector_border_radius',
1543 array(
1544 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1545 'type' => Controls_Manager::SLIDER,
1546 'size_units' => array( 'px', '%', 'em' ),
1547 'default' => array(
1548 'size' => 0,
1549 ),
1550 'selectors' => array(
1551 '{{WRAPPER}} .premium-modal-trigger-btn, {{WRAPPER}} .premium-modal-trigger-text, {{WRAPPER}} .premium-modal-trigger-img' => 'border-radius:{{SIZE}}{{UNIT}};',
1552 ),
1553 'condition' => array(
1554 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1555 ),
1556 )
1557 );
1558
1559 $this->add_group_control(
1560 Group_Control_Box_Shadow::get_type(),
1561 array(
1562 'label' => __( 'Shadow', 'premium-addons-for-elementor' ),
1563 'name' => 'premium_modal_box_selector_box_shadow',
1564 'selector' => '{{WRAPPER}} .premium-modal-trigger-btn, {{WRAPPER}} .premium-modal-trigger-img',
1565 'condition' => array(
1566 'premium_modal_box_display_on' => array( 'button', 'image' ),
1567 ),
1568 )
1569 );
1570
1571 $this->add_group_control(
1572 Group_Control_Text_Shadow::get_type(),
1573 array(
1574 'name' => 'premium_modal_box_selector_text_shadow',
1575 'selector' => '{{WRAPPER}} .premium-modal-trigger-text',
1576 'condition' => array(
1577 'premium_modal_box_display_on' => 'text',
1578 ),
1579 )
1580 );
1581
1582 $this->end_controls_tab();
1583
1584 $this->start_controls_tab(
1585 'premium_modal_box_tab_selector_hover',
1586 array(
1587 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
1588 'condition' => array(
1589 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1590 ),
1591 )
1592 );
1593
1594 $this->add_control(
1595 'premium_modal_box_button_text_color_hover',
1596 array(
1597 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1598 'type' => Controls_Manager::COLOR,
1599 'global' => array(
1600 'default' => Global_Colors::COLOR_PRIMARY,
1601 ),
1602 'selectors' => array(
1603 '{{WRAPPER}} .premium-modal-trigger-btn:hover, {{WRAPPER}} .premium-modal-trigger-text:hover, {{WRAPPER}} .premium-button-line6::after' => 'color:{{VALUE}};',
1604 ),
1605 'condition' => array(
1606 'premium_modal_box_display_on' => array( 'button', 'text' ),
1607 ),
1608 )
1609 );
1610
1611 $this->add_control(
1612 'premium_modal_box_button_icon_hover_color',
1613 array(
1614 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
1615 'type' => Controls_Manager::COLOR,
1616 'global' => array(
1617 'default' => Global_Colors::COLOR_PRIMARY,
1618 ),
1619 'selectors' => array(
1620 '{{WRAPPER}} .premium-modal-trigger-btn:hover i' => 'color: {{VALUE}}',
1621 '{{WRAPPER}} .premium-modal-trigger-btn:hover svg:not(.premium-btn-svg), {{WRAPPER}} .premium-modal-trigger-btn:hover svg:not(.premium-btn-svg) *' => 'fill: {{VALUE}};',
1622 ),
1623 'condition' => array(
1624 'premium_modal_box_icon_switcher' => 'yes',
1625 'premium_modal_box_display_on' => 'button',
1626 ),
1627 )
1628 );
1629
1630 if ( $draw_icon ) {
1631 $this->add_control(
1632 'stroke_color_hover',
1633 array(
1634 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1635 'type' => Controls_Manager::COLOR,
1636 'global' => array(
1637 'default' => Global_Colors::COLOR_ACCENT,
1638 ),
1639 'condition' => array(
1640 'premium_modal_box_icon_switcher' => 'yes',
1641 'premium_modal_box_display_on' => 'button',
1642 'icon_type' => array( 'icon', 'svg' ),
1643 ),
1644 'selectors' => array(
1645 '{{WRAPPER}} .premium-modal-trigger-btn:hover svg:not(.premium-btn-svg) *' => 'stroke: {{VALUE}};',
1646 ),
1647 )
1648 );
1649 }
1650
1651 $this->add_control(
1652 'underline_color',
1653 array(
1654 'label' => __( 'Line Color', 'premium-addons-for-elementor' ),
1655 'type' => Controls_Manager::COLOR,
1656 'global' => array(
1657 'default' => Global_Colors::COLOR_SECONDARY,
1658 ),
1659 'selectors' => array(
1660 '{{WRAPPER}} .premium-btn-svg' => 'stroke: {{VALUE}};',
1661 '{{WRAPPER}} .premium-button-line2::before, {{WRAPPER}} .premium-button-line4::before, {{WRAPPER}} .premium-button-line5::before, {{WRAPPER}} .premium-button-line5::after, {{WRAPPER}} .premium-button-line6::before, {{WRAPPER}} .premium-button-line7::before' => 'background-color: {{VALUE}};',
1662 ),
1663 'condition' => array(
1664 'premium_modal_box_display_on' => 'button',
1665 'premium_button_hover_effect' => 'style8',
1666 ),
1667 )
1668 );
1669
1670 $this->add_control(
1671 'first_layer_hover',
1672 array(
1673 'label' => __( 'Layer #1 Color', 'premium-addons-for-elementor' ),
1674 'type' => Controls_Manager::COLOR,
1675 'global' => array(
1676 'default' => Global_Colors::COLOR_SECONDARY,
1677 ),
1678 'selectors' => array(
1679 '{{WRAPPER}} .premium-button-style7 .premium-button-text-icon-wrapper:before' => 'background-color: {{VALUE}}',
1680 ),
1681 'condition' => array(
1682 'premium_modal_box_display_on' => 'button',
1683 'premium_button_hover_effect' => 'style7',
1684
1685 ),
1686 )
1687 );
1688
1689 $this->add_control(
1690 'second_layer_hover',
1691 array(
1692 'label' => __( 'Layer #2 Color', 'premium-addons-for-elementor' ),
1693 'type' => Controls_Manager::COLOR,
1694 'global' => array(
1695 'default' => Global_Colors::COLOR_TEXT,
1696 ),
1697 'selectors' => array(
1698 '{{WRAPPER}} .premium-button-style7 .premium-button-text-icon-wrapper:after' => 'background-color: {{VALUE}}',
1699 ),
1700 'condition' => array(
1701 'premium_modal_box_display_on' => 'button',
1702 'premium_button_hover_effect' => 'style7',
1703 ),
1704 )
1705 );
1706
1707 $this->add_control(
1708 'premium_modal_box_selector_hover_background',
1709 array(
1710 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1711 'type' => Controls_Manager::COLOR,
1712 'global' => array(
1713 'default' => Global_Colors::COLOR_TEXT,
1714 ),
1715 'selectors' => array(
1716 '{{WRAPPER}} .premium-button-none:hover, {{WRAPPER}} .premium-button-style8:hover, {{WRAPPER}} .premium-button-style1:before, {{WRAPPER}} .premium-button-style2-shutouthor:before, {{WRAPPER}} .premium-button-style2-shutoutver:before, {{WRAPPER}} .premium-button-style2-shutinhor, {{WRAPPER}} .premium-button-style2-shutinver, {{WRAPPER}} .premium-button-style2-dshutinhor:before, {{WRAPPER}} .premium-button-style2-dshutinver:before, {{WRAPPER}} .premium-button-style2-scshutouthor:before, {{WRAPPER}} .premium-button-style2-scshutoutver:before, {{WRAPPER}} .premium-button-style5-radialin, {{WRAPPER}} .premium-button-style5-radialout:before, {{WRAPPER}} .premium-button-style5-rectin, {{WRAPPER}} .premium-button-style5-rectout:before, {{WRAPPER}} .premium-button-style6-bg, {{WRAPPER}} .premium-button-style6:before' => 'background: {{VALUE}};',
1717 ),
1718 'condition' => array(
1719 'premium_modal_box_display_on' => 'button',
1720 'premium_button_hover_effect!' => 'style7',
1721 ),
1722 )
1723 );
1724
1725 $this->add_group_control(
1726 Group_Control_Border::get_type(),
1727 array(
1728 'name' => 'selector_border_hover',
1729 'selector' => '{{WRAPPER}} .premium-modal-trigger-btn:hover,
1730 {{WRAPPER}} .premium-modal-trigger-text:hover, {{WRAPPER}} .premium-modal-trigger-img:hover',
1731 'condition' => array(
1732 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1733 ),
1734 )
1735 );
1736
1737 $this->add_control(
1738 'premium_modal_box_selector_border_radius_hover',
1739 array(
1740 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1741 'type' => Controls_Manager::SLIDER,
1742 'size_units' => array( 'px', '%', 'em' ),
1743 'selectors' => array(
1744 '{{WRAPPER}} .premium-modal-trigger-btn:hover,{{WRAPPER}} .premium-modal-trigger-text:hover, {{WRAPPER}} .premium-modal-trigger-img:hover' => 'border-radius:{{SIZE}}{{UNIT}};',
1745 ),
1746 'condition' => array(
1747 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1748 ),
1749 )
1750 );
1751
1752 $this->add_group_control(
1753 Group_Control_Box_Shadow::get_type(),
1754 array(
1755 'label' => __( 'Shadow', 'premium-addons-for-elementor' ),
1756 'name' => 'premium_modal_box_selector_box_shadow_hover',
1757 'selector' => '{{WRAPPER}} .premium-modal-trigger-btn:hover, {{WRAPPER}} .premium-modal-trigger-text:hover, {{WRAPPER}} .premium-modal-trigger-img:hover',
1758 'condition' => array(
1759 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1760 ),
1761 )
1762 );
1763
1764 $this->end_controls_tab();
1765
1766 $this->end_controls_tabs();
1767
1768 $this->add_responsive_control(
1769 'premium_modal_box_selector_padding',
1770 array(
1771 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1772 'type' => Controls_Manager::DIMENSIONS,
1773 'size_units' => array( 'px', 'em', '%' ),
1774 'separator' => 'before',
1775 'selectors' => array(
1776 '{{WRAPPER}} .premium-modal-trigger-btn, {{WRAPPER}} .premium-modal-trigger-text, {{WRAPPER}} .premium-button-line6::after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
1777 ),
1778 'condition' => array(
1779 'premium_modal_box_display_on' => array( 'button', 'text' ),
1780 ),
1781 )
1782 );
1783
1784 $this->end_controls_section();
1785
1786 $this->start_controls_section(
1787 'premium_modal_box_header_settings',
1788 array(
1789 'label' => __( 'Header', 'premium-addons-for-elementor' ),
1790 'tab' => Controls_Manager::TAB_STYLE,
1791 'condition' => array(
1792 'premium_modal_box_header_switcher' => 'yes',
1793 ),
1794 )
1795 );
1796
1797 $this->add_control(
1798 'premium_modal_box_header_text_color',
1799 array(
1800 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1801 'type' => Controls_Manager::COLOR,
1802 'selectors' => array(
1803 '{{WRAPPER}} .premium-modal-box-modal-title' => 'color: {{VALUE}}',
1804 '{{WRAPPER}} .premium-modal-box-modal-title svg' => 'fill: {{VALUE}}',
1805 ),
1806 )
1807 );
1808
1809 $this->add_group_control(
1810 Group_Control_Typography::get_type(),
1811 array(
1812 'name' => 'headertext',
1813 'global' => array(
1814 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1815 ),
1816 'selector' => '{{WRAPPER}} .premium-modal-box-modal-title',
1817 )
1818 );
1819
1820 $this->add_control(
1821 'premium_modal_box_header_background',
1822 array(
1823 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1824 'type' => Controls_Manager::COLOR,
1825 'selectors' => array(
1826 '{{WRAPPER}} .premium-modal-box-modal-header' => 'background: {{VALUE}};',
1827 ),
1828 )
1829 );
1830
1831 $this->add_control(
1832 'header_separator_background',
1833 array(
1834 'label' => __( 'Separator Color', 'premium-addons-for-elementor' ),
1835 'type' => Controls_Manager::COLOR,
1836 'selectors' => array(
1837 '{{WRAPPER}} .premium-modal-box-modal-header' => 'border-bottom-color: {{VALUE}};',
1838 ),
1839 )
1840 );
1841
1842 $this->add_group_control(
1843 Group_Control_Border::get_type(),
1844 array(
1845 'name' => 'premium_modal_header_border',
1846 'selector' => '{{WRAPPER}} .premium-modal-box-modal-header',
1847 )
1848 );
1849
1850 $this->end_controls_section();
1851
1852 $this->start_controls_section(
1853 'premium_modal_box_upper_close_button_section',
1854 array(
1855 'label' => __( 'Upper Close Button', 'premium-addons-for-elementor' ),
1856 'tab' => Controls_Manager::TAB_STYLE,
1857 'condition' => array(
1858 'dismissible' => 'yes',
1859 'premium_modal_box_upper_close' => 'yes',
1860 'premium_modal_box_header_switcher' => 'yes',
1861 ),
1862 )
1863 );
1864
1865 $this->add_responsive_control(
1866 'premium_modal_box_upper_close_button_size',
1867 array(
1868 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1869 'type' => Controls_Manager::SLIDER,
1870 'size_units' => array( 'px', '%', 'em' ),
1871 'selectors' => array(
1872 '{{WRAPPER}} .premium-modal-box-modal-header button' => 'font-size: {{SIZE}}{{UNIT}};',
1873 ),
1874 )
1875 );
1876
1877 $this->start_controls_tabs( 'premium_modal_box_upper_close_button_style' );
1878
1879 $this->start_controls_tab(
1880 'premium_modal_box_upper_close_button_normal',
1881 array(
1882 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
1883 )
1884 );
1885
1886 $this->add_control(
1887 'premium_modal_box_upper_close_button_normal_color',
1888 array(
1889 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1890 'type' => Controls_Manager::COLOR,
1891 'selectors' => array(
1892 '{{WRAPPER}} .premium-modal-box-modal-close' => 'color: {{VALUE}};',
1893 ),
1894 )
1895 );
1896
1897 $this->add_control(
1898 'premium_modal_box_upper_close_button_background_color',
1899 array(
1900 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1901 'type' => Controls_Manager::COLOR,
1902 'selectors' => array(
1903 '{{WRAPPER}} .premium-modal-box-modal-close' => 'background:{{VALUE}};',
1904 ),
1905 )
1906 );
1907
1908 $this->add_group_control(
1909 Group_Control_Border::get_type(),
1910 array(
1911 'name' => 'premium_modal_upper_border',
1912 'selector' => '{{WRAPPER}} .premium-modal-box-modal-close',
1913 )
1914 );
1915
1916 $this->add_control(
1917 'premium_modal_upper_border_radius',
1918 array(
1919 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1920 'type' => Controls_Manager::SLIDER,
1921 'size_units' => array( 'px', '%', 'em' ),
1922 'selectors' => array(
1923 '{{WRAPPER}} .premium-modal-box-modal-close' => 'border-radius:{{SIZE}}{{UNIT}};',
1924 ),
1925 'separator' => 'after',
1926 )
1927 );
1928
1929 $this->end_controls_tab();
1930
1931 $this->start_controls_tab(
1932 'premium_modal_box_upper_close_button_hover',
1933 array(
1934 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
1935 )
1936 );
1937
1938 $this->add_control(
1939 'premium_modal_box_upper_close_button_hover_color',
1940 array(
1941 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1942 'type' => Controls_Manager::COLOR,
1943 'selectors' => array(
1944 '{{WRAPPER}} .premium-modal-box-modal-close:hover' => 'color: {{VALUE}};',
1945 ),
1946 )
1947 );
1948
1949 $this->add_control(
1950 'premium_modal_box_upper_close_button_background_color_hover',
1951 array(
1952 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1953 'type' => Controls_Manager::COLOR,
1954 'selectors' => array(
1955 '{{WRAPPER}} .premium-modal-box-modal-close:hover' => 'background:{{VALUE}};',
1956 ),
1957 )
1958 );
1959
1960 $this->add_group_control(
1961 Group_Control_Border::get_type(),
1962 array(
1963 'name' => 'premium_modal_upper_border_hover',
1964 'selector' => '{{WRAPPER}} .premium-modal-box-modal-close:hover',
1965 )
1966 );
1967
1968 $this->add_control(
1969 'premium_modal_upper_border_radius_hover',
1970 array(
1971 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1972 'type' => Controls_Manager::SLIDER,
1973 'size_units' => array( 'px', '%', 'em' ),
1974 'selectors' => array(
1975 '{{WRAPPER}} .premium-modal-box-modal-close:hover' => 'border-radius:{{SIZE}}{{UNIT}};',
1976 ),
1977 'separator' => 'after',
1978 )
1979 );
1980
1981 $this->end_controls_tab();
1982
1983 $this->end_controls_tabs();
1984
1985 $this->add_responsive_control(
1986 'premium_modal_box_upper_close_button_padding',
1987 array(
1988 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1989 'type' => Controls_Manager::DIMENSIONS,
1990 'size_units' => array( 'px', 'em', '%' ),
1991 'selectors' => array(
1992 '{{WRAPPER}} .premium-modal-box-modal-close' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
1993 ),
1994 )
1995 );
1996
1997 $this->end_controls_section();
1998
1999 $this->start_controls_section(
2000 'premium_modal_box_lower_close_button_section',
2001 array(
2002 'label' => __( 'Lower Close Button', 'premium-addons-for-elementor' ),
2003 'tab' => Controls_Manager::TAB_STYLE,
2004 'condition' => array(
2005 'dismissible' => 'yes',
2006 'premium_modal_box_lower_close' => 'yes',
2007 ),
2008 )
2009 );
2010
2011 $this->add_group_control(
2012 Group_Control_Typography::get_type(),
2013 array(
2014 'name' => 'lowerclose',
2015 'global' => array(
2016 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
2017 ),
2018 'selector' => '{{WRAPPER}} .premium-modal-box-modal-lower-close',
2019 )
2020 );
2021
2022 $this->add_responsive_control(
2023 'premium_modal_box_lower_close_button_width',
2024 array(
2025 'label' => __( 'Width', 'premium-addons-for-elementor' ),
2026 'type' => Controls_Manager::SLIDER,
2027 'size_units' => array( 'px', '%', 'em' ),
2028 'range' => array(
2029 'px' => array(
2030 'min' => 1,
2031 'max' => 500,
2032 ),
2033 'em' => array(
2034 'min' => 1,
2035 'max' => 30,
2036 ),
2037 ),
2038 'selectors' => array(
2039 '{{WRAPPER}} .premium-modal-box-modal-lower-close' => 'min-width: {{SIZE}}{{UNIT}};',
2040 ),
2041 )
2042 );
2043
2044 $this->start_controls_tabs( 'premium_modal_box_lower_close_button_style' );
2045
2046 $this->start_controls_tab(
2047 'premium_modal_box_lower_close_button_normal',
2048 array(
2049 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
2050 )
2051 );
2052
2053 $this->add_control(
2054 'premium_modal_box_lower_close_button_normal_color',
2055 array(
2056 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2057 'type' => Controls_Manager::COLOR,
2058 'global' => array(
2059 'default' => Global_Colors::COLOR_SECONDARY,
2060 ),
2061 'selectors' => array(
2062 '{{WRAPPER}} .premium-modal-box-modal-lower-close' => 'color: {{VALUE}};',
2063 ),
2064 )
2065 );
2066
2067 $this->add_control(
2068 'premium_modal_box_lower_close_button_background_normal_color',
2069 array(
2070 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2071 'type' => Controls_Manager::COLOR,
2072 'global' => array(
2073 'default' => Global_Colors::COLOR_PRIMARY,
2074 ),
2075 'selectors' => array(
2076 '{{WRAPPER}} .premium-modal-box-modal-lower-close' => 'background-color: {{VALUE}};',
2077 ),
2078 )
2079 );
2080
2081 $this->add_group_control(
2082 Group_Control_Border::get_type(),
2083 array(
2084 'name' => 'premium_modal_box_lower_close_border',
2085 'selector' => '{{WRAPPER}} .premium-modal-box-modal-lower-close',
2086 )
2087 );
2088
2089 $this->add_control(
2090 'premium_modal_box_lower_close_border_radius',
2091 array(
2092 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2093 'type' => Controls_Manager::SLIDER,
2094 'size_units' => array( 'px', '%', 'em' ),
2095 'selectors' => array(
2096 '{{WRAPPER}} .premium-modal-box-modal-lower-close' => 'border-radius: {{SIZE}}{{UNIT}};',
2097 ),
2098 'separator' => 'after',
2099 )
2100 );
2101
2102 $this->end_controls_tab();
2103
2104 $this->start_controls_tab(
2105 'premium_modal_box_lower_close_button_hover',
2106 array(
2107 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
2108 )
2109 );
2110
2111 $this->add_control(
2112 'premium_modal_box_lower_close_button_hover_color',
2113 array(
2114 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2115 'type' => Controls_Manager::COLOR,
2116 'global' => array(
2117 'default' => Global_Colors::COLOR_PRIMARY,
2118 ),
2119 'selectors' => array(
2120 '{{WRAPPER}} .premium-modal-box-modal-lower-close:hover' => 'color: {{VALUE}};',
2121 ),
2122 )
2123 );
2124
2125 $this->add_control(
2126 'premium_modal_box_lower_close_button_background_hover_color',
2127 array(
2128 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2129 'type' => Controls_Manager::COLOR,
2130 'global' => array(
2131 'default' => Global_Colors::COLOR_SECONDARY,
2132 ),
2133 'selectors' => array(
2134 '{{WRAPPER}} .premium-modal-box-modal-lower-close:hover' => 'background-color: {{VALUE}};',
2135 ),
2136 )
2137 );
2138
2139 $this->add_group_control(
2140 Group_Control_Border::get_type(),
2141 array(
2142 'name' => 'premium_modal_box_lower_close_border_hover',
2143 'selector' => '{{WRAPPER}} .premium-modal-box-modal-lower-close:hover',
2144 )
2145 );
2146
2147 $this->add_control(
2148 'premium_modal_box_lower_close_border_radius_hover',
2149 array(
2150 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2151 'type' => Controls_Manager::SLIDER,
2152 'size_units' => array( 'px', '%', 'em' ),
2153 'selectors' => array(
2154 '{{WRAPPER}} .premium-modal-box-modal-lower-close:hover' => 'border-radius: {{SIZE}}{{UNIT}};',
2155 ),
2156 'separator' => 'after',
2157 )
2158 );
2159
2160 $this->end_controls_tab();
2161
2162 $this->end_controls_tabs();
2163
2164 $this->add_responsive_control(
2165 'premium_modal_box_lower_close_button_padding',
2166 array(
2167 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2168 'type' => Controls_Manager::DIMENSIONS,
2169 'size_units' => array( 'px', 'em', '%' ),
2170 'selectors' => array(
2171 '{{WRAPPER}} .premium-modal-box-modal-lower-close' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2172 ),
2173 )
2174 );
2175
2176 $this->end_controls_section();
2177
2178 $this->start_controls_section(
2179 'premium_modal_box_style',
2180 array(
2181 'label' => __( 'Modal Box', 'premium-addons-for-elementor' ),
2182 'tab' => Controls_Manager::TAB_STYLE,
2183 )
2184 );
2185
2186 $this->add_control(
2187 'text_content_color',
2188 array(
2189 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
2190 'type' => Controls_Manager::COLOR,
2191 'selectors' => array(
2192 '{{WRAPPER}} .premium-modal-box-modal-body' => 'color: {{VALUE}}',
2193 ),
2194 'condition' => array(
2195 'premium_modal_box_content_type' => 'editor',
2196 ),
2197 )
2198 );
2199
2200 $this->add_group_control(
2201 Group_Control_Typography::get_type(),
2202 array(
2203 'name' => 'content_typography',
2204 'selector' => '{{WRAPPER}} .premium-modal-box-modal-body',
2205 'condition' => array(
2206 'premium_modal_box_content_type' => 'editor',
2207 ),
2208 )
2209 );
2210
2211 $this->add_control(
2212 'premium_modal_box_content_background',
2213 array(
2214 'label' => __( 'Content Background Color', 'premium-addons-for-elementor' ),
2215 'type' => Controls_Manager::COLOR,
2216 'selectors' => array(
2217 '{{WRAPPER}} .premium-modal-box-modal-body' => 'background: {{VALUE}};',
2218 ),
2219 )
2220 );
2221
2222 $this->add_control(
2223 'box_background',
2224 array(
2225 'label' => __( 'Box Background Color', 'premium-addons-for-elementor' ),
2226 'type' => Controls_Manager::COLOR,
2227 'selectors' => array(
2228 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'background: {{VALUE}};',
2229 ),
2230 )
2231 );
2232
2233 $this->add_control(
2234 'body_lq_effect',
2235 array(
2236 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ),
2237 'type' => Controls_Manager::SELECT,
2238 'description' => sprintf(
2239 /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */
2240 esc_html__( 'Important: Make sure this element has a semi-transparent background color to see the effect. See all presets from %1$shere%2$s.', 'premium-addons-for-elementor' ),
2241 '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">',
2242 '</a>'
2243 ),
2244 'options' => array(
2245 'none' => __( 'None', 'premium-addons-for-elementor' ),
2246 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ),
2247 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ),
2248 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ),
2249 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ),
2250 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ),
2251 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ),
2252 ),
2253 'default' => 'none',
2254 'label_block' => true,
2255 'render_type' => 'template',
2256 )
2257 );
2258
2259 $this->add_responsive_control(
2260 'premium_modal_box_modal_size',
2261 array(
2262 'label' => __( 'Width', 'premium-addons-for-elementor' ),
2263 'type' => Controls_Manager::SLIDER,
2264 'size_units' => array( 'px', '%', 'em', 'custom' ),
2265 'range' => array(
2266 'px' => array(
2267 'min' => 50,
2268 'max' => 1500,
2269 ),
2270 'em' => array(
2271 'min' => 1,
2272 'max' => 50,
2273 ),
2274 ),
2275 'separator' => 'before',
2276 'label_block' => true,
2277 'selectors' => array(
2278 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'width: {{SIZE}}{{UNIT}};',
2279 ),
2280 )
2281 );
2282
2283 $this->add_responsive_control(
2284 'premium_modal_box_modal_max_height',
2285 array(
2286 'label' => __( 'Max Height', 'premium-addons-for-elementor' ),
2287 'type' => Controls_Manager::SLIDER,
2288 'size_units' => array( 'px', 'em', 'vh', 'custom' ),
2289 'range' => array(
2290 'px' => array(
2291 'min' => 50,
2292 'max' => 1500,
2293 ),
2294 'em' => array(
2295 'min' => 1,
2296 'max' => 50,
2297 ),
2298 ),
2299 'label_block' => true,
2300 'selectors' => array(
2301 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'max-height: {{SIZE}}{{UNIT}};',
2302 ),
2303 )
2304 );
2305
2306 $this->add_responsive_control(
2307 'content_overflow',
2308 array(
2309 'label' => __( 'Overflow', 'premium-addons-for-elementor' ),
2310 'type' => Controls_Manager::SELECT,
2311 'options' => array(
2312 'auto' => __( 'Auto', 'premium-addons-for-elementor' ),
2313 'visible' => __( 'Visible', 'premium-addons-for-elementor' ),
2314 'hidden' => __( 'Hidden', 'premium-addons-for-elementor' ),
2315 'scroll' => __( 'Scroll', 'premium-addons-for-elementor' ),
2316 ),
2317 'default' => 'auto',
2318 'selectors' => array(
2319 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'overflow: {{VALUE}}',
2320 ),
2321 )
2322 );
2323
2324 $this->add_group_control(
2325 Group_Control_Background::get_type(),
2326 array(
2327 'name' => 'premium_modal_box_modal_background',
2328 'types' => array( 'classic', 'gradient' ),
2329 'selector' => '{{WRAPPER}} .premium-modal-box-modal',
2330 )
2331 );
2332
2333 $this->add_control(
2334 'premium_modal_box_footer_background',
2335 array(
2336 'label' => __( 'Footer Background Color', 'premium-addons-for-elementor' ),
2337 'type' => Controls_Manager::COLOR,
2338 'selectors' => array(
2339 '{{WRAPPER}} .premium-modal-box-modal-footer' => 'background: {{VALUE}};',
2340 ),
2341 )
2342 );
2343
2344 $this->add_control(
2345 'footer_separator_background',
2346 array(
2347 'label' => __( 'Separator Color', 'premium-addons-for-elementor' ),
2348 'type' => Controls_Manager::COLOR,
2349 'selectors' => array(
2350 '{{WRAPPER}} .premium-modal-box-modal-footer' => 'border-top-color: {{VALUE}};',
2351 ),
2352 )
2353 );
2354
2355 $this->add_group_control(
2356 Group_Control_Border::get_type(),
2357 array(
2358 'name' => 'contentborder',
2359 'selector' => '{{WRAPPER}} .premium-modal-box-modal-dialog',
2360 )
2361 );
2362
2363 $this->add_control(
2364 'premium_modal_box_border_radius',
2365 array(
2366 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2367 'type' => Controls_Manager::SLIDER,
2368 'size_units' => array( 'px', '%', 'em' ),
2369 'selectors' => array(
2370 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'border-radius: {{SIZE}}{{UNIT}};',
2371 ),
2372 )
2373 );
2374
2375 $this->add_group_control(
2376 Group_Control_Box_Shadow::get_type(),
2377 array(
2378 'name' => 'premium_modal_box_shadow',
2379 'selector' => '{{WRAPPER}} .premium-modal-box-modal-dialog',
2380 )
2381 );
2382
2383 $this->add_responsive_control(
2384 'premium_modal_box_margin',
2385 array(
2386 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2387 'type' => Controls_Manager::DIMENSIONS,
2388 'size_units' => array( 'px', 'em', '%' ),
2389 'selectors' => array(
2390 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2391 ),
2392 )
2393 );
2394
2395 $this->add_responsive_control(
2396 'premium_modal_box_padding',
2397 array(
2398 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2399 'type' => Controls_Manager::DIMENSIONS,
2400 'size_units' => array( 'px', 'em', '%' ),
2401 'selectors' => array(
2402 '{{WRAPPER}} .premium-modal-box-modal-body' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2403 ),
2404 )
2405 );
2406
2407 $this->end_controls_section();
2408 }
2409
2410
2411 /**
2412 * Render Header Icon
2413 *
2414 * Render HTML markup for modal header icon.
2415 *
2416 * @since 1.0.0
2417 * @access public
2418 *
2419 * @param boolean $new new icon.
2420 * @param boolean $migrate icon migrated.
2421 */
2422 protected function render_header_icon( $new, $migrate ) {
2423
2424 $settings = $this->get_settings_for_display();
2425
2426 $header_icon = $settings['premium_modal_box_icon_selection'];
2427
2428 if ( 'fonticon' === $header_icon ) {
2429 if ( $new || $migrate ) :
2430 Icons_Manager::render_icon( $settings['premium_modal_box_font_icon_updated'], array( 'aria-hidden' => 'true' ) );
2431 else : ?>
2432 <i <?php $this->print_render_attribute_string( 'title_icon' ); ?>></i>
2433 <?php
2434 endif;
2435 } elseif ( 'image' === $header_icon ) {
2436 ?>
2437 <img <?php $this->print_render_attribute_string( 'title_icon' ); ?>>
2438 <?php
2439 } elseif ( 'animation' === $header_icon ) {
2440 $this->add_render_attribute(
2441 'header_lottie',
2442 array(
2443 'class' => array(
2444 'premium-modal-header-lottie',
2445 'premium-lottie-animation',
2446 ),
2447 'data-lottie-url' => $settings['header_lottie_url'],
2448 'data-lottie-loop' => $settings['header_lottie_loop'],
2449 'data-lottie-reverse' => $settings['header_lottie_reverse'],
2450 )
2451 );
2452 ?>
2453 <div <?php $this->print_render_attribute_string( 'header_lottie' ); ?>></div>
2454 <?php
2455 }
2456 }
2457
2458 /**
2459 * Render Modal Box widget output on the frontend.
2460 *
2461 * Written in PHP and used to generate the final HTML.
2462 *
2463 * @since 1.0.0
2464 * @access protected
2465 */
2466 protected function render() {
2467
2468 $settings = $this->get_settings_for_display();
2469
2470 $papro_activated = Helper_Functions::check_papro_version();
2471
2472 $trigger = $settings['premium_modal_box_display_on'];
2473
2474 if ( ! $papro_activated || version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.9.26', '<' ) ) {
2475
2476 if ( 'exit' === $trigger || 'yes' === $settings['show_again_exit'] ) {
2477
2478 ?>
2479 <div class="premium-error-notice">
2480 <?php
2481 $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' );
2482 echo wp_kses_post( $message );
2483 ?>
2484 </div>
2485 <?php
2486 return false;
2487
2488 }
2489 }
2490
2491 $this->add_inline_editing_attributes( 'premium_modal_box_selector_text' );
2492
2493 $this->add_render_attribute(
2494 'trigger',
2495 array(
2496 'data-toggle' => 'premium-modal',
2497 'data-target' => '#premium-modal-' . $this->get_id(),
2498 )
2499 );
2500
2501 if ( 'button' === $trigger ) {
2502
2503 $icon_type = $settings['icon_type'];
2504
2505 if ( 'yes' === $settings['draw_svg'] ) {
2506
2507 $this->add_render_attribute(
2508 'modal',
2509 'class',
2510 array(
2511 'elementor-invisible',
2512 'premium-drawer-hover',
2513 )
2514 );
2515
2516 $this->add_render_attribute(
2517 'icon',
2518 array(
2519 'class' => 'premium-svg-drawer',
2520 'data-svg-reverse' => $settings['svg_reverse'],
2521 'data-svg-loop' => $settings['svg_loop'],
2522 'data-svg-sync' => $settings['svg_sync'],
2523 'data-svg-hover' => $settings['svg_hover'],
2524 'data-svg-fill' => $settings['svg_color'],
2525 'data-svg-frames' => $settings['frames'],
2526 'data-svg-yoyo' => $settings['svg_yoyo'],
2527 'data-svg-point' => $settings['svg_reverse'] ? $settings['end_point']['size'] : $settings['start_point']['size'],
2528 )
2529 );
2530
2531 } else {
2532 $this->add_render_attribute( 'icon', 'class', 'premium-svg-nodraw' );
2533 }
2534
2535 $effect_class = Helper_Functions::get_button_class( $settings );
2536
2537 $this->add_render_attribute(
2538 'trigger',
2539 array(
2540 'type' => 'button',
2541 'class' => array(
2542 'premium-modal-trigger-btn',
2543 'premium-btn-' . $settings['premium_modal_box_button_size'],
2544 $effect_class,
2545 ),
2546 'data-text' => $settings['premium_modal_box_button_text'],
2547 )
2548 );
2549
2550 } elseif ( 'image' === $trigger ) {
2551
2552 $alt = Control_Media::get_image_alt( $settings['premium_modal_box_image_src'] );
2553
2554 $this->add_render_attribute(
2555 'trigger',
2556 array(
2557 'class' => 'premium-modal-trigger-img',
2558 'src' => $settings['premium_modal_box_image_src']['url'],
2559 'alt' => $alt,
2560 )
2561 );
2562
2563 } elseif ( 'text' === $trigger ) {
2564 $this->add_render_attribute( 'trigger', 'class', 'premium-modal-trigger-text' );
2565 } elseif ( 'animation' === $trigger ) {
2566
2567 $this->add_render_attribute(
2568 'trigger',
2569 array(
2570 'class' => array(
2571 'premium-modal-trigger-animation',
2572 'premium-lottie-animation',
2573 ),
2574 'data-lottie-url' => $settings['lottie_url'],
2575 'data-lottie-loop' => $settings['lottie_loop'],
2576 'data-lottie-reverse' => $settings['lottie_reverse'],
2577 'data-lottie-hover' => $settings['lottie_hover'],
2578 )
2579 );
2580
2581 }
2582
2583 if ( 'template' === $settings['premium_modal_box_content_type'] ) {
2584 $template = empty( $settings['premium_modal_box_content_temp'] )
2585 ? $settings['live_temp_content']
2586 : $settings['premium_modal_box_content_temp'];
2587 }
2588
2589 if ( 'yes' === $settings['premium_modal_box_header_switcher'] ) {
2590
2591 $header_icon = $settings['premium_modal_box_icon_selection'];
2592
2593 $header_migrated = false;
2594 $header_new = false;
2595
2596 if ( 'fonticon' === $header_icon ) {
2597
2598 if ( ! empty( $settings['premium_modal_box_font_icon'] ) ) {
2599 $this->add_render_attribute(
2600 'title_icon',
2601 array(
2602 'class' => $settings['premium_modal_box_font_icon'],
2603 'aria-hidden' => 'true',
2604 )
2605 );
2606 }
2607
2608 $header_migrated = isset( $settings['__fa4_migrated']['premium_modal_box_font_icon_updated'] );
2609 $header_new = empty( $settings['premium_modal_box_font_icon'] ) && Icons_Manager::is_migration_allowed();
2610 } elseif ( 'image' === $header_icon ) {
2611
2612 $alt = Control_Media::get_image_alt( $settings['premium_modal_box_image_icon'] );
2613
2614 $this->add_render_attribute(
2615 'title_icon',
2616 array(
2617 'src' => $settings['premium_modal_box_image_icon']['url'],
2618 'alt' => $alt,
2619 )
2620 );
2621
2622 }
2623 }
2624
2625 $modal_settings = array(
2626 'trigger' => $trigger,
2627 'show_on_exit' => 'yes' === $settings['show_again_exit'],
2628 );
2629
2630 if ( 'pageload' === $trigger ) {
2631 $modal_settings['delay'] = $settings['premium_modal_box_popup_delay'];
2632 }
2633
2634 $this->add_render_attribute(
2635 'modal',
2636 array(
2637 'class' => 'premium-modal-box-container',
2638 'data-settings' => wp_json_encode( $modal_settings ),
2639 )
2640 );
2641
2642 $animation_class = $settings['premium_modal_box_animation'];
2643 if ( '' !== $settings['premium_modal_box_animation_duration'] ) {
2644 $animation_dur = 'animated-' . $settings['premium_modal_box_animation_duration'];
2645 } else {
2646 $animation_dur = 'animated-';
2647 }
2648
2649 $this->add_render_attribute(
2650 'dialog',
2651 array(
2652 'class' => 'premium-modal-box-modal-dialog',
2653 'data-delay-animation' => $settings['premium_modal_box_animation_delay'],
2654 'data-modal-animation' => array(
2655 $animation_class,
2656 $animation_dur,
2657 ),
2658 )
2659 );
2660
2661 if ( 'none' !== $settings['body_lq_effect'] ) {
2662 $this->add_render_attribute( 'dialog', 'class', 'premium-con-lq__' . $settings['body_lq_effect'] );
2663 }
2664
2665 ?>
2666
2667 <div <?php $this->print_render_attribute_string( 'modal' ); ?>>
2668 <div class="premium-modal-trigger-container">
2669 <?php
2670 if ( 'button' === $trigger ) :
2671 ?>
2672 <button <?php $this->print_render_attribute_string( 'trigger' ); ?>>
2673
2674 <?php
2675 if ( 'yes' === $settings['premium_modal_box_icon_switcher'] && 'before' === $settings['premium_modal_box_icon_position'] ) :
2676 if ( 'icon' === $icon_type ) :
2677
2678 echo Helper_Functions::get_svg_by_icon(
2679 $settings['premium_modal_box_button_icon_selection_updated'],
2680 $this->get_render_attribute_string( 'icon' )
2681 );
2682
2683 else :
2684 ?>
2685 <div <?php $this->print_render_attribute_string( 'icon' ); ?>>
2686 <?php echo Helper_Functions::sanitize_svg( $this->get_settings_for_display( 'custom_svg' ) ); ?>
2687 </div>
2688 <?php
2689 endif;
2690 endif;
2691 ?>
2692
2693 <div class="premium-button-text-icon-wrapper">
2694 <span><?php echo wp_kses_post( $settings['premium_modal_box_button_text'] ); ?></span>
2695 </div>
2696
2697 <?php
2698 if ( 'yes' === $settings['premium_modal_box_icon_switcher'] && 'after' === $settings['premium_modal_box_icon_position'] ) :
2699 if ( 'icon' === $icon_type ) :
2700
2701 echo Helper_Functions::get_svg_by_icon(
2702 $settings['premium_modal_box_button_icon_selection_updated'],
2703 $this->get_render_attribute_string( 'icon' )
2704 );
2705
2706 else :
2707 ?>
2708 <div <?php $this->print_render_attribute_string( 'icon' ); ?>>
2709 <?php echo Helper_Functions::sanitize_svg( $this->get_settings_for_display( 'custom_svg' ) ); ?>
2710 </div>
2711 <?php
2712 endif;
2713 endif;
2714 ?>
2715
2716 <?php if ( 'style6' === $settings['premium_button_hover_effect'] && 'yes' === $settings['mouse_detect'] ) : ?>
2717 <span class="premium-button-style6-bg"></span>
2718 <?php endif; ?>
2719
2720 <?php if ( 'style8' === $settings['premium_button_hover_effect'] ) : ?>
2721 <?php echo Helper_Functions::get_btn_svgs( $settings['underline_style'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
2722 <?php endif; ?>
2723
2724 </button>
2725 <?php elseif ( 'image' === $trigger ) : ?>
2726 <img <?php $this->print_render_attribute_string( 'trigger' ); ?>>
2727 <?php elseif ( 'text' === $trigger ) : ?>
2728 <span <?php $this->print_render_attribute_string( 'trigger' ); ?>>
2729 <div <?php $this->print_render_attribute_string( 'premium_modal_box_selector_text' ); ?>>
2730 <?php echo wp_kses_post( $settings['premium_modal_box_selector_text'] ); ?>
2731 </div>
2732 </span>
2733 <?php elseif ( 'animation' === $trigger ) : ?>
2734 <div <?php $this->print_render_attribute_string( 'trigger' ); ?>></div>
2735 <?php endif; ?>
2736 </div>
2737
2738 <div id="premium-modal-<?php echo esc_attr( $this->get_id() ); ?>" class="premium-modal-box-modal"
2739 role="dialog"
2740 style="display: none"
2741 >
2742 <div <?php $this->print_render_attribute_string( 'dialog' ); ?>>
2743 <?php if ( 'yes' === $settings['premium_modal_box_header_switcher'] ) : ?>
2744 <div class="premium-modal-box-modal-header">
2745 <?php if ( ! empty( $settings['premium_modal_box_title'] ) ) : ?>
2746 <h3 class="premium-modal-box-modal-title">
2747 <?php
2748 $this->render_header_icon( $header_new, $header_migrated );
2749 echo wp_kses_post( $settings['premium_modal_box_title'] );
2750 ?>
2751 </h3>
2752 <?php endif; ?>
2753 <?php if ( 'yes' === $settings['premium_modal_box_upper_close'] ) : ?>
2754 <div class="premium-modal-box-close-button-container">
2755 <button type="button" class="premium-modal-box-modal-close" data-dismiss="premium-modal">&times;</button>
2756 </div>
2757 <?php endif; ?>
2758 </div>
2759 <?php endif; ?>
2760 <div class="premium-modal-box-modal-body">
2761 <?php if ( 'editor' === $settings['premium_modal_box_content_type'] ) : ?>
2762 <?php
2763 echo $this->parse_text_editor( $settings['premium_modal_box_content'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2764 ?>
2765
2766 <?php elseif ( 'template' === $settings['premium_modal_box_content_type'] && ! empty( $template ) ) : ?>
2767
2768 <?php
2769 echo Helper_Functions::render_elementor_template( $template );
2770 ?>
2771
2772 <?php elseif ( 'id' === $settings['premium_modal_box_content_type'] && ! empty( $settings['container_id'] ) ) : ?>
2773 <div class="premium-modalbox-template"
2774 data-template-src="<?php echo esc_attr( $settings['container_id'] ); ?>">
2775 </div>
2776
2777 <?php endif; ?>
2778 </div>
2779 <?php if ( 'yes' === $settings['premium_modal_box_lower_close'] ) : ?>
2780 <div class="premium-modal-box-modal-footer">
2781 <button type="button" class="premium-modal-box-modal-lower-close" data-dismiss="premium-modal">
2782 <?php echo wp_kses_post( $settings['premium_modal_close_text'] ); ?>
2783 </button>
2784 </div>
2785 <?php endif; ?>
2786 </div>
2787 </div>
2788 </div>
2789 <?php
2790 }
2791 }
2792