PopBox For Elementor - Version 1.0.0

Version Description

  • FIXED: Issue when video contained in a popup did not stop playing after the closing - See topic: https://wordpress.org/support/topic/videos-in-popups/
  • Code tidyup
  • NEW: Added modal_for_elementor_fail_load() function to handle gracefull fallback when Elementor is not active.
  • NEW: Added modal_for_elementor_fail_load_out_of_date() function to handle gracefull fallback when Elementor version is out of date - Required version set to v1.8.5.
  • NEW: Background color control for modal content window.
  • NEW: Border and Border radius controls for modal content window.
  • TWEAK: Changed widget category to norewp-elements (NoreWP's Elementor Modules) for better representation and future enhancements.
  • TWEAK: Reorganised Controls for better workflow
  • TWEAK: Modal Max Width control moved to Style > Modal Container for better grouping.
  • TWEAK: Moved button typography to below text padding for better workflow.
  • TWEAK: Removed hardcoded content window box shadow and added Shadow Control for maximum control
  • TWEAK: Minor CSS adjustments
  • Renamed plugin to PopBox For Elementor.
Download this release

Release Info

Developer norewp
Plugin Icon wp plugin PopBox For Elementor
Version 1.0.0
Comparing to
See all releases

Code changes from version 0.1.5 to 1.0.0

Files changed (5) hide show
  1. css/popup.css +18 -12
  2. modal-for-elementor.php +103 -28
  3. plugin.php +2 -2
  4. readme.txt +32 -9
  5. widgets/popup.php +266 -216
css/popup.css CHANGED
@@ -1,23 +1,23 @@
1
  @media screen and (min-width: 750px) {
2
  .modal {
3
- text-align: center;
4
- padding: 0 !important;
5
  }
6
 
7
  .modal-dialog {
8
- display: inline-block;
9
- vertical-align: middle;
10
- width: 100%;
11
- margin: 0 0;
12
  }
13
 
14
  .modal-content {
15
- padding: 0px 0px 0px 0px;
16
- }
17
 
18
  .model-body {
19
- overflow-y: scroll !important;
20
- overflow-x: hidden !important;
21
  }
22
  }
23
 
@@ -25,8 +25,6 @@
25
  padding: 0px !important;
26
  }
27
 
28
- body{padding:0 !important}
29
-
30
  .modal-dialog {
31
  text-align: left;
32
  }
@@ -45,4 +43,12 @@ body.modal-open .elementor-widget-wrap {
45
 
46
  .modal.fade.in {
47
  background: rgba(0,0,0,0.6);
 
 
 
 
 
 
 
 
48
  }
1
  @media screen and (min-width: 750px) {
2
  .modal {
3
+ text-align: center;
4
+ padding: 0 !important;
5
  }
6
 
7
  .modal-dialog {
8
+ display: inline-block;
9
+ vertical-align: middle;
10
+ width: 100%;
11
+ margin: 0 0;
12
  }
13
 
14
  .modal-content {
15
+ padding: 0px 0px 0px 0px;
16
+ }
17
 
18
  .model-body {
19
+ overflow-y: scroll !important;
20
+ overflow-x: hidden !important;
21
  }
22
  }
23
 
25
  padding: 0px !important;
26
  }
27
 
 
 
28
  .modal-dialog {
29
  text-align: left;
30
  }
43
 
44
  .modal.fade.in {
45
  background: rgba(0,0,0,0.6);
46
+ }
47
+
48
+ .modal-content {
49
+ box-shadow: none;
50
+ }
51
+ .modal-content button.close {
52
+ position: absolute;
53
+ right: 0;
54
  }
modal-for-elementor.php CHANGED
@@ -1,40 +1,110 @@
1
  <?php
2
  /**
3
- * Plugin Name: Modal For Elementor
4
- * Description: Modal plugin for Elementor Page Builder
5
- * Version: 0.1.5
6
- * Author: Luis Marques
7
- * Author URI: https://facebook.com/Luisbeonline
 
8
  * Text Domain: modal-for-elementor
9
  * License: GPLv3
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
 
 
 
 
 
 
 
 
 
 
 
14
  // Load the plugin after Elementor (and other plugins) are loaded
15
  add_action( 'plugins_loaded', function() {
16
  // Load localization file
17
- load_plugin_textdomain( 'modal-popup', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
18
 
19
  // Notice if the Elementor is not active
20
  if ( ! did_action( 'elementor/loaded' ) ) {
21
- add_action( 'admin_notices', 'hello_world_fail_load' );
22
  return;
23
  }
24
 
25
  // Check version required
26
- $elementor_version_required = '1.0.0';
27
  if ( ! version_compare( ELEMENTOR_VERSION, $elementor_version_required, '>=' ) ) {
28
- add_action( 'admin_notices', 'hello_world_fail_load_out_of_date' );
29
  return;
30
  }
31
 
32
  // Require the main plugin file
33
- require( __DIR__ . '/plugin.php' );
34
  } );
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
 
 
 
37
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  add_action( 'wp_enqueue_scripts', 'register_popup_style' );
40
  function register_popup_style() {
@@ -55,24 +125,29 @@ function register_popup_style() {
55
 
56
  /* create new custom post type named popup */
57
  add_action( 'init', 'create_popup_post_type' );
 
 
58
 
59
  function create_popup_post_type() {
60
- register_post_type( 'elementor-popup',
61
- array(
62
- 'labels' => array(
63
- 'name' => __( 'Elementor Popups', 'modal-popup'),
64
- 'singular_name' => __( 'Popup', 'modal-popup'),
65
- 'all_items' => __( 'All Popups', 'modal-popup'),
66
- 'add_new_item' => __( 'Add New Popup', 'modal-popup'),
67
- 'new_item' => __( 'Add New Popup', 'modal-popup'),
68
- 'add_new' => __( 'Add New Popup', 'modal-popup'),
69
- 'edit_item' => __( 'Edit Popup', 'modal-popup'),
70
- ),
71
- 'has_archive' => false,
72
- 'rewrite' => array('slug' => 'elementor-popup'),
73
- 'public' => true,
74
- 'exclude_from_search' => true,
75
- )
76
- );
77
- add_post_type_support( 'elementor-popup', 'elementor' );
 
 
 
78
  }
1
  <?php
