PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.11.53
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.11.53
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 6 months ago premium-banner.php 6 months ago premium-blog.php 6 months ago premium-button.php 6 months ago premium-carousel.php 6 months ago premium-contactform.php 6 months ago premium-countdown.php 6 months ago premium-counter.php 6 months ago premium-dual-header.php 6 months ago premium-fancytext.php 6 months ago premium-grid.php 6 months ago premium-icon-list.php 6 months ago premium-image-button.php 6 months ago premium-image-scroll.php 6 months ago premium-image-separator.php 6 months ago premium-lottie.php 6 months ago premium-maps.php 6 months ago premium-media-wheel.php 6 months ago premium-mobile-menu.php 6 months ago premium-modalbox.php 6 months ago premium-nav-menu.php 6 months ago premium-notifications.php 6 months ago premium-person.php 6 months ago premium-pinterest-feed.php 6 months ago premium-post-ticker.php 6 months ago premium-pricing-table.php 6 months ago premium-progressbar.php 6 months ago premium-search-form.php 6 months ago premium-svg-drawer.php 6 months ago premium-tcloud.php 6 months ago premium-testimonials.php 6 months ago premium-textual-showcase.php 6 months ago premium-tiktok-feed.php 6 months ago premium-title.php 6 months ago premium-videobox.php 6 months ago premium-vscroll.php 6 months ago premium-weather.php 6 months ago premium-world-clock.php 6 months ago
premium-modalbox.php
2719 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 array_push( $scripts, 'pa-tweenmax', 'pa-motionpath' );
148 }
149
150 if ( 'animation' === $settings['premium_modal_box_icon_selection'] || 'animation' === $settings['premium_modal_box_display_on'] ) {
151 $scripts[] = 'lottie-js';
152 }
153
154 if ( 'none' !== $settings['body_lq_effect'] ) {
155 $scripts[] = 'pa-glass';
156 }
157 }
158
159 $scripts[] = 'premium-addons';
160
161 return $scripts;
162 }
163
164 /**
165 * Retrieve Widget Keywords.
166 *
167 * @since 1.0.0
168 * @access public
169 *
170 * @return string Widget keywords.
171 */
172 public function get_keywords() {
173 return array( 'pa', 'premium', 'premium modal box', 'popup', 'lightbox', 'advanced', 'embed' );
174 }
175
176
177 /**
178 * Dynamic Content.
179 *
180 * @since 4.9.26
181 * @access protected
182 * @return bool
183 */
184 protected function is_dynamic_content(): bool {
185 return false;
186 }
187
188 /**
189 * Retrieve Widget Categories.
190 *
191 * @since 1.5.1
192 * @access public
193 *
194 * @return array Widget categories.
195 */
196 public function get_categories() {
197 return array( 'premium-elements' );
198 }
199
200 /**
201 * Retrieve Widget Support URL.
202 *
203 * @access public
204 *
205 * @return string support URL.
206 */
207 public function get_custom_help_url() {
208 return 'https://premiumaddons.com/support/';
209 }
210
211
212 /**
213 * Has Widget Inner Wrapper.
214 *
215 * @access public
216 *
217 * @return bool
218 */
219 public function has_widget_inner_wrapper(): bool {
220 return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' );
221 }
222
223 /**
224 * Register Modal Box controls.
225 *
226 * @since 1.0.0
227 * @access protected
228 */
229 protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
230
231 $draw_icon = $this->check_icon_draw();
232
233 $this->start_controls_section(
234 'premium_modal_box_content_section',
235 array(
236 'label' => __( 'Trigger', 'premium-addons-for-elementor' ),
237 )
238 );
239
240 $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/modal-box-widget-for-elementor-page-builder/', 'modal-box', 'wp-editor', 'demo' );
241 Helper_Functions::add_templates_controls( $this, 'modal-box', $demo );
242
243 $this->add_control(
244 'premium_modal_box_display_on',
245 array(
246 'label' => __( 'Trigger', 'premium-addons-for-elementor' ),
247 'type' => Controls_Manager::SELECT,
248 'description' => __( 'Choose where would you like the modal box appear on', 'premium-addons-for-elementor' ),
249 'options' => array(
250 'button' => __( 'Button', 'premium-addons-for-elementor' ),
251 'image' => __( 'Image', 'premium-addons-for-elementor' ),
252 'text' => __( 'Text', 'premium-addons-for-elementor' ),
253 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
254 'pageload' => __( 'On Page Load', 'premium-addons-for-elementor' ),
255 'exit' => apply_filters( 'pa_pro_label', __( 'On Page Exit Intent (Pro)', 'premium-addons-for-elementor' ) ),
256 ),
257 'label_block' => true,
258 'default' => 'button',
259 )
260 );
261
262 $this->add_control(
263 'show_again_exit',
264 array(
265 'label' => apply_filters( 'pa_pro_label', __( 'Show Again on Page Exit (Pro)', 'premium-addons-for-elementor' ) ),
266 'type' => Controls_Manager::SWITCHER,
267 'condition' => array(
268 'premium_modal_box_display_on!' => 'exit',
269 ),
270 )
271 );
272
273 $this->add_control(
274 'page_exit_notice',
275 array(
276 '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' ),
277 'type' => Controls_Manager::RAW_HTML,
278 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
279 'conditions' => array(
280 'relation' => 'or',
281 'terms' => array(
282 array(
283 'name' => 'premium_modal_box_display_on',
284 'value' => 'exit',
285 ),
286 array(
287 'name' => 'show_again_exit',
288 'value' => 'yes',
289 ),
290 ),
291 ),
292 )
293 );
294
295 $this->add_control(
296 'premium_modal_box_button_text',
297 array(
298 'label' => __( 'Button Text', 'premium-addons-for-elementor' ),
299 'default' => __( 'Premium Addons', 'premium-addons-for-elementor' ),
300 'type' => Controls_Manager::TEXT,
301 'dynamic' => array( 'active' => true ),
302 'label_block' => true,
303 'condition' => array(
304 'premium_modal_box_display_on' => 'button',
305 ),
306 )
307 );
308
309 $this->add_control(
310 'premium_modal_box_icon_switcher',
311 array(
312 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
313 'type' => Controls_Manager::SWITCHER,
314 'condition' => array(
315 'premium_modal_box_display_on' => 'button',
316 ),
317 'description' => __( 'Enable or disable button icon', 'premium-addons-for-elementor' ),
318 )
319 );
320
321 $this->add_control(
322 'icon_type',
323 array(
324 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
325 'type' => Controls_Manager::SELECT,
326 'options' => array(
327 'icon' => __( 'Font Awesome Icon', 'premium-addons-for-elementor' ),
328 'svg' => __( 'SVG Code', 'premium-addons-for-elementor' ),
329 ),
330 'default' => 'icon',
331 'condition' => array(
332 'premium_modal_box_icon_switcher' => 'yes',
333 'premium_modal_box_display_on' => 'button',
334 ),
335 )
336 );
337
338 $this->add_control(
339 'premium_modal_box_button_icon_selection_updated',
340 array(
341 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
342 'type' => Controls_Manager::ICONS,
343 'fa4compatibility' => 'premium_modal_box_button_icon_selection',
344 'default' => array(
345 'value' => 'fas fa-star',
346 'library' => 'fa-solid',
347 ),
348 'label_block' => true,
349 'condition' => array(
350 'premium_modal_box_display_on' => 'button',
351 'premium_modal_box_icon_switcher' => 'yes',
352 'icon_type' => 'icon',
353 ),
354 )
355 );
356
357 $this->add_control(
358 'custom_svg',
359 array(
360 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ),
361 'type' => Controls_Manager::TEXTAREA,
362 '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>',
363 'condition' => array(
364 'premium_modal_box_display_on' => 'button',
365 'premium_modal_box_icon_switcher' => 'yes',
366 'icon_type' => 'svg',
367 ),
368 )
369 );
370
371 $common_conditions = array(
372 'premium_modal_box_display_on' => 'button',
373 'premium_modal_box_icon_switcher' => 'yes',
374 );
375
376 $this->add_control(
377 'draw_svg',
378 array(
379 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ),
380 'type' => Controls_Manager::SWITCHER,
381 '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>',
382 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled',
383 'condition' => array_merge(
384 $common_conditions,
385 array(
386 'icon_type' => array( 'icon', 'svg' ),
387 'premium_modal_box_button_icon_selection_updated[library]!' => 'svg',
388 )
389 ),
390 )
391 );
392
393 if ( $draw_icon ) {
394 $this->add_control(
395 'path_width',
396 array(
397 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ),
398 'type' => Controls_Manager::SLIDER,
399 'range' => array(
400 'px' => array(
401 'min' => 0,
402 'max' => 50,
403 'step' => 0.1,
404 ),
405 ),
406 'condition' => array_merge(
407 $common_conditions,
408 array(
409 'icon_type' => array( 'icon', 'svg' ),
410 )
411 ),
412 'selectors' => array(
413 '{{WRAPPER}} .premium-modal-trigger-btn svg:not(.premium-btn-svg) *' => 'stroke-width: {{SIZE}}',
414 ),
415 )
416 );
417
418 $this->add_control(
419 'svg_sync',
420 array(
421 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ),
422 'type' => Controls_Manager::SWITCHER,
423 'condition' => array_merge(
424 $common_conditions,
425 array(
426 'icon_type' => array( 'icon', 'svg' ),
427 'draw_svg' => 'yes',
428 )
429 ),
430 )
431 );
432
433 $this->add_control(
434 'frames',
435 array(
436 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
437 'type' => Controls_Manager::NUMBER,
438 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ),
439 'default' => 5,
440 'min' => 1,
441 'max' => 100,
442 'condition' => array_merge(
443 $common_conditions,
444 array(
445 'icon_type' => array( 'icon', 'svg' ),
446 'draw_svg' => 'yes',
447 )
448 ),
449 )
450 );
451
452 $this->add_control(
453 'svg_loop',
454 array(
455 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
456 'type' => Controls_Manager::SWITCHER,
457 'return_value' => 'true',
458 'default' => 'true',
459 'condition' => array_merge(
460 $common_conditions,
461 array(
462 'icon_type' => array( 'icon', 'svg' ),
463 'draw_svg' => 'yes',
464 )
465 ),
466 )
467 );
468
469 $this->add_control(
470 'svg_reverse',
471 array(
472 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
473 'type' => Controls_Manager::SWITCHER,
474 'return_value' => 'true',
475 'condition' => array_merge(
476 $common_conditions,
477 array(
478 'icon_type' => array( 'icon', 'svg' ),
479 'draw_svg' => 'yes',
480 )
481 ),
482 )
483 );
484
485 $this->add_control(
486 'start_point',
487 array(
488 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ),
489 'type' => Controls_Manager::SLIDER,
490 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ),
491 'default' => array(
492 'unit' => '%',
493 'size' => 0,
494 ),
495 'condition' => array_merge(
496 $common_conditions,
497 array(
498 'icon_type' => array( 'icon', 'svg' ),
499 'draw_svg' => 'yes',
500 'svg_reverse!' => 'true',
501 )
502 ),
503 )
504 );
505
506 $this->add_control(
507 'end_point',
508 array(
509 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ),
510 'type' => Controls_Manager::SLIDER,
511 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ),
512 'default' => array(
513 'unit' => '%',
514 'size' => 0,
515 ),
516 'condition' => array_merge(
517 $common_conditions,
518 array(
519 'icon_type' => array( 'icon', 'svg' ),
520 'draw_svg' => 'yes',
521 'svg_reverse' => 'true',
522 )
523 ),
524
525 )
526 );
527
528 $this->add_control(
529 'svg_hover',
530 array(
531 'label' => __( 'Only Play on Hover', 'premium-addons-for-elementor' ),
532 'type' => Controls_Manager::SWITCHER,
533 'return_value' => 'true',
534 'condition' => array_merge(
535 $common_conditions,
536 array(
537 'icon_type' => array( 'icon', 'svg' ),
538 'draw_svg' => 'yes',
539 )
540 ),
541 )
542 );
543
544 $this->add_control(
545 'svg_yoyo',
546 array(
547 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ),
548 'type' => Controls_Manager::SWITCHER,
549 'condition' => array_merge(
550 $common_conditions,
551 array(
552 'icon_type' => array( 'icon', 'svg' ),
553 'draw_svg' => 'yes',
554 'svg_loop' => 'true',
555 )
556 ),
557 )
558 );
559 } else {
560
561 Helper_Functions::get_draw_svg_notice(
562 $this,
563 'modal',
564 array_merge(
565 $common_conditions,
566 array(
567 'icon_type' => array( 'icon', 'svg' ),
568 'premium_modal_box_button_icon_selection_updated[library]!' => 'svg',
569 )
570 )
571 );
572
573 }
574
575 $this->add_control(
576 'premium_modal_box_icon_position',
577 array(
578 'label' => __( 'Icon Position', 'premium-addons-for-elementor' ),
579 'type' => Controls_Manager::SELECT,
580 'default' => 'before',
581 'options' => array(
582 'before' => __( 'Before', 'premium-addons-for-elementor' ),
583 'after' => __( 'After', 'premium-addons-for-elementor' ),
584 ),
585 'label_block' => true,
586 'condition' => array(
587 'premium_modal_box_display_on' => 'button',
588 'premium_modal_box_icon_switcher' => 'yes',
589 ),
590 )
591 );
592
593 $this->add_control(
594 'premium_modal_box_icon_before_size',
595 array(
596 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ),
597 'type' => Controls_Manager::SLIDER,
598 'selectors' => array(
599 '{{WRAPPER}} .premium-modal-trigger-btn i' => 'font-size: {{SIZE}}px',
600 '{{WRAPPER}} .premium-modal-trigger-btn svg' => 'width: {{SIZE}}px !important; height: {{SIZE}}px !important',
601 ),
602 'condition' => array(
603 'premium_modal_box_display_on' => 'button',
604 'icon_type' => 'icon',
605 'premium_modal_box_icon_switcher' => 'yes',
606 ),
607 )
608 );
609
610 $this->add_responsive_control(
611 'svg_icon_width',
612 array(
613 'label' => __( 'Icon Width', 'premium-addons-for-elementor' ),
614 'type' => Controls_Manager::SLIDER,
615 'size_units' => array( 'px', 'em', '%' ),
616 'range' => array(
617 'px' => array(
618 'min' => 1,
619 'max' => 600,
620 ),
621 'em' => array(
622 'min' => 1,
623 'max' => 30,
624 ),
625 ),
626 'default' => array(
627 'size' => 100,
628 'unit' => 'px',
629 ),
630 'condition' => array(
631 'premium_modal_box_display_on' => 'button',
632 'premium_modal_box_icon_switcher' => 'yes',
633 'icon_type' => 'svg',
634 ),
635 'selectors' => array(
636 '{{WRAPPER}} .premium-modal-trigger-btn svg' => 'width: {{SIZE}}{{UNIT}};',
637 ),
638 )
639 );
640
641 $this->add_responsive_control(
642 'svg_icon_height',
643 array(
644 'label' => __( 'Icon Height', 'premium-addons-for-elementor' ),
645 'type' => Controls_Manager::SLIDER,
646 'size_units' => array( 'px', 'em' ),
647 'range' => array(
648 'px' => array(
649 'min' => 1,
650 'max' => 300,
651 ),
652 'em' => array(
653 'min' => 1,
654 'max' => 30,
655 ),
656 ),
657 'condition' => array(
658 'premium_modal_box_display_on' => 'button',
659 'premium_modal_box_icon_switcher' => 'yes',
660 'icon_type' => 'svg',
661 ),
662 'selectors' => array(
663 '{{WRAPPER}} .premium-modal-trigger-btn svg' => 'height: {{SIZE}}{{UNIT}}',
664 ),
665 )
666 );
667
668 if ( ! $this->check_rtl() ) {
669 $this->add_control(
670 'premium_modal_box_icon_before_spacing',
671 array(
672 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ),
673 'type' => Controls_Manager::SLIDER,
674 'condition' => array(
675 'premium_modal_box_display_on' => 'button',
676 'premium_modal_box_icon_switcher' => 'yes',
677 'premium_modal_box_icon_position' => 'before',
678 ),
679 'default' => array(
680 'size' => 15,
681 ),
682 'selectors' => array(
683 '{{WRAPPER}} .premium-modal-trigger-btn i, {{WRAPPER}} .premium-modal-trigger-btn svg' => 'margin-right: {{SIZE}}px',
684 ),
685 'separator' => 'after',
686 )
687 );
688
689 $this->add_control(
690 'premium_modal_box_icon_after_spacing',
691 array(
692 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ),
693 'type' => Controls_Manager::SLIDER,
694 'default' => array(
695 'size' => 15,
696 ),
697 'selectors' => array(
698 '{{WRAPPER}} .premium-modal-trigger-btn i, {{WRAPPER}} .premium-modal-trigger-btn svg' => 'margin-left: {{SIZE}}px',
699 ),
700 'separator' => 'after',
701 'condition' => array(
702 'premium_modal_box_display_on' => 'button',
703 'premium_modal_box_icon_switcher' => 'yes',
704 'premium_modal_box_icon_position' => 'after',
705 ),
706 )
707 );
708 }
709
710 if ( $this->check_rtl() ) {
711 $this->add_control(
712 'premium_modal_box_icon_rtl_before_spacing',
713 array(
714 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ),
715 'type' => Controls_Manager::SLIDER,
716 'condition' => array(
717 'premium_modal_box_display_on' => 'button',
718 'premium_modal_box_icon_switcher' => 'yes',
719 'premium_modal_box_icon_position' => 'before',
720 ),
721 'default' => array(
722 'size' => 15,
723 ),
724 'selectors' => array(
725 '{{WRAPPER}} .premium-modal-trigger-btn i, {{WRAPPER}} .premium-modal-trigger-btn svg' => 'margin-left: {{SIZE}}px',
726 ),
727 'separator' => 'after',
728 )
729 );
730
731 $this->add_control(
732 'premium_modal_box_icon_rtl_after_spacing',
733 array(
734 'label' => __( 'Icon Spacing', 'premium-addons-for-elementor' ),
735 'type' => Controls_Manager::SLIDER,
736 'default' => array(
737 'size' => 15,
738 ),
739 'selectors' => array(
740 '{{WRAPPER}} .premium-modal-trigger-btn i, {{WRAPPER}} .premium-modal-trigger-btn svg' => 'margin-right: {{SIZE}}px',
741 ),
742 'separator' => 'after',
743 'condition' => array(
744 'premium_modal_box_display_on' => 'button',
745 'premium_modal_box_icon_switcher' => 'yes',
746 'premium_modal_box_icon_position' => 'after',
747 ),
748 )
749 );
750 }
751
752 Helper_Functions::add_btn_hover_controls( $this, array( 'premium_modal_box_display_on' => 'button' ) );
753
754 $this->add_control(
755 'premium_modal_box_button_size',
756 array(
757 'label' => __( 'Button Size', 'premium-addons-for-elementor' ),
758 'type' => Controls_Manager::SELECT,
759 'options' => array(
760 'sm' => __( 'Small', 'premium-addons-for-elementor' ),
761 'md' => __( 'Medium', 'premium-addons-for-elementor' ),
762 'lg' => __( 'Large', 'premium-addons-for-elementor' ),
763 'block' => __( 'Block', 'premium-addons-for-elementor' ),
764 ),
765 'label_block' => true,
766 'default' => 'lg',
767 'condition' => array(
768 'premium_modal_box_display_on' => 'button',
769 ),
770 )
771 );
772
773 $this->add_control(
774 'premium_modal_box_image_src',
775 array(
776 'label' => __( 'Image', 'premium-addons-for-elementor' ),
777 'type' => Controls_Manager::MEDIA,
778 'dynamic' => array( 'active' => true ),
779 'default' => array(
780 'url' => Utils::get_placeholder_image_src(),
781 ),
782 'label_block' => true,
783 'condition' => array(
784 'premium_modal_box_display_on' => 'image',
785 ),
786 )
787 );
788
789 $this->add_control(
790 'premium_modal_box_selector_text',
791 array(
792 'label' => __( 'Text', 'premium-addons-for-elementor' ),
793 'type' => Controls_Manager::TEXT,
794 'dynamic' => array( 'active' => true ),
795 'label_block' => true,
796 'default' => __( 'Premium Addons', 'premium-addons-for-elementor' ),
797 'condition' => array(
798 'premium_modal_box_display_on' => 'text',
799 ),
800 )
801 );
802
803 $this->add_control(
804 'lottie_url',
805 array(
806 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
807 'type' => Controls_Manager::TEXT,
808 'dynamic' => array( 'active' => true ),
809 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
810 'label_block' => true,
811 'condition' => array(
812 'premium_modal_box_display_on' => 'animation',
813 ),
814 )
815 );
816
817 $this->add_control(
818 'lottie_loop',
819 array(
820 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
821 'type' => Controls_Manager::SWITCHER,
822 'return_value' => 'true',
823 'default' => 'true',
824 'condition' => array(
825 'premium_modal_box_display_on' => 'animation',
826 ),
827 )
828 );
829
830 $this->add_control(
831 'lottie_reverse',
832 array(
833 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
834 'type' => Controls_Manager::SWITCHER,
835 'return_value' => 'true',
836 'condition' => array(
837 'premium_modal_box_display_on' => 'animation',
838 ),
839 )
840 );
841
842 $this->add_control(
843 'lottie_hover',
844 array(
845 'label' => __( 'Only Play on Hover', 'premium-addons-for-elementor' ),
846 'type' => Controls_Manager::SWITCHER,
847 'return_value' => 'true',
848 'condition' => array(
849 'premium_modal_box_display_on' => 'animation',
850 ),
851 )
852 );
853
854 $this->add_responsive_control(
855 'trigger_image_animation_size',
856 array(
857 'label' => __( 'Size', 'premium-addons-for-elementor' ),
858 'type' => Controls_Manager::SLIDER,
859 'size_units' => array( 'px', 'em', '%' ),
860 'range' => array(
861 'px' => array(
862 'min' => 1,
863 'max' => 800,
864 ),
865 'em' => array(
866 'min' => 1,
867 'max' => 30,
868 ),
869 ),
870 'selectors' => array(
871 '{{WRAPPER}} .premium-modal-trigger-img, {{WRAPPER}} .premium-modal-trigger-animation svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important',
872 ),
873 'condition' => array(
874 'premium_modal_box_display_on' => array( 'image', 'animation' ),
875 ),
876 )
877 );
878
879 $this->add_control(
880 'premium_modal_box_popup_delay',
881 array(
882 'label' => __( 'Delay in Popup Display (Sec)', 'premium-addons-for-elementor' ),
883 'type' => Controls_Manager::NUMBER,
884 'description' => __( 'When should the popup appear during page load? The value is counted in seconds', 'premium-addons-for-elementor' ),
885 'default' => 1,
886 'condition' => array(
887 'premium_modal_box_display_on' => 'pageload',
888 ),
889 )
890 );
891
892 $this->add_responsive_control(
893 'premium_modal_box_selector_align',
894 array(
895 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
896 'type' => Controls_Manager::CHOOSE,
897 'options' => array(
898 'left' => array(
899 'title' => __( 'Left', 'premium-addons-for-elementor' ),
900 'icon' => 'eicon-text-align-left',
901 ),
902 'center' => array(
903 'title' => __( 'Center', 'premium-addons-for-elementor' ),
904 'icon' => 'eicon-text-align-center',
905 ),
906 'right' => array(
907 'title' => __( 'Right', 'premium-addons-for-elementor' ),
908 'icon' => 'eicon-text-align-right',
909 ),
910 ),
911 'toggle' => false,
912 'default' => 'center',
913 'selectors' => array(
914 '{{WRAPPER}} .premium-modal-trigger-container' => 'text-align: {{VALUE}};',
915 ),
916 'conditions' => array(
917 'relation' => 'or',
918 'terms' => array(
919 array(
920 'terms' => array(
921 array(
922 'name' => 'premium_modal_box_display_on',
923 'operator' => '!=',
924 'value' => 'button',
925 ),
926 array(
927 'name' => 'premium_modal_box_display_on',
928 'operator' => '!=',
929 'value' => 'pageload',
930 ),
931 array(
932 'name' => 'premium_modal_box_display_on',
933 'operator' => '!=',
934 'value' => 'exit',
935 ),
936 ),
937 ),
938 array(
939 'relation' => 'and',
940 'terms' => array(
941 array(
942 'name' => 'premium_modal_box_display_on',
943 'value' => 'button',
944 ),
945 array(
946 'name' => 'premium_modal_box_button_size',
947 'operator' => '!=',
948 'value' => 'block',
949 ),
950 ),
951 ),
952 ),
953 ),
954 )
955 );
956
957 $this->add_control(
958 'trigger_zindex',
959 array(
960 'label' => __( 'Trigger Z-Index', 'premium-addons-for-elementor' ),
961 'type' => Controls_Manager::NUMBER,
962 'condition' => array(
963 'premium_modal_box_display_on!' => array( 'pageload', 'exit' ),
964 ),
965 'selectors' => array(
966 '{{WRAPPER}} .premium-modal-trigger-container' => 'position:relative; z-index: {{VALUE}};',
967 ),
968 )
969 );
970
971 $this->end_controls_section();
972
973 $this->start_controls_section(
974 'premium_modal_box_selector_content_section',
975 array(
976 'label' => __( 'Content', 'premium-addons-for-elementor' ),
977 )
978 );
979
980 $this->add_control(
981 'premium_modal_box_header_switcher',
982 array(
983 'label' => __( 'Header', 'premium-addons-for-elementor' ),
984 'type' => Controls_Manager::SWITCHER,
985 'label_on' => 'show',
986 'label_off' => 'hide',
987 'default' => 'yes',
988 'description' => __( 'Enable or disable modal header', 'premium-addons-for-elementor' ),
989 )
990 );
991
992 $this->add_control(
993 'premium_modal_box_icon_selection',
994 array(
995 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
996 'type' => Controls_Manager::SELECT,
997 'options' => array(
998 'noicon' => __( 'None', 'premium-addons-for-elementor' ),
999 'fonticon' => __( 'Icon', 'premium-addons-for-elementor' ),
1000 'image' => __( 'Custom Image', 'premium-addons-for-elementor' ),
1001 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
1002 ),
1003 'default' => 'noicon',
1004 'condition' => array(
1005 'premium_modal_box_header_switcher' => 'yes',
1006 ),
1007 'label_block' => true,
1008 )
1009 );
1010
1011 $this->add_control(
1012 'premium_modal_box_font_icon_updated',
1013 array(
1014 'label' => __( 'Select Icon', 'premium-addons-for-elementor' ),
1015 'type' => Controls_Manager::ICONS,
1016 'fa4compatibility' => 'premium_modal_box_font_icon',
1017 'condition' => array(
1018 'premium_modal_box_icon_selection' => 'fonticon',
1019 'premium_modal_box_header_switcher' => 'yes',
1020 ),
1021 'label_block' => true,
1022 )
1023 );
1024
1025 $this->add_control(
1026 'premium_modal_box_image_icon',
1027 array(
1028 'label' => __( 'Upload Image', 'premium-addons-for-elementor' ),
1029 'type' => Controls_Manager::MEDIA,
1030 'dynamic' => array( 'active' => true ),
1031 'default' => array(
1032 'url' => Utils::get_placeholder_image_src(),
1033 ),
1034 'condition' => array(
1035 'premium_modal_box_icon_selection' => 'image',
1036 'premium_modal_box_header_switcher' => 'yes',
1037 ),
1038 'label_block' => true,
1039 )
1040 );
1041
1042 $this->add_control(
1043 'header_lottie_url',
1044 array(
1045 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
1046 'type' => Controls_Manager::TEXT,
1047 'dynamic' => array( 'active' => true ),
1048 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
1049 'label_block' => true,
1050 'condition' => array(
1051 'premium_modal_box_icon_selection' => 'animation',
1052 'premium_modal_box_header_switcher' => 'yes',
1053 ),
1054 )
1055 );
1056
1057 $this->add_control(
1058 'header_lottie_loop',
1059 array(
1060 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
1061 'type' => Controls_Manager::SWITCHER,
1062 'return_value' => 'true',
1063 'default' => 'true',
1064 'condition' => array(
1065 'premium_modal_box_icon_selection' => 'animation',
1066 'premium_modal_box_header_switcher' => 'yes',
1067 ),
1068 )
1069 );
1070
1071 $this->add_control(
1072 'header_lottie_reverse',
1073 array(
1074 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
1075 'type' => Controls_Manager::SWITCHER,
1076 'return_value' => 'true',
1077 'condition' => array(
1078 'premium_modal_box_icon_selection' => 'animation',
1079 'premium_modal_box_header_switcher' => 'yes',
1080 ),
1081 )
1082 );
1083
1084 $this->add_responsive_control(
1085 'premium_modal_box_font_icon_size',
1086 array(
1087 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ),
1088 'type' => Controls_Manager::SLIDER,
1089 'size_units' => array( 'px', 'em' ),
1090 'selectors' => array(
1091 '{{WRAPPER}} .premium-modal-box-modal-title i' => 'font-size: {{SIZE}}{{UNIT}}',
1092 '{{WRAPPER}} .premium-modal-box-modal-title img' => 'width: {{SIZE}}{{UNIT}}',
1093 '{{WRAPPER}} .premium-modal-box-modal-title svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important',
1094 ),
1095 'condition' => array(
1096 'premium_modal_box_icon_selection!' => 'noicon',
1097 'premium_modal_box_header_switcher' => 'yes',
1098 ),
1099 )
1100 );
1101
1102 $this->add_control(
1103 'premium_modal_box_title',
1104 array(
1105 'label' => __( 'Title', 'premium-addons-for-elementor' ),
1106 'type' => Controls_Manager::TEXT,
1107 'dynamic' => array( 'active' => true ),
1108 'description' => __( 'Add a title for the modal box', 'premium-addons-for-elementor' ),
1109 'default' => 'Modal Box Title',
1110 'condition' => array(
1111 'premium_modal_box_header_switcher' => 'yes',
1112 ),
1113 'label_block' => true,
1114 )
1115 );
1116
1117 $this->add_control(
1118 'premium_modal_box_content_type',
1119 array(
1120 'label' => __( 'Content to Show', 'premium-addons-for-elementor' ),
1121 'type' => Controls_Manager::SELECT,
1122 'options' => array(
1123 'editor' => __( 'Text Editor', 'premium-addons-for-elementor' ),
1124 'template' => __( 'Elementor Template', 'premium-addons-for-elementor' ),
1125 ),
1126 'default' => 'editor',
1127 'separator' => 'before',
1128 'label_block' => true,
1129 )
1130 );
1131
1132 $this->add_control(
1133 'live_temp_content',
1134 array(
1135 'label' => __( 'Template Title', 'premium-addons-for-elementor' ),
1136 'type' => Controls_Manager::TEXT,
1137 'classes' => 'premium-live-temp-title control-hidden',
1138 'label_block' => true,
1139 'condition' => array(
1140 'premium_modal_box_content_type' => 'template',
1141 ),
1142 )
1143 );
1144
1145 $this->add_control(
1146 'modal_temp_live_btn',
1147 array(
1148 'type' => Controls_Manager::BUTTON,
1149 'label_block' => true,
1150 'button_type' => 'default papro-btn-block',
1151 'text' => __( 'Create / Edit Template', 'premium-addons-for-elementor' ),
1152 'event' => 'createLiveTemp',
1153 'condition' => array(
1154 'premium_modal_box_content_type' => 'template',
1155 ),
1156 )
1157 );
1158
1159 $this->add_control(
1160 'premium_modal_box_content_temp',
1161 array(
1162 'label' => __( 'Templates', 'premium-addons-for-elementor' ),
1163 'type' => Premium_Post_Filter::TYPE,
1164 'classes' => 'premium-live-temp-label',
1165 'label_block' => true,
1166 'multiple' => false,
1167 'source' => 'elementor_library',
1168 'condition' => array(
1169 'premium_modal_box_content_type' => 'template',
1170 ),
1171 )
1172 );
1173
1174 $this->add_control(
1175 'premium_modal_box_content',
1176 array(
1177 'type' => Controls_Manager::WYSIWYG,
1178 'default' => 'Modal Box Content',
1179 'selector' => '{{WRAPPER}} .premium-modal-box-modal-body',
1180 'dynamic' => array( 'active' => true ),
1181 'condition' => array(
1182 'premium_modal_box_content_type' => 'editor',
1183 ),
1184 'show_label' => false,
1185 )
1186 );
1187
1188 $this->add_control(
1189 'dismissible',
1190 array(
1191 'label' => __( 'Dismissible', 'premium-addons-for-elementor' ),
1192 'type' => Controls_Manager::SWITCHER,
1193 'prefix_class' => 'premium-modal-dismissible-',
1194 'default' => 'yes',
1195 'separator' => 'before',
1196 )
1197 );
1198
1199 $this->add_control(
1200 'premium_modal_box_upper_close',
1201 array(
1202 'label' => __( 'Upper Close Button', 'premium-addons-for-elementor' ),
1203 'type' => Controls_Manager::SWITCHER,
1204 'default' => 'yes',
1205 'condition' => array(
1206 'dismissible' => 'yes',
1207 'premium_modal_box_header_switcher' => 'yes',
1208 ),
1209 )
1210 );
1211
1212 $this->add_control(
1213 'premium_modal_box_lower_close',
1214 array(
1215 'label' => __( 'Lower Close Button', 'premium-addons-for-elementor' ),
1216 'type' => Controls_Manager::SWITCHER,
1217 'default' => 'yes',
1218 'condition' => array(
1219 'dismissible' => 'yes',
1220 ),
1221 )
1222 );
1223
1224 $this->add_control(
1225 'premium_modal_close_text',
1226 array(
1227 'label' => __( 'Text', 'premium-addons-for-elementor' ),
1228 'default' => __( 'Close', 'premium-addons-for-elementor' ),
1229 'type' => Controls_Manager::TEXT,
1230 'dynamic' => array( 'active' => true ),
1231 'label_block' => true,
1232 'condition' => array(
1233 'dismissible' => 'yes',
1234 'premium_modal_box_lower_close' => 'yes',
1235 ),
1236 )
1237 );
1238
1239 $this->add_control(
1240 'premium_modal_box_animation',
1241 array(
1242 'label' => __( 'Entrance Animation', 'premium-addons-for-elementor' ),
1243 'type' => Controls_Manager::ANIMATION,
1244 'default' => 'fadeInDown',
1245 'label_block' => true,
1246 'frontend_available' => true,
1247 'render_type' => 'template',
1248
1249 )
1250 );
1251
1252 $this->add_control(
1253 'premium_modal_box_animation_duration',
1254 array(
1255 'label' => __( 'Animation Duration', 'premium-addons-for-elementor' ),
1256 'type' => Controls_Manager::SELECT,
1257 'default' => 'fast',
1258 'options' => array(
1259 'slow' => __( 'Slow', 'premium-addons-for-elementor' ),
1260 '' => __( 'Normal', 'premium-addons-for-elementor' ),
1261 'fast' => __( 'Fast', 'premium-addons-for-elementor' ),
1262 ),
1263 'condition' => array(
1264 'premium_modal_box_animation!' => '',
1265 ),
1266 )
1267 );
1268
1269 $this->add_control(
1270 'premium_modal_box_animation_delay',
1271 array(
1272 'label' => __( 'Animation Delay', 'premium-addons-for-elementor' ) . ' (s)',
1273 'type' => Controls_Manager::NUMBER,
1274 'default' => '',
1275 'step' => 0.1,
1276 'condition' => array(
1277 'premium_modal_box_animation!' => '',
1278 ),
1279 'frontend_available' => true,
1280 )
1281 );
1282
1283 $this->end_controls_section();
1284
1285 $this->start_controls_section(
1286 'section_pa_docs',
1287 array(
1288 'label' => __( 'Help & Docs', 'premium-addons-for-elementor' ),
1289 )
1290 );
1291
1292 $docs = array(
1293 'https://premiumaddons.com/docs/modal-box-widget-tutorial/' => __( 'Getting started »', 'premium-addons-for-elementor' ),
1294 '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' ),
1295 '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' ),
1296 );
1297
1298 $doc_index = 1;
1299 foreach ( $docs as $url => $title ) {
1300
1301 $doc_url = Helper_Functions::get_campaign_link( $url, 'modal-widget', 'wp-editor', 'get-support' );
1302
1303 $this->add_control(
1304 'doc_' . $doc_index,
1305 array(
1306 'type' => Controls_Manager::RAW_HTML,
1307 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc_url, $title ),
1308 'content_classes' => 'editor-pa-doc',
1309 )
1310 );
1311
1312 ++$doc_index;
1313
1314 }
1315
1316 $this->end_controls_section();
1317
1318 $this->start_controls_section(
1319 'premium_modal_box_selector_style_section',
1320 array(
1321 'label' => __( 'Trigger', 'premium-addons-for-elementor' ),
1322 'tab' => Controls_Manager::TAB_STYLE,
1323 'condition' => array(
1324 'premium_modal_box_display_on!' => array( 'pageload', 'exit' ),
1325 ),
1326 )
1327 );
1328
1329 $this->add_group_control(
1330 Group_Control_Css_Filter::get_type(),
1331 array(
1332 'name' => 'trigger_css_filters',
1333 'selector' => '{{WRAPPER}} .premium-modal-trigger-animation',
1334 'condition' => array(
1335 'premium_modal_box_display_on' => 'animation',
1336 ),
1337 )
1338 );
1339
1340 $this->add_group_control(
1341 Group_Control_Css_Filter::get_type(),
1342 array(
1343 'name' => 'trigger_hover_css_filters',
1344 'label' => __( 'Hover CSS Filters', 'premium-addons-for-elementor' ),
1345 'selector' => '{{WRAPPER}} .premium-modal-trigger-animation:hover',
1346 'condition' => array(
1347 'premium_modal_box_display_on' => 'animation',
1348 ),
1349 )
1350 );
1351
1352 $this->add_group_control(
1353 Group_Control_Typography::get_type(),
1354 array(
1355 'name' => 'selectortext',
1356 'global' => array(
1357 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1358 ),
1359 'selector' => '{{WRAPPER}} .premium-modal-trigger-btn, {{WRAPPER}} .premium-modal-trigger-text',
1360 'condition' => array(
1361 'premium_modal_box_display_on' => array( 'button', 'text' ),
1362 ),
1363 )
1364 );
1365
1366 $this->add_control(
1367 'svg_color',
1368 array(
1369 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ),
1370 'type' => Controls_Manager::COLOR,
1371 'global' => false,
1372 'separator' => 'after',
1373 'condition' => array(
1374 'premium_modal_box_icon_switcher' => 'yes',
1375 'premium_modal_box_display_on' => 'button',
1376 'icon_type' => array( 'icon', 'svg' ),
1377 'draw_svg' => 'yes',
1378 ),
1379 )
1380 );
1381
1382 $this->start_controls_tabs( 'premium_modal_box_button_style' );
1383
1384 $this->start_controls_tab(
1385 'premium_modal_box_tab_selector_normal',
1386 array(
1387 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
1388 'condition' => array(
1389 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1390 ),
1391 )
1392 );
1393
1394 $this->add_control(
1395 'premium_modal_box_button_text_color',
1396 array(
1397 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1398 'type' => Controls_Manager::COLOR,
1399 'global' => array(
1400 'default' => Global_Colors::COLOR_SECONDARY,
1401 ),
1402 'selectors' => array(
1403 '{{WRAPPER}} .premium-modal-trigger-btn, {{WRAPPER}} .premium-modal-trigger-text' => 'color:{{VALUE}};',
1404 ),
1405 'condition' => array(
1406 'premium_modal_box_display_on' => array( 'button', 'text' ),
1407 ),
1408 )
1409 );
1410
1411 $this->add_control(
1412 'premium_modal_box_button_icon_color',
1413 array(
1414 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
1415 'type' => Controls_Manager::COLOR,
1416 'global' => array(
1417 'default' => Global_Colors::COLOR_SECONDARY,
1418 ),
1419 'selectors' => array(
1420 '{{WRAPPER}} .premium-modal-trigger-btn i' => 'color:{{VALUE}}',
1421 '{{WRAPPER}} .premium-modal-trigger-btn svg:not(.premium-btn-svg), {{WRAPPER}} .premium-modal-trigger-btn svg:not(.premium-btn-svg) *' => 'fill: {{VALUE}};',
1422 ),
1423 'condition' => array(
1424 'premium_modal_box_icon_switcher' => 'yes',
1425 'premium_modal_box_display_on' => 'button',
1426 ),
1427 )
1428 );
1429
1430 if ( $draw_icon ) {
1431 $this->add_control(
1432 'stroke_color',
1433 array(
1434 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1435 'type' => Controls_Manager::COLOR,
1436 'global' => array(
1437 'default' => Global_Colors::COLOR_ACCENT,
1438 ),
1439 'condition' => array(
1440 'premium_modal_box_icon_switcher' => 'yes',
1441 'premium_modal_box_display_on' => 'button',
1442 'icon_type' => array( 'icon', 'svg' ),
1443 ),
1444 'selectors' => array(
1445 '{{WRAPPER}} .premium-modal-trigger-btn svg:not(.premium-btn-svg) *' => 'stroke: {{VALUE}};',
1446 ),
1447 )
1448 );
1449 }
1450
1451 $this->add_control(
1452 'premium_modal_box_selector_background',
1453 array(
1454 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1455 'type' => Controls_Manager::COLOR,
1456 'global' => array(
1457 'default' => Global_Colors::COLOR_PRIMARY,
1458 ),
1459 'selectors' => array(
1460 '{{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}};',
1461 ),
1462 'condition' => array(
1463 'premium_modal_box_display_on' => 'button',
1464 ),
1465 )
1466 );
1467
1468 $this->add_group_control(
1469 Group_Control_Border::get_type(),
1470 array(
1471 'name' => 'selector_border',
1472 'selector' => '{{WRAPPER}} .premium-modal-trigger-btn,{{WRAPPER}} .premium-modal-trigger-text, {{WRAPPER}} .premium-modal-trigger-img',
1473 'condition' => array(
1474 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1475 ),
1476 )
1477 );
1478
1479 $this->add_control(
1480 'premium_modal_box_selector_border_radius',
1481 array(
1482 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1483 'type' => Controls_Manager::SLIDER,
1484 'size_units' => array( 'px', '%', 'em' ),
1485 'default' => array(
1486 'size' => 0,
1487 ),
1488 'selectors' => array(
1489 '{{WRAPPER}} .premium-modal-trigger-btn, {{WRAPPER}} .premium-modal-trigger-text, {{WRAPPER}} .premium-modal-trigger-img' => 'border-radius:{{SIZE}}{{UNIT}};',
1490 ),
1491 'condition' => array(
1492 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1493 ),
1494 )
1495 );
1496
1497 $this->add_group_control(
1498 Group_Control_Box_Shadow::get_type(),
1499 array(
1500 'label' => __( 'Shadow', 'premium-addons-for-elementor' ),
1501 'name' => 'premium_modal_box_selector_box_shadow',
1502 'selector' => '{{WRAPPER}} .premium-modal-trigger-btn, {{WRAPPER}} .premium-modal-trigger-img',
1503 'condition' => array(
1504 'premium_modal_box_display_on' => array( 'button', 'image' ),
1505 ),
1506 )
1507 );
1508
1509 $this->add_group_control(
1510 Group_Control_Text_Shadow::get_type(),
1511 array(
1512 'name' => 'premium_modal_box_selector_text_shadow',
1513 'selector' => '{{WRAPPER}} .premium-modal-trigger-text',
1514 'condition' => array(
1515 'premium_modal_box_display_on' => 'text',
1516 ),
1517 )
1518 );
1519
1520 $this->end_controls_tab();
1521
1522 $this->start_controls_tab(
1523 'premium_modal_box_tab_selector_hover',
1524 array(
1525 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
1526 'condition' => array(
1527 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1528 ),
1529 )
1530 );
1531
1532 $this->add_control(
1533 'premium_modal_box_button_text_color_hover',
1534 array(
1535 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1536 'type' => Controls_Manager::COLOR,
1537 'global' => array(
1538 'default' => Global_Colors::COLOR_PRIMARY,
1539 ),
1540 'selectors' => array(
1541 '{{WRAPPER}} .premium-modal-trigger-btn:hover, {{WRAPPER}} .premium-modal-trigger-text:hover, {{WRAPPER}} .premium-button-line6::after' => 'color:{{VALUE}};',
1542 ),
1543 'condition' => array(
1544 'premium_modal_box_display_on' => array( 'button', 'text' ),
1545 ),
1546 )
1547 );
1548
1549 $this->add_control(
1550 'premium_modal_box_button_icon_hover_color',
1551 array(
1552 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ),
1553 'type' => Controls_Manager::COLOR,
1554 'global' => array(
1555 'default' => Global_Colors::COLOR_PRIMARY,
1556 ),
1557 'selectors' => array(
1558 '{{WRAPPER}} .premium-modal-trigger-btn:hover i' => 'color: {{VALUE}}',
1559 '{{WRAPPER}} .premium-modal-trigger-btn:hover svg:not(.premium-btn-svg), {{WRAPPER}} .premium-modal-trigger-btn:hover svg:not(.premium-btn-svg) *' => 'fill: {{VALUE}};',
1560 ),
1561 'condition' => array(
1562 'premium_modal_box_icon_switcher' => 'yes',
1563 'premium_modal_box_display_on' => 'button',
1564 ),
1565 )
1566 );
1567
1568 if ( $draw_icon ) {
1569 $this->add_control(
1570 'stroke_color_hover',
1571 array(
1572 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1573 'type' => Controls_Manager::COLOR,
1574 'global' => array(
1575 'default' => Global_Colors::COLOR_ACCENT,
1576 ),
1577 'condition' => array(
1578 'premium_modal_box_icon_switcher' => 'yes',
1579 'premium_modal_box_display_on' => 'button',
1580 'icon_type' => array( 'icon', 'svg' ),
1581 ),
1582 'selectors' => array(
1583 '{{WRAPPER}} .premium-modal-trigger-btn:hover svg:not(.premium-btn-svg) *' => 'stroke: {{VALUE}};',
1584 ),
1585 )
1586 );
1587 }
1588
1589 $this->add_control(
1590 'underline_color',
1591 array(
1592 'label' => __( 'Line Color', 'premium-addons-for-elementor' ),
1593 'type' => Controls_Manager::COLOR,
1594 'global' => array(
1595 'default' => Global_Colors::COLOR_SECONDARY,
1596 ),
1597 'selectors' => array(
1598 '{{WRAPPER}} .premium-btn-svg' => 'stroke: {{VALUE}};',
1599 '{{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}};',
1600 ),
1601 'condition' => array(
1602 'premium_modal_box_display_on' => 'button',
1603 'premium_button_hover_effect' => 'style8',
1604 ),
1605 )
1606 );
1607
1608 $this->add_control(
1609 'first_layer_hover',
1610 array(
1611 'label' => __( 'Layer #1 Color', 'premium-addons-for-elementor' ),
1612 'type' => Controls_Manager::COLOR,
1613 'global' => array(
1614 'default' => Global_Colors::COLOR_SECONDARY,
1615 ),
1616 'selectors' => array(
1617 '{{WRAPPER}} .premium-button-style7 .premium-button-text-icon-wrapper:before' => 'background-color: {{VALUE}}',
1618 ),
1619 'condition' => array(
1620 'premium_modal_box_display_on' => 'button',
1621 'premium_button_hover_effect' => 'style7',
1622
1623 ),
1624 )
1625 );
1626
1627 $this->add_control(
1628 'second_layer_hover',
1629 array(
1630 'label' => __( 'Layer #2 Color', 'premium-addons-for-elementor' ),
1631 'type' => Controls_Manager::COLOR,
1632 'global' => array(
1633 'default' => Global_Colors::COLOR_TEXT,
1634 ),
1635 'selectors' => array(
1636 '{{WRAPPER}} .premium-button-style7 .premium-button-text-icon-wrapper:after' => 'background-color: {{VALUE}}',
1637 ),
1638 'condition' => array(
1639 'premium_modal_box_display_on' => 'button',
1640 'premium_button_hover_effect' => 'style7',
1641 ),
1642 )
1643 );
1644
1645 $this->add_control(
1646 'premium_modal_box_selector_hover_background',
1647 array(
1648 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1649 'type' => Controls_Manager::COLOR,
1650 'global' => array(
1651 'default' => Global_Colors::COLOR_TEXT,
1652 ),
1653 'selectors' => array(
1654 '{{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}};',
1655 ),
1656 'condition' => array(
1657 'premium_modal_box_display_on' => 'button',
1658 'premium_button_hover_effect!' => 'style7',
1659 ),
1660 )
1661 );
1662
1663 $this->add_group_control(
1664 Group_Control_Border::get_type(),
1665 array(
1666 'name' => 'selector_border_hover',
1667 'selector' => '{{WRAPPER}} .premium-modal-trigger-btn:hover,
1668 {{WRAPPER}} .premium-modal-trigger-text:hover, {{WRAPPER}} .premium-modal-trigger-img:hover',
1669 'condition' => array(
1670 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1671 ),
1672 )
1673 );
1674
1675 $this->add_control(
1676 'premium_modal_box_selector_border_radius_hover',
1677 array(
1678 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1679 'type' => Controls_Manager::SLIDER,
1680 'size_units' => array( 'px', '%', 'em' ),
1681 'selectors' => array(
1682 '{{WRAPPER}} .premium-modal-trigger-btn:hover,{{WRAPPER}} .premium-modal-trigger-text:hover, {{WRAPPER}} .premium-modal-trigger-img:hover' => 'border-radius:{{SIZE}}{{UNIT}};',
1683 ),
1684 'condition' => array(
1685 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1686 ),
1687 )
1688 );
1689
1690 $this->add_group_control(
1691 Group_Control_Box_Shadow::get_type(),
1692 array(
1693 'label' => __( 'Shadow', 'premium-addons-for-elementor' ),
1694 'name' => 'premium_modal_box_selector_box_shadow_hover',
1695 'selector' => '{{WRAPPER}} .premium-modal-trigger-btn:hover, {{WRAPPER}} .premium-modal-trigger-text:hover, {{WRAPPER}} .premium-modal-trigger-img:hover',
1696 'condition' => array(
1697 'premium_modal_box_display_on' => array( 'button', 'text', 'image' ),
1698 ),
1699 )
1700 );
1701
1702 $this->end_controls_tab();
1703
1704 $this->end_controls_tabs();
1705
1706 $this->add_responsive_control(
1707 'premium_modal_box_selector_padding',
1708 array(
1709 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1710 'type' => Controls_Manager::DIMENSIONS,
1711 'size_units' => array( 'px', 'em', '%' ),
1712 'separator' => 'before',
1713 'selectors' => array(
1714 '{{WRAPPER}} .premium-modal-trigger-btn, {{WRAPPER}} .premium-modal-trigger-text, {{WRAPPER}} .premium-button-line6::after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
1715 ),
1716 'condition' => array(
1717 'premium_modal_box_display_on' => array( 'button', 'text' ),
1718 ),
1719 )
1720 );
1721
1722 $this->end_controls_section();
1723
1724 $this->start_controls_section(
1725 'premium_modal_box_header_settings',
1726 array(
1727 'label' => __( 'Header', 'premium-addons-for-elementor' ),
1728 'tab' => Controls_Manager::TAB_STYLE,
1729 'condition' => array(
1730 'premium_modal_box_header_switcher' => 'yes',
1731 ),
1732 )
1733 );
1734
1735 $this->add_control(
1736 'premium_modal_box_header_text_color',
1737 array(
1738 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1739 'type' => Controls_Manager::COLOR,
1740 'selectors' => array(
1741 '{{WRAPPER}} .premium-modal-box-modal-title' => 'color: {{VALUE}}',
1742 '{{WRAPPER}} .premium-modal-box-modal-title svg' => 'fill: {{VALUE}}',
1743 ),
1744 )
1745 );
1746
1747 $this->add_group_control(
1748 Group_Control_Typography::get_type(),
1749 array(
1750 'name' => 'headertext',
1751 'global' => array(
1752 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1753 ),
1754 'selector' => '{{WRAPPER}} .premium-modal-box-modal-title',
1755 )
1756 );
1757
1758 $this->add_control(
1759 'premium_modal_box_header_background',
1760 array(
1761 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1762 'type' => Controls_Manager::COLOR,
1763 'selectors' => array(
1764 '{{WRAPPER}} .premium-modal-box-modal-header' => 'background: {{VALUE}};',
1765 ),
1766 )
1767 );
1768
1769 $this->add_control(
1770 'header_separator_background',
1771 array(
1772 'label' => __( 'Separator Color', 'premium-addons-for-elementor' ),
1773 'type' => Controls_Manager::COLOR,
1774 'selectors' => array(
1775 '{{WRAPPER}} .premium-modal-box-modal-header' => 'border-bottom-color: {{VALUE}};',
1776 ),
1777 )
1778 );
1779
1780 $this->add_group_control(
1781 Group_Control_Border::get_type(),
1782 array(
1783 'name' => 'premium_modal_header_border',
1784 'selector' => '{{WRAPPER}} .premium-modal-box-modal-header',
1785 )
1786 );
1787
1788 $this->end_controls_section();
1789
1790 $this->start_controls_section(
1791 'premium_modal_box_upper_close_button_section',
1792 array(
1793 'label' => __( 'Upper Close Button', 'premium-addons-for-elementor' ),
1794 'tab' => Controls_Manager::TAB_STYLE,
1795 'condition' => array(
1796 'dismissible' => 'yes',
1797 'premium_modal_box_upper_close' => 'yes',
1798 'premium_modal_box_header_switcher' => 'yes',
1799 ),
1800 )
1801 );
1802
1803 $this->add_responsive_control(
1804 'premium_modal_box_upper_close_button_size',
1805 array(
1806 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1807 'type' => Controls_Manager::SLIDER,
1808 'size_units' => array( 'px', '%', 'em' ),
1809 'selectors' => array(
1810 '{{WRAPPER}} .premium-modal-box-modal-header button' => 'font-size: {{SIZE}}{{UNIT}};',
1811 ),
1812 )
1813 );
1814
1815 $this->start_controls_tabs( 'premium_modal_box_upper_close_button_style' );
1816
1817 $this->start_controls_tab(
1818 'premium_modal_box_upper_close_button_normal',
1819 array(
1820 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
1821 )
1822 );
1823
1824 $this->add_control(
1825 'premium_modal_box_upper_close_button_normal_color',
1826 array(
1827 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1828 'type' => Controls_Manager::COLOR,
1829 'selectors' => array(
1830 '{{WRAPPER}} .premium-modal-box-modal-close' => 'color: {{VALUE}};',
1831 ),
1832 )
1833 );
1834
1835 $this->add_control(
1836 'premium_modal_box_upper_close_button_background_color',
1837 array(
1838 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1839 'type' => Controls_Manager::COLOR,
1840 'selectors' => array(
1841 '{{WRAPPER}} .premium-modal-box-modal-close' => 'background:{{VALUE}};',
1842 ),
1843 )
1844 );
1845
1846 $this->add_group_control(
1847 Group_Control_Border::get_type(),
1848 array(
1849 'name' => 'premium_modal_upper_border',
1850 'selector' => '{{WRAPPER}} .premium-modal-box-modal-close',
1851 )
1852 );
1853
1854 $this->add_control(
1855 'premium_modal_upper_border_radius',
1856 array(
1857 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1858 'type' => Controls_Manager::SLIDER,
1859 'size_units' => array( 'px', '%', 'em' ),
1860 'selectors' => array(
1861 '{{WRAPPER}} .premium-modal-box-modal-close' => 'border-radius:{{SIZE}}{{UNIT}};',
1862 ),
1863 'separator' => 'after',
1864 )
1865 );
1866
1867 $this->end_controls_tab();
1868
1869 $this->start_controls_tab(
1870 'premium_modal_box_upper_close_button_hover',
1871 array(
1872 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
1873 )
1874 );
1875
1876 $this->add_control(
1877 'premium_modal_box_upper_close_button_hover_color',
1878 array(
1879 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1880 'type' => Controls_Manager::COLOR,
1881 'selectors' => array(
1882 '{{WRAPPER}} .premium-modal-box-modal-close:hover' => 'color: {{VALUE}};',
1883 ),
1884 )
1885 );
1886
1887 $this->add_control(
1888 'premium_modal_box_upper_close_button_background_color_hover',
1889 array(
1890 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1891 'type' => Controls_Manager::COLOR,
1892 'selectors' => array(
1893 '{{WRAPPER}} .premium-modal-box-modal-close:hover' => 'background:{{VALUE}};',
1894 ),
1895 )
1896 );
1897
1898 $this->add_group_control(
1899 Group_Control_Border::get_type(),
1900 array(
1901 'name' => 'premium_modal_upper_border_hover',
1902 'selector' => '{{WRAPPER}} .premium-modal-box-modal-close:hover',
1903 )
1904 );
1905
1906 $this->add_control(
1907 'premium_modal_upper_border_radius_hover',
1908 array(
1909 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1910 'type' => Controls_Manager::SLIDER,
1911 'size_units' => array( 'px', '%', 'em' ),
1912 'selectors' => array(
1913 '{{WRAPPER}} .premium-modal-box-modal-close:hover' => 'border-radius:{{SIZE}}{{UNIT}};',
1914 ),
1915 'separator' => 'after',
1916 )
1917 );
1918
1919 $this->end_controls_tab();
1920
1921 $this->end_controls_tabs();
1922
1923 $this->add_responsive_control(
1924 'premium_modal_box_upper_close_button_padding',
1925 array(
1926 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1927 'type' => Controls_Manager::DIMENSIONS,
1928 'size_units' => array( 'px', 'em', '%' ),
1929 'selectors' => array(
1930 '{{WRAPPER}} .premium-modal-box-modal-close' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
1931 ),
1932 )
1933 );
1934
1935 $this->end_controls_section();
1936
1937 $this->start_controls_section(
1938 'premium_modal_box_lower_close_button_section',
1939 array(
1940 'label' => __( 'Lower Close Button', 'premium-addons-for-elementor' ),
1941 'tab' => Controls_Manager::TAB_STYLE,
1942 'condition' => array(
1943 'dismissible' => 'yes',
1944 'premium_modal_box_lower_close' => 'yes',
1945 ),
1946 )
1947 );
1948
1949 $this->add_group_control(
1950 Group_Control_Typography::get_type(),
1951 array(
1952 'name' => 'lowerclose',
1953 'global' => array(
1954 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1955 ),
1956 'selector' => '{{WRAPPER}} .premium-modal-box-modal-lower-close',
1957 )
1958 );
1959
1960 $this->add_responsive_control(
1961 'premium_modal_box_lower_close_button_width',
1962 array(
1963 'label' => __( 'Width', 'premium-addons-for-elementor' ),
1964 'type' => Controls_Manager::SLIDER,
1965 'size_units' => array( 'px', '%', 'em' ),
1966 'range' => array(
1967 'px' => array(
1968 'min' => 1,
1969 'max' => 500,
1970 ),
1971 'em' => array(
1972 'min' => 1,
1973 'max' => 30,
1974 ),
1975 ),
1976 'selectors' => array(
1977 '{{WRAPPER}} .premium-modal-box-modal-lower-close' => 'min-width: {{SIZE}}{{UNIT}};',
1978 ),
1979 )
1980 );
1981
1982 $this->start_controls_tabs( 'premium_modal_box_lower_close_button_style' );
1983
1984 $this->start_controls_tab(
1985 'premium_modal_box_lower_close_button_normal',
1986 array(
1987 'label' => __( 'Normal', 'premium-addons-for-elementor' ),
1988 )
1989 );
1990
1991 $this->add_control(
1992 'premium_modal_box_lower_close_button_normal_color',
1993 array(
1994 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1995 'type' => Controls_Manager::COLOR,
1996 'global' => array(
1997 'default' => Global_Colors::COLOR_SECONDARY,
1998 ),
1999 'selectors' => array(
2000 '{{WRAPPER}} .premium-modal-box-modal-lower-close' => 'color: {{VALUE}};',
2001 ),
2002 )
2003 );
2004
2005 $this->add_control(
2006 'premium_modal_box_lower_close_button_background_normal_color',
2007 array(
2008 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2009 'type' => Controls_Manager::COLOR,
2010 'global' => array(
2011 'default' => Global_Colors::COLOR_PRIMARY,
2012 ),
2013 'selectors' => array(
2014 '{{WRAPPER}} .premium-modal-box-modal-lower-close' => 'background-color: {{VALUE}};',
2015 ),
2016 )
2017 );
2018
2019 $this->add_group_control(
2020 Group_Control_Border::get_type(),
2021 array(
2022 'name' => 'premium_modal_box_lower_close_border',
2023 'selector' => '{{WRAPPER}} .premium-modal-box-modal-lower-close',
2024 )
2025 );
2026
2027 $this->add_control(
2028 'premium_modal_box_lower_close_border_radius',
2029 array(
2030 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2031 'type' => Controls_Manager::SLIDER,
2032 'size_units' => array( 'px', '%', 'em' ),
2033 'selectors' => array(
2034 '{{WRAPPER}} .premium-modal-box-modal-lower-close' => 'border-radius: {{SIZE}}{{UNIT}};',
2035 ),
2036 'separator' => 'after',
2037 )
2038 );
2039
2040 $this->end_controls_tab();
2041
2042 $this->start_controls_tab(
2043 'premium_modal_box_lower_close_button_hover',
2044 array(
2045 'label' => __( 'Hover', 'premium-addons-for-elementor' ),
2046 )
2047 );
2048
2049 $this->add_control(
2050 'premium_modal_box_lower_close_button_hover_color',
2051 array(
2052 'label' => __( 'Color', 'premium-addons-for-elementor' ),
2053 'type' => Controls_Manager::COLOR,
2054 'global' => array(
2055 'default' => Global_Colors::COLOR_PRIMARY,
2056 ),
2057 'selectors' => array(
2058 '{{WRAPPER}} .premium-modal-box-modal-lower-close:hover' => 'color: {{VALUE}};',
2059 ),
2060 )
2061 );
2062
2063 $this->add_control(
2064 'premium_modal_box_lower_close_button_background_hover_color',
2065 array(
2066 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
2067 'type' => Controls_Manager::COLOR,
2068 'global' => array(
2069 'default' => Global_Colors::COLOR_SECONDARY,
2070 ),
2071 'selectors' => array(
2072 '{{WRAPPER}} .premium-modal-box-modal-lower-close:hover' => 'background-color: {{VALUE}};',
2073 ),
2074 )
2075 );
2076
2077 $this->add_group_control(
2078 Group_Control_Border::get_type(),
2079 array(
2080 'name' => 'premium_modal_box_lower_close_border_hover',
2081 'selector' => '{{WRAPPER}} .premium-modal-box-modal-lower-close:hover',
2082 )
2083 );
2084
2085 $this->add_control(
2086 'premium_modal_box_lower_close_border_radius_hover',
2087 array(
2088 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2089 'type' => Controls_Manager::SLIDER,
2090 'size_units' => array( 'px', '%', 'em' ),
2091 'selectors' => array(
2092 '{{WRAPPER}} .premium-modal-box-modal-lower-close:hover' => 'border-radius: {{SIZE}}{{UNIT}};',
2093 ),
2094 'separator' => 'after',
2095 )
2096 );
2097
2098 $this->end_controls_tab();
2099
2100 $this->end_controls_tabs();
2101
2102 $this->add_responsive_control(
2103 'premium_modal_box_lower_close_button_padding',
2104 array(
2105 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2106 'type' => Controls_Manager::DIMENSIONS,
2107 'size_units' => array( 'px', 'em', '%' ),
2108 'selectors' => array(
2109 '{{WRAPPER}} .premium-modal-box-modal-lower-close' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2110 ),
2111 )
2112 );
2113
2114 $this->end_controls_section();
2115
2116 $this->start_controls_section(
2117 'premium_modal_box_style',
2118 array(
2119 'label' => __( 'Modal Box', 'premium-addons-for-elementor' ),
2120 'tab' => Controls_Manager::TAB_STYLE,
2121 )
2122 );
2123
2124 $this->add_control(
2125 'text_content_color',
2126 array(
2127 'label' => __( 'Text Color', 'premium-addons-for-elementor' ),
2128 'type' => Controls_Manager::COLOR,
2129 'selectors' => array(
2130 '{{WRAPPER}} .premium-modal-box-modal-body' => 'color: {{VALUE}}',
2131 ),
2132 'condition' => array(
2133 'premium_modal_box_content_type' => 'editor',
2134 ),
2135 )
2136 );
2137
2138 $this->add_group_control(
2139 Group_Control_Typography::get_type(),
2140 array(
2141 'name' => 'content_typography',
2142 'selector' => '{{WRAPPER}} .premium-modal-box-modal-body',
2143 'condition' => array(
2144 'premium_modal_box_content_type' => 'editor',
2145 ),
2146 )
2147 );
2148
2149 $this->add_control(
2150 'premium_modal_box_content_background',
2151 array(
2152 'label' => __( 'Content Background Color', 'premium-addons-for-elementor' ),
2153 'type' => Controls_Manager::COLOR,
2154 'selectors' => array(
2155 '{{WRAPPER}} .premium-modal-box-modal-body' => 'background: {{VALUE}};',
2156 ),
2157 )
2158 );
2159
2160 $this->add_control(
2161 'box_background',
2162 array(
2163 'label' => __( 'Box Background Color', 'premium-addons-for-elementor' ),
2164 'type' => Controls_Manager::COLOR,
2165 'selectors' => array(
2166 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'background: {{VALUE}};',
2167 ),
2168 )
2169 );
2170
2171 $this->add_control(
2172 'body_lq_effect',
2173 array(
2174 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ),
2175 'type' => Controls_Manager::SELECT,
2176 'description' => sprintf(
2177 /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */
2178 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' ),
2179 '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">',
2180 '</a>'
2181 ),
2182 'options' => array(
2183 'none' => __( 'None', 'premium-addons-for-elementor' ),
2184 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ),
2185 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ),
2186 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ),
2187 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ),
2188 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ),
2189 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ),
2190 ),
2191 'default' => 'none',
2192 'label_block' => true,
2193 'render_type' => 'template',
2194 )
2195 );
2196
2197 $this->add_responsive_control(
2198 'premium_modal_box_modal_size',
2199 array(
2200 'label' => __( 'Width', 'premium-addons-for-elementor' ),
2201 'type' => Controls_Manager::SLIDER,
2202 'size_units' => array( 'px', '%', 'em', 'custom' ),
2203 'range' => array(
2204 'px' => array(
2205 'min' => 50,
2206 'max' => 1500,
2207 ),
2208 'em' => array(
2209 'min' => 1,
2210 'max' => 50,
2211 ),
2212 ),
2213 'separator' => 'before',
2214 'label_block' => true,
2215 'selectors' => array(
2216 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'width: {{SIZE}}{{UNIT}};',
2217 ),
2218 )
2219 );
2220
2221 $this->add_responsive_control(
2222 'premium_modal_box_modal_max_height',
2223 array(
2224 'label' => __( 'Max Height', 'premium-addons-for-elementor' ),
2225 'type' => Controls_Manager::SLIDER,
2226 'size_units' => array( 'px', 'em', 'vh', 'custom' ),
2227 'range' => array(
2228 'px' => array(
2229 'min' => 50,
2230 'max' => 1500,
2231 ),
2232 'em' => array(
2233 'min' => 1,
2234 'max' => 50,
2235 ),
2236 ),
2237 'label_block' => true,
2238 'selectors' => array(
2239 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'max-height: {{SIZE}}{{UNIT}};',
2240 ),
2241 )
2242 );
2243
2244 $this->add_responsive_control(
2245 'content_overflow',
2246 array(
2247 'label' => __( 'Overflow', 'premium-addons-for-elementor' ),
2248 'type' => Controls_Manager::SELECT,
2249 'options' => array(
2250 'auto' => __( 'Auto', 'premium-addons-for-elementor' ),
2251 'visible' => __( 'Visible', 'premium-addons-for-elementor' ),
2252 'hidden' => __( 'Hidden', 'premium-addons-for-elementor' ),
2253 'scroll' => __( 'Scroll', 'premium-addons-for-elementor' ),
2254 ),
2255 'default' => 'auto',
2256 'selectors' => array(
2257 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'overflow: {{VALUE}}',
2258 ),
2259 )
2260 );
2261
2262 $this->add_group_control(
2263 Group_Control_Background::get_type(),
2264 array(
2265 'name' => 'premium_modal_box_modal_background',
2266 'types' => array( 'classic', 'gradient' ),
2267 'selector' => '{{WRAPPER}} .premium-modal-box-modal',
2268 )
2269 );
2270
2271 $this->add_control(
2272 'premium_modal_box_footer_background',
2273 array(
2274 'label' => __( 'Footer Background Color', 'premium-addons-for-elementor' ),
2275 'type' => Controls_Manager::COLOR,
2276 'selectors' => array(
2277 '{{WRAPPER}} .premium-modal-box-modal-footer' => 'background: {{VALUE}};',
2278 ),
2279 )
2280 );
2281
2282 $this->add_control(
2283 'footer_separator_background',
2284 array(
2285 'label' => __( 'Separator Color', 'premium-addons-for-elementor' ),
2286 'type' => Controls_Manager::COLOR,
2287 'selectors' => array(
2288 '{{WRAPPER}} .premium-modal-box-modal-footer' => 'border-top-color: {{VALUE}};',
2289 ),
2290 )
2291 );
2292
2293 $this->add_group_control(
2294 Group_Control_Border::get_type(),
2295 array(
2296 'name' => 'contentborder',
2297 'selector' => '{{WRAPPER}} .premium-modal-box-modal-dialog',
2298 )
2299 );
2300
2301 $this->add_control(
2302 'premium_modal_box_border_radius',
2303 array(
2304 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
2305 'type' => Controls_Manager::SLIDER,
2306 'size_units' => array( 'px', '%', 'em' ),
2307 'selectors' => array(
2308 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'border-radius: {{SIZE}}{{UNIT}};',
2309 ),
2310 )
2311 );
2312
2313 $this->add_group_control(
2314 Group_Control_Box_Shadow::get_type(),
2315 array(
2316 'name' => 'premium_modal_box_shadow',
2317 'selector' => '{{WRAPPER}} .premium-modal-box-modal-dialog',
2318 )
2319 );
2320
2321 $this->add_responsive_control(
2322 'premium_modal_box_margin',
2323 array(
2324 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
2325 'type' => Controls_Manager::DIMENSIONS,
2326 'size_units' => array( 'px', 'em', '%' ),
2327 'selectors' => array(
2328 '{{WRAPPER}} .premium-modal-box-modal-dialog' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2329 ),
2330 )
2331 );
2332
2333 $this->add_responsive_control(
2334 'premium_modal_box_padding',
2335 array(
2336 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
2337 'type' => Controls_Manager::DIMENSIONS,
2338 'size_units' => array( 'px', 'em', '%' ),
2339 'selectors' => array(
2340 '{{WRAPPER}} .premium-modal-box-modal-body' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
2341 ),
2342 )
2343 );
2344
2345 $this->end_controls_section();
2346 }
2347
2348
2349 /**
2350 * Render Header Icon
2351 *
2352 * Render HTML markup for modal header icon.
2353 *
2354 * @since 1.0.0
2355 * @access public
2356 *
2357 * @param boolean $new new icon.
2358 * @param boolean $migrate icon migrated.
2359 */
2360 protected function render_header_icon( $new, $migrate ) {
2361
2362 $settings = $this->get_settings_for_display();
2363
2364 $header_icon = $settings['premium_modal_box_icon_selection'];
2365
2366 if ( 'fonticon' === $header_icon ) {
2367 if ( $new || $migrate ) :
2368 Icons_Manager::render_icon( $settings['premium_modal_box_font_icon_updated'], array( 'aria-hidden' => 'true' ) );
2369 else : ?>
2370 <i <?php echo wp_kses_post( $this->get_render_attribute_string( 'title_icon' ) ); ?>></i>
2371 <?php
2372 endif;
2373 } elseif ( 'image' === $header_icon ) {
2374 ?>
2375 <img <?php echo wp_kses_post( $this->get_render_attribute_string( 'title_icon' ) ); ?>>
2376 <?php
2377 } elseif ( 'animation' === $header_icon ) {
2378 $this->add_render_attribute(
2379 'header_lottie',
2380 array(
2381 'class' => array(
2382 'premium-modal-header-lottie',
2383 'premium-lottie-animation',
2384 ),
2385 'data-lottie-url' => $settings['header_lottie_url'],
2386 'data-lottie-loop' => $settings['header_lottie_loop'],
2387 'data-lottie-reverse' => $settings['header_lottie_reverse'],
2388 )
2389 );
2390 ?>
2391 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'header_lottie' ) ); ?>></div>
2392 <?php
2393 }
2394 }
2395
2396 /**
2397 * Render Modal Box widget output on the frontend.
2398 *
2399 * Written in PHP and used to generate the final HTML.
2400 *
2401 * @since 1.0.0
2402 * @access protected
2403 */
2404 protected function render() {
2405
2406 $settings = $this->get_settings_for_display();
2407
2408 $papro_activated = Helper_Functions::check_papro_version();
2409
2410 $trigger = $settings['premium_modal_box_display_on'];
2411
2412 if ( ! $papro_activated || version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.9.26', '<' ) ) {
2413
2414 if ( 'exit' === $trigger || 'yes' === $settings['show_again_exit'] ) {
2415
2416 ?>
2417 <div class="premium-error-notice">
2418 <?php
2419 $message = __( 'This option is available in <b>Premium Addons Pro</b>.', 'premium-addons-for-elementor' );
2420 echo wp_kses_post( $message );
2421 ?>
2422 </div>
2423 <?php
2424 return false;
2425
2426 }
2427 }
2428
2429 $this->add_inline_editing_attributes( 'premium_modal_box_selector_text' );
2430
2431 $this->add_render_attribute(
2432 'trigger',
2433 array(
2434 'data-toggle' => 'premium-modal',
2435 'data-target' => '#premium-modal-' . $this->get_id(),
2436 )
2437 );
2438
2439 if ( 'button' === $trigger ) {
2440
2441 $icon_type = $settings['icon_type'];
2442
2443 if ( 'yes' === $settings['draw_svg'] ) {
2444
2445 $this->add_render_attribute(
2446 'modal',
2447 'class',
2448 array(
2449 'elementor-invisible',
2450 'premium-drawer-hover',
2451 )
2452 );
2453
2454 $this->add_render_attribute(
2455 'icon',
2456 array(
2457 'class' => 'premium-svg-drawer',
2458 'data-svg-reverse' => $settings['svg_reverse'],
2459 'data-svg-loop' => $settings['svg_loop'],
2460 'data-svg-sync' => $settings['svg_sync'],
2461 'data-svg-hover' => $settings['svg_hover'],
2462 'data-svg-fill' => $settings['svg_color'],
2463 'data-svg-frames' => $settings['frames'],
2464 'data-svg-yoyo' => $settings['svg_yoyo'],
2465 'data-svg-point' => $settings['svg_reverse'] ? $settings['end_point']['size'] : $settings['start_point']['size'],
2466 )
2467 );
2468
2469 } else {
2470 $this->add_render_attribute( 'icon', 'class', 'premium-svg-nodraw' );
2471 }
2472
2473 $effect_class = Helper_Functions::get_button_class( $settings );
2474
2475 $this->add_render_attribute(
2476 'trigger',
2477 array(
2478 'type' => 'button',
2479 'class' => array(
2480 'premium-modal-trigger-btn',
2481 'premium-btn-' . $settings['premium_modal_box_button_size'],
2482 $effect_class,
2483 ),
2484 'data-text' => $settings['premium_modal_box_button_text'],
2485 )
2486 );
2487
2488 } elseif ( 'image' === $trigger ) {
2489
2490 $alt = Control_Media::get_image_alt( $settings['premium_modal_box_image_src'] );
2491
2492 $this->add_render_attribute(
2493 'trigger',
2494 array(
2495 'class' => 'premium-modal-trigger-img',
2496 'src' => $settings['premium_modal_box_image_src']['url'],
2497 'alt' => $alt,
2498 )
2499 );
2500
2501 } elseif ( 'text' === $trigger ) {
2502 $this->add_render_attribute( 'trigger', 'class', 'premium-modal-trigger-text' );
2503 } elseif ( 'animation' === $trigger ) {
2504
2505 $this->add_render_attribute(
2506 'trigger',
2507 array(
2508 'class' => array(
2509 'premium-modal-trigger-animation',
2510 'premium-lottie-animation',
2511 ),
2512 'data-lottie-url' => $settings['lottie_url'],
2513 'data-lottie-loop' => $settings['lottie_loop'],
2514 'data-lottie-reverse' => $settings['lottie_reverse'],
2515 'data-lottie-hover' => $settings['lottie_hover'],
2516 )
2517 );
2518
2519 }
2520
2521 if ( 'template' === $settings['premium_modal_box_content_type'] ) {
2522 $template = empty( $settings['premium_modal_box_content_temp'] ) ? $settings['live_temp_content'] : $settings['premium_modal_box_content_temp'];
2523 }
2524
2525 if ( 'yes' === $settings['premium_modal_box_header_switcher'] ) {
2526
2527 $header_icon = $settings['premium_modal_box_icon_selection'];
2528
2529 $header_migrated = false;
2530 $header_new = false;
2531
2532 if ( 'fonticon' === $header_icon ) {
2533
2534 if ( ! empty( $settings['premium_modal_box_font_icon'] ) ) {
2535 $this->add_render_attribute(
2536 'title_icon',
2537 array(
2538 'class' => $settings['premium_modal_box_font_icon'],
2539 'aria-hidden' => 'true',
2540 )
2541 );
2542 }
2543
2544 $header_migrated = isset( $settings['__fa4_migrated']['premium_modal_box_font_icon_updated'] );
2545 $header_new = empty( $settings['premium_modal_box_font_icon'] ) && Icons_Manager::is_migration_allowed();
2546 } elseif ( 'image' === $header_icon ) {
2547
2548 $alt = Control_Media::get_image_alt( $settings['premium_modal_box_image_icon'] );
2549
2550 $this->add_render_attribute(
2551 'title_icon',
2552 array(
2553 'src' => $settings['premium_modal_box_image_icon']['url'],
2554 'alt' => $alt,
2555 )
2556 );
2557
2558 }
2559 }
2560
2561 $modal_settings = array(
2562 'trigger' => $trigger,
2563 'show_on_exit' => 'yes' === $settings['show_again_exit'],
2564 );
2565
2566 if ( 'pageload' === $trigger ) {
2567 $modal_settings['delay'] = $settings['premium_modal_box_popup_delay'];
2568 }
2569
2570 $this->add_render_attribute(
2571 'modal',
2572 array(
2573 'class' => 'premium-modal-box-container',
2574 'data-settings' => wp_json_encode( $modal_settings ),
2575 )
2576 );
2577
2578 $animation_class = $settings['premium_modal_box_animation'];
2579 if ( '' !== $settings['premium_modal_box_animation_duration'] ) {
2580 $animation_dur = 'animated-' . $settings['premium_modal_box_animation_duration'];
2581 } else {
2582 $animation_dur = 'animated-';
2583 }
2584
2585 $this->add_render_attribute(
2586 'dialog',
2587 array(
2588 'class' => 'premium-modal-box-modal-dialog',
2589 'data-delay-animation' => $settings['premium_modal_box_animation_delay'],
2590 'data-modal-animation' => array(
2591 $animation_class,
2592 $animation_dur,
2593 ),
2594 )
2595 );
2596
2597 if ( 'none' !== $settings['body_lq_effect'] ) {
2598 $this->add_render_attribute( 'dialog', 'class', 'premium-con-lq__' . $settings['body_lq_effect'] );
2599 }
2600
2601 ?>
2602
2603 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'modal' ) ); ?>>
2604 <div class="premium-modal-trigger-container">
2605 <?php
2606 if ( 'button' === $trigger ) :
2607 ?>
2608 <button <?php echo wp_kses_post( $this->get_render_attribute_string( 'trigger' ) ); ?>>
2609
2610 <?php
2611 if ( 'yes' === $settings['premium_modal_box_icon_switcher'] && 'before' === $settings['premium_modal_box_icon_position'] ) :
2612 if ( 'icon' === $icon_type ) :
2613
2614 echo Helper_Functions::get_svg_by_icon(
2615 $settings['premium_modal_box_button_icon_selection_updated'],
2616 $this->get_render_attribute_string( 'icon' )
2617 );
2618
2619 else :
2620 ?>
2621 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon' ) ); ?>>
2622 <?php $this->print_unescaped_setting( 'custom_svg' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
2623 </div>
2624 <?php
2625 endif;
2626 endif;
2627 ?>
2628
2629 <div class="premium-button-text-icon-wrapper">
2630 <span><?php echo wp_kses_post( $settings['premium_modal_box_button_text'] ); ?></span>
2631 </div>
2632
2633 <?php
2634 if ( 'yes' === $settings['premium_modal_box_icon_switcher'] && 'after' === $settings['premium_modal_box_icon_position'] ) :
2635 if ( 'icon' === $icon_type ) :
2636
2637 echo Helper_Functions::get_svg_by_icon(
2638 $settings['premium_modal_box_button_icon_selection_updated'],
2639 $this->get_render_attribute_string( 'icon' )
2640 );
2641
2642 else :
2643 ?>
2644 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon' ) ); ?>>
2645 <?php $this->print_unescaped_setting( 'custom_svg' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
2646 </div>
2647 <?php
2648 endif;
2649 endif;
2650 ?>
2651
2652 <?php if ( 'style6' === $settings['premium_button_hover_effect'] && 'yes' === $settings['mouse_detect'] ) : ?>
2653 <span class="premium-button-style6-bg"></span>
2654 <?php endif; ?>
2655
2656 <?php if ( 'style8' === $settings['premium_button_hover_effect'] ) : ?>
2657 <?php echo Helper_Functions::get_btn_svgs( $settings['underline_style'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
2658 <?php endif; ?>
2659
2660 </button>
2661 <?php elseif ( 'image' === $trigger ) : ?>
2662 <img <?php echo wp_kses_post( $this->get_render_attribute_string( 'trigger' ) ); ?>>
2663 <?php elseif ( 'text' === $trigger ) : ?>
2664 <span <?php echo wp_kses_post( $this->get_render_attribute_string( 'trigger' ) ); ?>>
2665 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_modal_box_selector_text' ) ); ?>>
2666 <?php echo wp_kses_post( $settings['premium_modal_box_selector_text'] ); ?>
2667 </div>
2668 </span>
2669 <?php elseif ( 'animation' === $trigger ) : ?>
2670 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'trigger' ) ); ?>></div>
2671 <?php endif; ?>
2672 </div>
2673
2674 <div id="premium-modal-<?php echo esc_attr( $this->get_id() ); ?>" class="premium-modal-box-modal"
2675 role="dialog"
2676 style="display: none"
2677 >
2678 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'dialog' ) ); ?>>
2679 <?php if ( 'yes' === $settings['premium_modal_box_header_switcher'] ) : ?>
2680 <div class="premium-modal-box-modal-header">
2681 <?php if ( ! empty( $settings['premium_modal_box_title'] ) ) : ?>
2682 <h3 class="premium-modal-box-modal-title">
2683 <?php
2684 $this->render_header_icon( $header_new, $header_migrated );
2685 echo wp_kses_post( $settings['premium_modal_box_title'] );
2686 ?>
2687 </h3>
2688 <?php endif; ?>
2689 <?php if ( 'yes' === $settings['premium_modal_box_upper_close'] ) : ?>
2690 <div class="premium-modal-box-close-button-container">
2691 <button type="button" class="premium-modal-box-modal-close" data-dismiss="premium-modal">&times;</button>
2692 </div>
2693 <?php endif; ?>
2694 </div>
2695 <?php endif; ?>
2696 <div class="premium-modal-box-modal-body">
2697 <?php
2698 if ( 'editor' === $settings['premium_modal_box_content_type'] ) :
2699 echo $this->parse_text_editor( $settings['premium_modal_box_content'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2700 else :
2701 echo Helper_Functions::render_elementor_template( $template ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2702 endif;
2703 ?>
2704 </div>
2705 <?php if ( 'yes' === $settings['premium_modal_box_lower_close'] ) : ?>
2706 <div class="premium-modal-box-modal-footer">
2707 <button type="button" class="premium-modal-box-modal-lower-close" data-dismiss="premium-modal">
2708 <?php echo wp_kses_post( $settings['premium_modal_close_text'] ); ?>
2709 </button>
2710 </div>
2711 <?php endif; ?>
2712 </div>
2713 </div>
2714 </div>
2715
2716 <?php
2717 }
2718 }
2719