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