2
  /**
3
+ * Plugin Name: PopBox For Elementor
4
+ * Description: Create content-rich popboxes for your site using the power of Elementor Page Builder
5
+ * Version: 1.0.0
6
+ * Author: Zulfikar Nore
7
+ * Author URI: https://designsbynore.com/
8
+ * Plugin URI: https://designsbynore.com/popups/popbox/
9
  * Text Domain: modal-for-elementor
10
  * License: GPLv3
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
 
15
+ define( 'MODAL_ELEMENTOR_VERSION', '1.0.0' );
16
+
17
+ define( 'MODAL_ELEMENTOR__FILE__', __FILE__ );
18
+ define( 'MODAL_ELEMENTOR_PLUGIN_BASE', plugin_basename( MODAL_ELEMENTOR__FILE__ ) );
19
+ define( 'MODAL_ELEMENTOR_PATH', plugin_dir_path( MODAL_ELEMENTOR__FILE__ ) );
20
+ define( 'MODAL_ELEMENTOR_MODULES_PATH', MODAL_ELEMENTOR_PATH . 'modules/' );
21
+ define( 'MODAL_ELEMENTOR_URL', plugins_url( '/', MODAL_ELEMENTOR__FILE__ ) );
22
+ define( 'MODAL_ELEMENTOR_ASSETS_URL', MODAL_ELEMENTOR_URL . 'assets/' );
23
+ define( 'MODAL_ELEMENTOR_MODULES_URL', MODAL_ELEMENTOR_URL . 'modules/' );
24
+
25
  // Load the plugin after Elementor (and other plugins) are loaded
26
  add_action( 'plugins_loaded', function() {
27
  // Load localization file
28
+ load_plugin_textdomain( 'modal-for-elementor', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
29
 
30
  // Notice if the Elementor is not active
31
  if ( ! did_action( 'elementor/loaded' ) ) {
32
+ add_action( 'admin_notices', 'modal_for_elementor_fail_load' );
33
  return;
34
  }
35
 
36
  // Check version required
37
+ $elementor_version_required = '1.8.5';
38
  if ( ! version_compare( ELEMENTOR_VERSION, $elementor_version_required, '>=' ) ) {
39
+ add_action( 'admin_notices', 'modal_for_elementor_fail_load_out_of_date' );
40
  return;
41
  }
42
 
43
  // Require the main plugin file
44
+ require( MODAL_ELEMENTOR_PATH . 'plugin.php' );
45
  } );
46
 
47
+ /**
48
+ * Show in WP Dashboard notice about the plugin is not activated.
49
+ *
50
+ * @since 1.0.0
51
+ *
52
+ * @return void
53
+ */
54
+ function modal_for_elementor_fail_load() {
55
+ $screen = get_current_screen();
56
+ if ( isset( $screen->parent_file ) && 'plugins.php' === $screen->parent_file && 'update' === $screen->id ) {
57
+ return;
58
+ }
59
+
60
+ $plugin = 'elementor/elementor.php';
61
+
62
+ if ( _is_elementor_installed() ) {
63
+ if ( ! current_user_can( 'activate_plugins' ) ) {
64
+ return;
65
+ }
66
+
67
+ $activation_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
68
+
69
+ $message = '<p>' . __( 'Elementor Starter is not working because you need to activate the Elementor plugin.', 'modal-for-elementor' ) . '</p>';
70
+ $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $activation_url, __( 'Activate Elementor Now', 'modal-for-elementor' ) ) . '</p>';
71
+ } else {
72
+ if ( ! current_user_can( 'install_plugins' ) ) {
73
+ return;
74
+ }
75
+
76
+ $install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), 'install-plugin_elementor' );
77
+
78
+ $message = '<p>' . __( 'Modal For Elementor is not working because you need to install the Elemenor plugin', 'modal-for-elementor' ) . '</p>';
79
+ $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $install_url, __( 'Install Elementor Now', 'modal-for-elementor' ) ) . '</p>';
80
+ }
81
+
82
+ echo '<div class="error"><p>' . $message . '</p></div>';
83
+ }
84
+
85
+ function modal_for_elementor_fail_load_out_of_date() {
86
+ if ( ! current_user_can( 'update_plugins' ) ) {
87
+ return;
88
+ }
89
+
90
+ $file_path = 'elementor/elementor.php';
91
 
92
+ $upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_' . $file_path );
93
+ $message = '<p>' . __( 'Modal For Elementor is not working because you are using an old version of Elementor.', 'modal-for-elementor' ) . '</p>';
94
+ $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $upgrade_link, __( 'Update Elementor Now', 'modal-for-elementor' ) ) . '</p>';
95
 
96
+ echo '<div class="error">' . $message . '</div>';
97
+ }
98
+
99
+ if ( ! function_exists( '_is_elementor_installed' ) ) {
100
+
101
+ function _is_elementor_installed() {
102
+ $file_path = 'elementor/elementor.php';
103
+ $installed_plugins = get_plugins();
104
+
105
+ return isset( $installed_plugins[ $file_path ] );
106
+ }
107
+ }
108
 
109
  add_action( 'wp_enqueue_scripts', 'register_popup_style' );
110
  function register_popup_style() {
125
 
126
  /* create new custom post type named popup */
127
  add_action( 'init', 'create_popup_post_type' );
128
+ //flush rewrite rules
129
+ add_action('init', 'flush_rewrite_rules', 10 );
130
 
131
  function create_popup_post_type() {
132
+ register_post_type( 'elementor-popup',
133
+ array(
134
+ 'labels' => array(
135
+ 'name' => __( 'PopBoxes', 'modal-for-elementor' ),
136
+ 'singular_name' => __( 'PopBox', 'modal-for-elementor' ),
137
+ 'all_items' => __( 'All PopBoxes', 'modal-for-elementor' ),
138
+ 'add_new_item' => __( 'Add New PopBox', 'modal-for-elementor' ),
139
+ 'new_item' => __( 'Add New PopBox', 'modal-for-elementor' ),
140
+ 'add_new' => __( 'Add New PopBox', 'modal-for-elementor' ),
141
+ 'edit_item' => __( 'Edit PopBox', 'modal-for-elementor' ),
142
+ ),
143
+ 'has_archive' => false,
144
+ 'rewrite' => array( 'slug' => 'elementor-popup', 'with_front' => false ),
145
+ 'query_var' => false,
146
+ 'menu_icon' => 'dashicons-slides',
147
+ 'public' => true,
148
+ 'exclude_from_search' => true,
149
+ 'capability_type' => 'post'
150
+ )
151
+ );
152
+ add_post_type_support( 'elementor-popup', 'elementor' );
153
  }
plugin.php CHANGED
@@ -30,9 +30,9 @@ class ElementorModalPlugin {
30
  private function register_widget() {
31
  \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ElementorModal() );
32
  \Elementor\Plugin::instance()->elements_manager->add_category(
33
- 'beonline-elements',
34
  [
35
- 'title' => 'BEONLINE PORWER TOOLS',
36
  'icon' => 'fa fa-plug'
37
  ],
38
  1
30
  private function register_widget() {
31
  \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new ElementorModal() );
32
  \Elementor\Plugin::instance()->elements_manager->add_category(
33
+ 'norewp-elements',
34
  [
35
+ 'title' => 'NoreWP\'s Elementor Modules',
36
  'icon' => 'fa fa-plug'
37
  ],
38
  1
readme.txt CHANGED
@@ -1,8 +1,10 @@
1
- === Modal For Elementor ===
2
- Tags: Modal, Popup, elementor
 
 
3
  Requires at least: 4.4
4
- Tested up to: 4.7
5
- Stable tag: 4.7
6
  License: GPLv2 or later
7
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
8
 
@@ -10,13 +12,16 @@ Add a modal widget for Elementor Page Builder.
10
 
11
  == Description ==
12
 
13
- This plugin allows to create beautiful templates with and for Elementor Page Builder.
14
 
15
- It will add a menu on your Wordpress Dashboard called Elementor Popups. There you can create
16
- your popups using Elementor Pagebuilder.
17
 
18
- It will also add a Widget in Elementor Pagebuilder to add a customizable button in your page.
19
- Select the popup you want to show when button is clicked.
 
 
 
 
20
 
21
 
22
  == Installation ==
@@ -24,8 +29,26 @@ Select the popup you want to show when button is clicked.
24
  1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly.
25
  2. Activate the plugin through the 'Plugins' screen in WordPress
26
 
 
27
 
28
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  = 0.1.5 =
31
  * Plugin initial release
1
+ === PopBox For Elementor ===
2
+ Contributors: norewp, LuisBeonline, bashari
3
+ Donate link: https://www.paypal.me/NoreMarketing/5
4
+ Tags: PopBox, Modal, Popup, Elementor
5
  Requires at least: 4.4
6
+ Tested up to: 4.9
7
+ Stable tag: 1.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ NOTE: Modal For Elementor is now PopBox For Elementor and develoment will now be continued by Zulfikar Nore of NoreWP :)
16
 
17
+ PopBox for Elementor allows the creation of beautiful templates with Elementor Page Builder for use with the included Popbox overlay script.
 
18
 
19
+ An Admin menu will be added on your Wordpress Dashboard sidepane named PopBoxes. This is the custom post type (CPT) you'll use to create the content of the PopBox.
20
+
21
+ A custom module will also be added to Elementor Page Builder edit screen to be used for the customiztion of the trigger button embeded on your page.
22
+ Simply select one of the PopBox content created via the CPT to be shown when the trigger button is clicked.
23
+
24
+ Brief video on setup (Sorry for the lack of sound): https://youtu.be/M3B9aLLTXKY
25
 
26
 
27
  == Installation ==
29
  1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly.
30
  2. Activate the plugin through the 'Plugins' screen in WordPress
31
 
32
+ Go to settings > permalinks and click save. (you need to do that in order to register the popup post types.)
33
 
34
  == Changelog ==
35
+ = 1.0.0 =
36
+ * FIXED: Issue when video contained in a popup did not stop playing after the closing - See topic: https://wordpress.org/support/topic/videos-in-popups/
37
+ * Code tidyup
38
+ * NEW: Added `modal_for_elementor_fail_load()` function to handle gracefull fallback when Elementor is not active.
39
+ * NEW: Added `modal_for_elementor_fail_load_out_of_date()` function to handle gracefull fallback when Elementor version is out of date - Required version set to v1.8.5.
40
+ * NEW: Background color control for modal content window.
41
+ * NEW: Border and Border radius controls for modal content window.
42
+ * TWEAK: Changed widget category to norewp-elements (NoreWP's Elementor Modules) for better representation and future enhancements.
43
+ * TWEAK: Reorganised Controls for better workflow
44
+ * TWEAK: Modal Max Width control moved to Style > Modal Container for better grouping.
45
+ * TWEAK: Moved button typography to below text padding for better workflow.
46
+ * TWEAK: Removed hardcoded content window box shadow and added Shadow Control for maximum control
47
+ * TWEAK: Minor CSS adjustments
48
+ * Renamed plugin to PopBox For Elementor.
49
+
50
+ = 0.1.6 =
51
+ * Minor bug fixes
52
 
53
  = 0.1.5 =
54
  * Plugin initial release
widgets/popup.php CHANGED
@@ -17,25 +17,27 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
17
 
18
  class ElementorModal extends Widget_Base {
19
 
 
 
20
  public function get_name() {
21
  return 'popup';
22
  }
23
  public function get_title() {
24
- return __( 'Popup', 'modal-popup' );
25
  }
26
  public function get_icon() {
27
  return 'eicon-button';
28
  }
29
  public function get_categories() {
30
- return [ 'beonline-elements' ];
31
  }
32
  public static function get_button_sizes() {
33
  return [
34
- 'xs' => __( 'Extra Small', 'elementor' ),
35
- 'sm' => __( 'Small', 'elementor' ),
36
- 'md' => __( 'Medium', 'elementor' ),
37
- 'lg' => __( 'Large', 'elementor' ),
38
- 'xl' => __( 'Extra Large', 'elementor' ),
39
  ];
40
  }
41
  protected function get_popups() {
@@ -64,103 +66,57 @@ class ElementorModal extends Widget_Base {
64
  }
65
  }
66
  protected function _register_controls() {
67
- $this->start_controls_section(
68
- 'section_popup',
69
- [
70
- 'label' => __( 'Popup', 'modal-popup' ),
71
- ]
72
- );
73
- $this->add_control(
74
- 'popup',
75
- [
76
- 'label' => __( 'Choose Popup', 'modal-popup' ),
77
- 'type' => Controls_Manager::SELECT,
78
- 'default' => $this->get_popups()['first_popup'],
79
- 'options' => $this->get_popups()['popups'],
80
- ]
81
- );
82
-
83
- $this->add_control(
84
- 'Close Button',
85
- [
86
- 'label' => __( 'Show Close Button', 'modal-popup' ),
87
- 'type' => Controls_Manager::SWITCHER,
88
- 'label_off' => __( 'Hide', 'modal-popup' ),
89
- 'label_on' => __( 'Show', 'modal-popup' ),
90
- 'default' => 'yes',
91
-
92
-
93
- 'selectors' => [
94
- '{{WRAPPER}} button.close' => 'display: inherit;',
95
- ],
96
- ]
97
- );
98
-
99
- $this->add_control(
100
- 'button_close_text_color',
101
- [
102
- 'label' => __( 'Close Button Color', 'modal-popup' ),
103
- 'type' => Controls_Manager::COLOR,
104
- 'default' => '',
105
- 'selectors' => [
106
- '{{WRAPPER}} button.close' => 'color: {{VALUE}};',
107
- ],
108
- ]
109
- );
110
-
111
-
112
- $this->end_controls_section();
113
-
114
  $this->start_controls_section(
115
  'section_button',
116
  [
117
- 'label' => __( 'Button', 'elementor' ),
118
  ]
119
  );
120
  $this->add_control(
121
  'button_type',
122
  [
123
- 'label' => __( 'Type', 'elementor' ),
124
  'type' => Controls_Manager::SELECT,
125
  'default' => '',
126
  'options' => [
127
- '' => __( 'Default', 'elementor' ),
128
- 'info' => __( 'Info', 'elementor' ),
129
- 'success' => __( 'Success', 'elementor' ),
130
- 'warning' => __( 'Warning', 'elementor' ),
131
- 'danger' => __( 'Danger', 'elementor' ),
132
  ],
133
  ]
134
  );
135
  $this->add_control(
136
  'text',
137
  [
138
- 'label' => __( 'Text', 'elementor' ),
139
  'type' => Controls_Manager::TEXT,
140
- 'default' => __( 'Click me', 'elementor' ),
141
- 'placeholder' => __( 'Click me', 'elementor' ),
142
  ]
143
  );
144
  $this->add_responsive_control(
145
  'align',
146
  [
147
- 'label' => __( 'Alignment', 'elementor' ),
148
  'type' => Controls_Manager::CHOOSE,
149
  'options' => [
150
  'left' => [
151
- 'title' => __( 'Left', 'elementor' ),
152
  'icon' => 'fa fa-align-left',
153
  ],
154
  'center' => [
155
- 'title' => __( 'Center', 'elementor' ),
156
  'icon' => 'fa fa-align-center',
157
  ],
158
  'right' => [
159
- 'title' => __( 'Right', 'elementor' ),
160
  'icon' => 'fa fa-align-right',
161
  ],
162
  'justify' => [
163
- 'title' => __( 'Justified', 'elementor' ),
164
  'icon' => 'fa fa-align-justify',
165
  ],
166
  ],
@@ -171,7 +127,7 @@ class ElementorModal extends Widget_Base {
171
  $this->add_control(
172
  'size',
173
  [
174
- 'label' => __( 'Size', 'elementor' ),
175
  'type' => Controls_Manager::SELECT,
176
  'default' => 'sm',
177
  'options' => self::get_button_sizes(),
@@ -180,7 +136,7 @@ class ElementorModal extends Widget_Base {
180
  $this->add_control(
181
  'icon',
182
  [
183
- 'label' => __( 'Icon', 'elementor' ),
184
  'type' => Controls_Manager::ICON,
185
  'label_block' => true,
186
  'default' => '',
@@ -189,12 +145,12 @@ class ElementorModal extends Widget_Base {
189
  $this->add_control(
190
  'icon_align',
191
  [
192
- 'label' => __( 'Icon Position', 'elementor' ),
193
  'type' => Controls_Manager::SELECT,
194
  'default' => 'left',
195
  'options' => [
196
- 'left' => __( 'Before', 'elementor' ),
197
- 'right' => __( 'After', 'elementor' ),
198
  ],
199
  'condition' => [
200
  'icon!' => '',
@@ -204,7 +160,7 @@ class ElementorModal extends Widget_Base {
204
  $this->add_control(
205
  'icon_indent',
206
  [
207
- 'label' => __( 'Icon Spacing', 'elementor' ),
208
  'type' => Controls_Manager::SLIDER,
209
  'range' => [
210
  'px' => [
@@ -223,43 +179,78 @@ class ElementorModal extends Widget_Base {
223
  $this->add_control(
224
  'view',
225
  [
226
- 'label' => __( 'View', 'elementor' ),
227
  'type' => Controls_Manager::HIDDEN,
228
  'default' => 'traditional',
229
  ]
230
  );
231
  $this->end_controls_section();
 
232
  $this->start_controls_section(
233
- 'section_style',
234
  [
235
- 'label' => __( 'Button', 'elementor' ),
236
- 'tab' => Controls_Manager::TAB_STYLE,
237
  ]
238
  );
239
-
240
- $this->add_group_control(
241
- Group_Control_Typography::get_type(),
242
  [
243
- 'name' => 'typography',
244
- 'label' => __( 'Typography', 'elementor' ),
245
- 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
246
- 'selector' => '{{WRAPPER}} a.elementor-button',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  ]
248
  );
 
 
 
 
 
 
 
 
 
 
249
 
250
  $this->start_controls_tabs( 'tabs_button_style' );
251
 
252
  $this->start_controls_tab(
253
  'tab_button_normal',
254
  [
255
- 'label' => __( 'Normal', 'elementor' ),
256
  ]
257
  );
258
 
259
  $this->add_control(
260
  'button_text_color',
261
  [
262
- 'label' => __( 'Text Color', 'elementor' ),
263
  'type' => Controls_Manager::COLOR,
264
  'default' => '',
265
  'selectors' => [
@@ -271,7 +262,7 @@ class ElementorModal extends Widget_Base {
271
  $this->add_control(
272
  'background_color',
273
  [
274
- 'label' => __( 'Background Color', 'elementor' ),
275
  'type' => Controls_Manager::COLOR,
276
  'scheme' => [
277
  'type' => Scheme_Color::get_type(),
@@ -288,14 +279,14 @@ class ElementorModal extends Widget_Base {
288
  $this->start_controls_tab(
289
  'tab_button_hover',
290
  [
291
- 'label' => __( 'Hover', 'elementor' ),
292
  ]
293
  );
294
 
295
  $this->add_control(
296
  'hover_color',
297
  [
298
- 'label' => __( 'Text Color', 'elementor' ),
299
  'type' => Controls_Manager::COLOR,
300
  'selectors' => [
301
  '{{WRAPPER}} a.elementor-button:hover' => 'color: {{VALUE}};',
@@ -306,7 +297,7 @@ class ElementorModal extends Widget_Base {
306
  $this->add_control(
307
  'button_background_hover_color',
308
  [
309
- 'label' => __( 'Background Color', 'elementor' ),
310
  'type' => Controls_Manager::COLOR,
311
  'selectors' => [
312
  '{{WRAPPER}} a.elementor-button:hover' => 'background-color: {{VALUE}};',
@@ -317,7 +308,7 @@ class ElementorModal extends Widget_Base {
317
  $this->add_control(
318
  'button_hover_border_color',
319
  [
320
- 'label' => __( 'Border Color', 'elementor' ),
321
  'type' => Controls_Manager::COLOR,
322
  'condition' => [
323
  'border_border!' => '',
@@ -331,7 +322,7 @@ class ElementorModal extends Widget_Base {
331
  $this->add_control(
332
  'hover_animation',
333
  [
334
- 'label' => __( 'Animation', 'elementor' ),
335
  'type' => Controls_Manager::HOVER_ANIMATION,
336
  ]
337
  );
@@ -342,7 +333,7 @@ class ElementorModal extends Widget_Base {
342
  Group_Control_Border::get_type(),
343
  [
344
  'name' => 'border',
345
- 'label' => __( 'Border', 'elementor' ),
346
  'placeholder' => '1px',
347
  'default' => '1px',
348
  'selector' => '{{WRAPPER}} .elementor-button',
@@ -352,7 +343,7 @@ class ElementorModal extends Widget_Base {
352
  $this->add_control(
353
  'border_radius',
354
  [
355
- 'label' => __( 'Border Radius', 'elementor' ),
356
  'type' => Controls_Manager::DIMENSIONS,
357
  'size_units' => [ 'px', '%' ],
358
  'selectors' => [
@@ -372,7 +363,7 @@ class ElementorModal extends Widget_Base {
372
  $this->add_control(
373
  'text_padding',
374
  [
375
- 'label' => __( 'Text Padding', 'elementor' ),
376
  'type' => Controls_Manager::DIMENSIONS,
377
  'size_units' => [ 'px', 'em', '%' ],
378
  'selectors' => [
@@ -381,6 +372,16 @@ class ElementorModal extends Widget_Base {
381
  'separator' => 'before',
382
  ]
383
  );
 
 
 
 
 
 
 
 
 
 
384
 
385
  $this->end_controls_section();
386
 
@@ -388,13 +389,48 @@ class ElementorModal extends Widget_Base {
388
  $this->start_controls_section(
389
  'modalstyle',
390
  [
391
- 'label' => __( 'Modal Container', 'elementor' ),
392
  'tab' => Controls_Manager::TAB_STYLE,
393
  ]
394
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
395
 
396
  $this->add_group_control(
397
- Group_Control_Background::get_type(),
398
  [
399
  'name' => 'modal_bgcolor',
400
  'types' => [ 'classic', 'gradient' ],
@@ -408,114 +444,134 @@ class ElementorModal extends Widget_Base {
408
  $this->start_controls_section(
409
  'modalcontentstyle',
410
  [
411
- 'label' => __( 'Modal Content', 'elementor' ),
412
  'tab' => Controls_Manager::TAB_STYLE,
413
  ]
414
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
 
416
  $this->add_responsive_control(
417
- 'modal_content_width',
418
- [
419
- 'label' => __( 'Modal Width', 'elementor' ),
420
- 'type' => Controls_Manager::SLIDER,
421
- 'default' => [
422
- 'size' => 60,
423
- 'unit' => '%',
424
- ],
425
- 'range' => [
426
- 'px' => [
427
- 'min' => 0,
428
- 'max' => 1920,
429
- 'step' => 1,
430
- ],
431
- '%' => [
432
- 'min' => 25,
433
- 'max' => 100,
434
- ],
435
- ],
436
- 'size_units' => [ '%', 'px' ],
437
- 'selectors' => [
438
- '{{WRAPPER}} .modal-content' => 'width: {{SIZE}}{{UNIT}} !important;',
439
- ],
440
- ]
441
  );
442
 
443
- $this->add_responsive_control(
444
- 'modal_content_max_width',
445
- [
446
- 'label' => __( 'Modal Max-Width', 'elementor' ),
447
- 'type' => Controls_Manager::SLIDER,
448
- 'default' => [
449
- 'size' => 720,
450
- 'unit' => 'px',
451
- ],
452
- 'range' => [
453
- 'px' => [
454
- 'min' => 0,
455
- 'max' => 1920,
456
- 'step' => 1,
457
- ],
458
- '%' => [
459
- 'min' => 5,
460
- 'max' => 100,
461
- ],
462
- ],
463
- 'size_units' => [ '%', 'px' ],
464
- 'selectors' => [
465
- '{{WRAPPER}} .modal-content' => 'max-width: {{SIZE}}{{UNIT}} !important;',
466
- ],
467
- ]
468
  );
469
 
470
  $this->add_responsive_control(
471
- 'modal_content_top',
472
- [
473
- 'label' => __( 'Top Distance', 'elementor' ),
474
- 'type' => Controls_Manager::SLIDER,
475
- 'default' => [
476
- 'size' => 5,
477
- 'unit' => '%',
478
- ],
479
- 'range' => [
480
- 'px' => [
481
- 'min' => 0,
482
- 'max' => 1000,
483
- 'step' => 1,
484
- ],
485
- '%' => [
486
- 'min' => 0,
487
- 'max' => 100,
488
- ],
489
- ],
490
- 'size_units' => [ '%', 'px' ],
491
- 'selectors' => [
492
- '{{WRAPPER}} .modal-content' => 'margin-top: {{SIZE}}{{UNIT}};',
493
- ],
494
- ]
 
 
495
  );
496
 
497
- $this->add_responsive_control(
498
- 'modal_content_padding',
499
- [
500
- 'label' => __( 'Padding', 'elementor' ),
501
- 'type' => Controls_Manager::DIMENSIONS,
502
- 'size_units' => [ 'px', '%', 'em' ],
503
- 'default' => [
504
- 'top' => 0,
505
- 'left' => 0,
506
- 'right' => 0,
507
- 'bottom' => 0,
508
- ],
509
- 'selectors' => [
510
- '{{WRAPPER}} .modal-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
511
- ],
512
- ]
 
 
513
  );
514
 
515
  $this->end_controls_section();
516
 
517
-
518
-
519
  }
520
  protected function render() {
521
  $settings = $this->get_settings();
@@ -559,39 +615,33 @@ class ElementorModal extends Widget_Base {
559
  </div>
560
  <!-- /Popup trigger button -->
561
  <!-- Popup -->
562
- <div class="modal fade" id="popup-<?php echo $selectedPopup->post->ID; ?>" tabindex="-1" role="dialog" aria-labelledby="popup-<?php echo $selectedPopup->post->ID; ?>-label">
563
- <div class="modal-dialog" role="document">
564
  <div class="modal-content">
565
  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
566
- <div class="modal-body">
567
- <?php
568
- $frontend = new Frontend;
569
- echo $frontend->get_builder_content($selectedPopup->post->ID, true);
570
- ?>
571
- </div>
572
  </div>
573
- </div>
574
  </div>
 
 
 
 
 
 
 
 
 
 
 
575
  <?php
576
  wp_reset_postdata();
577
 
578
  }
579
  }
580
- protected function _content_template() {
581
- ?>
582
- <div class="elementor-button-wrapper">
583
- <a class="elementor-button elementor-button-{{ settings.button_type }} elementor-size-{{ settings.size }} elementor-animation-{{ settings.hover_animation }}" href="#">
584
- <span class="elementor-button-content-wrapper">
585
- <# if ( settings.icon ) { #>
586
- <span class="elementor-button-icon elementor-align-icon-{{ settings.icon_align }}">
587
- <i class="{{ settings.icon }}"></i>
588
- </span>
589
- <# } #>
590
- <span class="elementor-button-text">{{{ settings.text }}}</span>
591
- </span>
592
- </a>
593
- </div>
594
- <?php
595
- }
596
 
597
  }
17
 
18
  class ElementorModal extends Widget_Base {
19
 
20
+ protected $_has_template_content = false;
21
+
22
  public function get_name() {
23
  return 'popup';
24
  }
25
  public function get_title() {
26
+ return __( 'PopBox', 'modal-for-elementor' );
27
  }
28
  public function get_icon() {
29
  return 'eicon-button';
30
  }
31
  public function get_categories() {
32
+ return [ 'norewp-elements' ];
33
  }
34
  public static function get_button_sizes() {
35
  return [
36
+ 'xs' => __( 'Extra Small', 'modal-for-elementor' ),
37
+ 'sm' => __( 'Small', 'modal-for-elementor' ),
38
+ 'md' => __( 'Medium', 'modal-for-elementor' ),
39
+ 'lg' => __( 'Large', 'modal-for-elementor' ),
40
+ 'xl' => __( 'Extra Large', 'modal-for-elementor' ),
41
  ];
42
  }
43
  protected function get_popups() {
66
  }
67
  }
68
  protected function _register_controls() {
69
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  $this->start_controls_section(
71
  'section_button',
72
  [
73
+ 'label' => __( 'Trigger Button', 'modal-for-elementor' ),
74
  ]
75
  );
76
  $this->add_control(
77
  'button_type',
78
  [
79
+ 'label' => __( 'Type', 'modal-for-elementor' ),
80
  'type' => Controls_Manager::SELECT,
81
  'default' => '',
82
  'options' => [
83
+ '' => __( 'Default', 'modal-for-elementor' ),
84
+ 'info' => __( 'Info', 'modal-for-elementor' ),
85
+ 'success' => __( 'Success', 'modal-for-elementor' ),
86
+ 'warning' => __( 'Warning', 'modal-for-elementor' ),
87
+ 'danger' => __( 'Danger', 'modal-for-elementor' ),
88
  ],
89
  ]
90
  );
91
  $this->add_control(
92
  'text',
93
  [
94
+ 'label' => __( 'Text', 'modal-for-elementor' ),
95
  'type' => Controls_Manager::TEXT,
96
+ 'default' => __( 'Click me', 'modal-for-elementor' ),
97
+ 'placeholder' => __( 'Click me', 'modal-for-elementor' ),
98
  ]
99
  );
100
  $this->add_responsive_control(
101
  'align',
102
  [
103
+ 'label' => __( 'Alignment', 'modal-for-elementor' ),
104
  'type' => Controls_Manager::CHOOSE,
105
  'options' => [
106
  'left' => [
107
+ 'title' => __( 'Left', 'modal-for-elementor' ),
108
  'icon' => 'fa fa-align-left',
109
  ],
110
  'center' => [
111
+ 'title' => __( 'Center', 'modal-for-elementor' ),
112
  'icon' => 'fa fa-align-center',
113
  ],
114
  'right' => [
115
+ 'title' => __( 'Right', 'modal-for-elementor' ),
116
  'icon' => 'fa fa-align-right',
117
  ],
118
  'justify' => [
119
+ 'title' => __( 'Justified', 'modal-for-elementor' ),
120
  'icon' => 'fa fa-align-justify',
121
  ],
122
  ],
127
  $this->add_control(
128
  'size',
129
  [
130
+ 'label' => __( 'Size', 'modal-for-elementor' ),
131
  'type' => Controls_Manager::SELECT,
132
  'default' => 'sm',
133
  'options' => self::get_button_sizes(),
136
  $this->add_control(
137
  'icon',
138
  [
139
+ 'label' => __( 'Icon', 'modal-for-elementor' ),
140
  'type' => Controls_Manager::ICON,
141
  'label_block' => true,
142
  'default' => '',
145
  $this->add_control(
146
  'icon_align',
147
  [
148
+ 'label' => __( 'Icon Position', 'modal-for-elementor' ),
149
  'type' => Controls_Manager::SELECT,
150
  'default' => 'left',
151
  'options' => [
152
+ 'left' => __( 'Before', 'modal-for-elementor' ),
153
+ 'right' => __( 'After', 'modal-for-elementor' ),
154
  ],
155
  'condition' => [
156
  'icon!' => '',
160
  $this->add_control(
161
  'icon_indent',
162
  [
163
+ 'label' => __( 'Icon Spacing', 'modal-for-elementor' ),
164
  'type' => Controls_Manager::SLIDER,
165
  'range' => [
166
  'px' => [
179
  $this->add_control(
180
  'view',
181
  [
182
+ 'label' => __( 'View', 'modal-for-elementor' ),
183
  'type' => Controls_Manager::HIDDEN,
184
  'default' => 'traditional',
185
  ]
186
  );
187
  $this->end_controls_section();
188
+
189
  $this->start_controls_section(
190
+ 'section_popup',
191
  [
192
+ 'label' => __( 'Modal Content', 'modal-for-elementor' ),
 
193
  ]
194
  );
195
+ $this->add_control(
196
+ 'popup',
 
197
  [
198
+ 'label' => __( 'Select Modal Content', 'modal-for-elementor' ),
199
+ 'type' => Controls_Manager::SELECT,
200
+ 'default' => $this->get_popups()['first_popup'],
201
+ 'options' => $this->get_popups()['popups'],
202
+ ]
203
+ );
204
+
205
+ $this->add_control(
206
+ 'Close Button',
207
+ [
208
+ 'label' => __( 'Show Close Button', 'modal-for-elementor' ),
209
+ 'type' => Controls_Manager::SWITCHER,
210
+ 'label_off' => __( 'Hide', 'modal-for-elementor' ),
211
+ 'label_on' => __( 'Show', 'modal-for-elementor' ),
212
+ 'default' => 'yes',
213
+ 'selectors' => [
214
+ '{{WRAPPER}} button.close' => 'display: inherit;',
215
+ ],
216
+ ]
217
+ );
218
+
219
+ $this->add_control(
220
+ 'button_close_text_color',
221
+ [
222
+ 'label' => __( 'Close Button Color', 'modal-for-elementor' ),
223
+ 'type' => Controls_Manager::COLOR,
224
+ 'default' => '',
225
+ 'selectors' => [
226
+ '{{WRAPPER}} button.close' => 'color: {{VALUE}};',
227
+ ],
228
  ]
229
  );
230
+
231
+ $this->end_controls_section();
232
+
233
+ $this->start_controls_section(
234
+ 'section_style',
235
+ [
236
+ 'label' => __( 'Button', 'modal-for-elementor' ),
237
+ 'tab' => Controls_Manager::TAB_STYLE,
238
+ ]
239
+ );
240
 
241
  $this->start_controls_tabs( 'tabs_button_style' );
242
 
243
  $this->start_controls_tab(
244
  'tab_button_normal',
245
  [
246
+ 'label' => __( 'Normal', 'modal-for-elementor' ),
247
  ]
248
  );
249
 
250
  $this->add_control(
251
  'button_text_color',
252
  [
253
+ 'label' => __( 'Text Color', 'modal-for-elementor' ),
254
  'type' => Controls_Manager::COLOR,
255
  'default' => '',
256
  'selectors' => [
262
  $this->add_control(
263
  'background_color',
264
  [
265
+ 'label' => __( 'Background Color', 'modal-for-elementor' ),
266
  'type' => Controls_Manager::COLOR,
267
  'scheme' => [
268
  'type' => Scheme_Color::get_type(),
279
  $this->start_controls_tab(
280
  'tab_button_hover',
281
  [
282
+ 'label' => __( 'Hover', 'modal-for-elementor' ),
283
  ]
284
  );
285
 
286
  $this->add_control(
287
  'hover_color',
288
  [
289
+ 'label' => __( 'Text Color', 'modal-for-elementor' ),
290
  'type' => Controls_Manager::COLOR,
291
  'selectors' => [
292
  '{{WRAPPER}} a.elementor-button:hover' => 'color: {{VALUE}};',
297
  $this->add_control(
298
  'button_background_hover_color',
299
  [
300
+ 'label' => __( 'Background Color', 'modal-for-elementor' ),
301
  'type' => Controls_Manager::COLOR,
302
  'selectors' => [
303
  '{{WRAPPER}} a.elementor-button:hover' => 'background-color: {{VALUE}};',
308
  $this->add_control(
309
  'button_hover_border_color',
310
  [
311
+ 'label' => __( 'Border Color', 'modal-for-elementor' ),
312
  'type' => Controls_Manager::COLOR,
313
  'condition' => [
314
  'border_border!' => '',
322
  $this->add_control(
323
  'hover_animation',
324
  [
325
+ 'label' => __( 'Animation', 'modal-for-elementor' ),
326
  'type' => Controls_Manager::HOVER_ANIMATION,
327
  ]
328
  );
333
  Group_Control_Border::get_type(),
334
  [
335
  'name' => 'border',
336
+ 'label' => __( 'Border', 'modal-for-elementor' ),
337
  'placeholder' => '1px',
338
  'default' => '1px',
339
  'selector' => '{{WRAPPER}} .elementor-button',
343
  $this->add_control(
344
  'border_radius',
345
  [
346
+ 'label' => __( 'Border Radius', 'modal-for-elementor' ),
347
  'type' => Controls_Manager::DIMENSIONS,
348
  'size_units' => [ 'px', '%' ],
349
  'selectors' => [
363
  $this->add_control(
364
  'text_padding',
365
  [
366
+ 'label' => __( 'Text Padding', 'modal-for-elementor' ),
367
  'type' => Controls_Manager::DIMENSIONS,
368
  'size_units' => [ 'px', 'em', '%' ],
369
  'selectors' => [
372
  'separator' => 'before',
373
  ]
374
  );
375
+
376
+ $this->add_group_control(
377
+ Group_Control_Typography::get_type(),
378
+ [
379
+ 'name' => 'typography',
380
+ 'label' => __( 'Typography', 'modal-for-elementor' ),
381
+ 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
382
+ 'selector' => '{{WRAPPER}} a.elementor-button',
383
+ ]
384
+ );
385
 
386
  $this->end_controls_section();
387
 
389
  $this->start_controls_section(
390
  'modalstyle',
391
  [
392
+ 'label' => __( 'Modal Container', 'modal-for-elementor' ),
393
  'tab' => Controls_Manager::TAB_STYLE,
394
  ]
395
  );
396
+
397
+ $this->add_responsive_control(
398
+ 'modal_content_max_width',
399
+ [
400
+ 'label' => __( 'Container Max-Width', 'modal-for-elementor' ),
401
+ 'type' => Controls_Manager::SLIDER,
402
+ 'default' => [
403
+ 'size' => 720,
404
+ 'unit' => 'px',
405
+ ],
406
+ 'range' => [
407
+ 'px' => [
408
+ 'min' => 0,
409
+ 'max' => 1920,
410
+ 'step' => 1,
411
+ ],
412
+ '%' => [
413
+ 'min' => 5,
414
+ 'max' => 100,
415
+ ],
416
+ ],
417
+ 'size_units' => [ '%', 'px' ],
418
+ 'selectors' => [
419
+ '{{WRAPPER}} .modal-content' => 'max-width: {{SIZE}}{{UNIT}} !important;',
420
+ ],
421
+ ]
422
+ );
423
+
424
+ $this->add_control(
425
+ 'overlay_hint',
426
+ [
427
+ 'label' => __( 'Select and configure the required modal overlay background type below', 'modal-for-elementor' ),
428
+ 'type' => Controls_Manager::RAW_HTML,
429
+ ]
430
+ );
431
 
432
  $this->add_group_control(
433
+ Group_Control_Background::get_type(),
434
  [
435
  'name' => 'modal_bgcolor',
436
  'types' => [ 'classic', 'gradient' ],
444
  $this->start_controls_section(
445
  'modalcontentstyle',
446
  [
447
+ 'label' => __( 'Modal Content', 'modal-for-elementor' ),
448
  'tab' => Controls_Manager::TAB_STYLE,
449
  ]
450
  );
451
+
452
+ $this->add_control(
453
+ 'modal_window_hint',
454
+ [
455
+ 'label' => __( 'Select and configure the requeired popup modal window\'s background type below', 'extend-elements' ),
456
+ 'type' => Controls_Manager::RAW_HTML,
457
+ ]
458
+ );
459
+
460
+ $this->add_group_control(
461
+ Group_Control_Background::get_type(),
462
+ [
463
+ 'label' => __( 'Popup Window Background', 'modal-for-elementor' ),
464
+ 'name' => 'modal_window_bg',
465
+ 'types' => [ 'none', 'classic', 'gradient' ],
466
+ 'selector' => '{{WRAPPER}} .modal-content',
467
+ ]
468
+ );
469
 
470
  $this->add_responsive_control(
471
+ 'modal_content_width',
472
+ [
473
+ 'label' => __( 'Modal Width', 'modal-for-elementor' ),
474
+ 'type' => Controls_Manager::SLIDER,
475
+ 'default' => [
476
+ 'size' => 60,
477
+ 'unit' => '%',
478
+ ],
479
+ 'range' => [
480
+ 'px' => [
481
+ 'min' => 0,
482
+ 'max' => 1920,
483
+ 'step' => 1,
484
+ ],
485
+ '%' => [
486
+ 'min' => 25,
487
+ 'max' => 100,
488
+ ],
489
+ ],
490
+ 'size_units' => [ '%', 'px' ],
491
+ 'selectors' => [
492
+ '{{WRAPPER}} .modal-content' => 'width: {{SIZE}}{{UNIT}} !important;',
493
+ ],
494
+ ]
495
  );
496
 
497
+ $this->add_responsive_control(
498
+ 'modal_content_top',
499
+ [
500
+ 'label' => __( 'Top Offset', 'modal-for-elementor' ),
501
+ 'type' => Controls_Manager::SLIDER,
502
+ 'default' => [
503
+ 'size' => 5,
504
+ 'unit' => '%',
505
+ ],
506
+ 'range' => [
507
+ 'px' => [
508
+ 'min' => 0,
509
+ 'max' => 1000,
510
+ 'step' => 1,
511
+ ],
512
+ '%' => [
513
+ 'min' => 0,
514
+ 'max' => 100,
515
+ ],
516
+ ],
517
+ 'size_units' => [ '%', 'px' ],
518
+ 'selectors' => [
519
+ '{{WRAPPER}} .modal-content' => 'margin-top: {{SIZE}}{{UNIT}};',
520
+ ],
521
+ ]
522
  );
523
 
524
  $this->add_responsive_control(
525
+ 'modal_content_padding',
526
+ [
527
+ 'label' => __( 'Padding', 'modal-for-elementor' ),
528
+ 'type' => Controls_Manager::DIMENSIONS,
529
+ 'size_units' => [ 'px', '%', 'em' ],
530
+ 'default' => [
531
+ 'top' => 0,
532
+ 'left' => 0,
533
+ 'right' => 0,
534
+ 'bottom' => 0,
535
+ ],
536
+ 'selectors' => [
537
+ '{{WRAPPER}} .modal-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
538
+ ],
539
+ ]
540
+ );
541
+
542
+ $this->add_group_control(
543
+ Group_Control_Border::get_type(),
544
+ [
545
+ 'name' => 'modal_border',
546
+ 'label' => __( 'Border', 'modal-for-elementor' ),
547
+ 'placeholder' => '1px',
548
+ 'default' => '1px',
549
+ 'selector' => '{{WRAPPER}} .modal-content',
550
+ ]
551
  );
552
 
553
+ $this->add_control(
554
+ 'modal_border_radius',
555
+ [
556
+ 'label' => __( 'Border Radius', 'modal-for-elementor' ),
557
+ 'type' => Controls_Manager::DIMENSIONS,
558
+ 'size_units' => [ 'px', '%' ],
559
+ 'selectors' => [
560
+ '{{WRAPPER}} .modal-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
561
+ ],
562
+ ]
563
+ );
564
+
565
+ $this->add_group_control(
566
+ Group_Control_Box_Shadow::get_type(),
567
+ [
568
+ 'name' => 'popbox_content_box_shadow',
569
+ 'selector' => '{{WRAPPER}} .modal-content',
570
+ ]
571
  );
572
 
573
  $this->end_controls_section();
574
 
 
 
575
  }
576
  protected function render() {
577
  $settings = $this->get_settings();
615
  </div>
616
  <!-- /Popup trigger button -->
617
  <!-- Popup -->
618
+ <div class="modal fade" id="popup-<?php echo $selectedPopup->post->ID; ?>" tabindex="-1" role="dialog" aria-labelledby="popup-<?php echo $selectedPopup->post->ID; ?>-label">
 
619
  <div class="modal-content">
620
  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
621
+ <div class="modal-body">
622
+ <?php
623
+ $frontend = new Frontend;
624
+ echo $frontend->get_builder_content($selectedPopup->post->ID, true);
625
+ ?>
626
+ </div>
627
  </div>
 
628
  </div>
629
+ <script type="text/javascript">
630
+ (function($) {
631
+ $('#popup-<?php echo $selectedPopup->post->ID; ?>').on('hide.bs.modal', function(e) {
632
+ var $if = $(e.delegateTarget).find('iframe');
633
+ var src = $if.attr("src");
634
+ $if.attr("src", '/empty.html');
635
+ $if.attr("src", src);
636
+ });
637
+ })(jQuery);
638
+ </script>
639
+ <!-- Popup -->
640
  <?php
641
  wp_reset_postdata();
642
 
643
  }
644
  }
645
+ protected function _content_template() {}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
646
 
647
  }