Easy Modal - Version 2.1.0

Version Description

Download this release

Release Info

Developer danieliser
Plugin Icon 128x128 Easy Modal
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.17 to 2.1.0

assets/images/addons/advanced-theme-editor.jpg DELETED
Binary file
assets/images/addons/age-verification.jpg DELETED
Binary file
assets/images/addons/auto-open.jpg DELETED
Binary file
assets/images/addons/exit-modals.jpg DELETED
Binary file
assets/images/addons/force-user-action.jpg DELETED
Binary file
assets/images/addons/login-modals.jpg DELETED
Binary file
assets/images/addons/premium-support.jpg DELETED
Binary file
assets/images/addons/pro-bundle.jpg DELETED
Binary file
assets/images/addons/pro-developer.jpg DELETED
Binary file
assets/images/addons/scroll-pops.jpg DELETED
Binary file
assets/images/addons/unlimited-themes.jpg DELETED
Binary file
classes/admin.php CHANGED
@@ -1,163 +1,166 @@
1
  <?php class EModal_Admin {
 
2
  public static $Updaters = array();
3
- public static function check_updates($slug = null)
4
- {
5
- if($slug !== null && !empty(self::$Updaters[$slug]))
6
- {
7
- self::$Updaters[$slug]->checkForUpdates();
8
- }
9
- elseif(!$slug)
10
- {
11
- foreach(self::$Updaters as $slug => $Updater)
12
- {
13
- $Updater->checkForUpdates();
14
- }
15
- }
16
- }
17
- public function __construct()
18
- {
19
-
20
  global $EModal_License, $EModal_Admin_Menu, $EModal_Admin_Editor, $EModal_Admin_Postmeta;
21
- $EModal_Admin_Menu = new EModal_Admin_Menu;
22
- $EModal_Admin_Editor = new EModal_Admin_Editor;
23
  $EModal_Admin_Postmeta = new EModal_Admin_Postmeta;
24
- $EModal_License = new EModal_License;
25
- if(emodal_get_option('EasyModal_Version') && emodal_get_option(EMCORE_SLUG.'_migration_approved'))
26
- {
27
  EModal_Migrate_Pre_V2::delete_all();
28
  }
29
- add_filter('plugin_action_links', array($this, 'action_links'), 10, 2);
30
 
31
- add_action("init", array($this, 'update_transient_plugin_slugs'));
32
 
33
- //add_filter ('pre_set_site_transient_update_plugins', array(&$this, 'transient_update_plugins'));
34
- //add_filter ('pre_set_transient_update_plugins', array(&$this, 'transient_update_plugins'));
35
 
36
- add_action('admin_init', array($this, 'reset_emodal_db'));
37
 
 
 
38
 
39
- if(is_emodal_admin_page())
40
- {
41
- add_action('admin_init', array($this, 'admin_init'));
42
- add_action('admin_head', array($this, 'admin_head'));
43
- add_action("admin_enqueue_scripts", array($this, 'styles'));
44
- add_action("admin_enqueue_scripts", array($this, 'scripts'));
45
- add_action('admin_print_footer_scripts', array($this,'admin_footer'),1000);
46
  }
47
  }
48
- public function transient_update_plugins($transient)
49
- {
 
 
 
 
 
 
 
 
 
 
50
  $addons = EModal_License::available_addons();
51
- if(!empty($addons))
52
- {
53
- foreach($addons as $addon)
54
- {
55
- $obj = new stdClass();
56
- $obj->slug = $addon->slug .'.php';
57
- $obj->new_version = !empty($addon->version) ? $addon->version : $addon->new_version;
58
- $obj->url = $addon->homepage;
59
- $obj->package = !empty($addon->download_url) ? $addon->download_url : null;
60
- $transient->checked[$addon->slug.'/'.$addon->slug.'.php'] = $obj->new_version;
61
- if(version_compare($transient->checked[$addon->slug.'/'.$addon->slug.'.php'], $obj->new_version) == -1)
62
- $transient->response[$addon->slug.'/'.$addon->slug.'.php'] = $obj;
63
- }
64
- }
65
- return $transient;
66
  }
67
- public function update_transient_plugin_slugs()
68
- {
69
  $transient = get_option( '_transient_plugin_slugs' );
70
- if($transient)
71
- {
72
- $save = false;
73
  $addons = EModal_License::available_addons();
74
- if(!empty($addons))
75
- {
76
- foreach($addons as $addon)
77
- {
78
- if(!in_array($addon->slug.'/'.$addon->slug.'.php', $transient))
79
- {
80
- $transient[] = $addon->slug.'/'.$addon->slug.'.php';
81
- $save = true;
82
  }
83
- }
 
 
 
84
  }
85
- if($save)
86
- {
87
- update_option('_transient_plugin_slugs', $transient);
88
- }
89
  }
90
  }
91
- public function admin_init()
92
- {
93
- call_user_func( array(apply_filters('emodal_admin_current_controller', 'EModal_Controller_Admin_Modals'), 'factory') );
 
 
 
94
  }
95
- public function admin_head()
96
- {
97
- if(!function_exists('wp_editor'))
98
  wp_tiny_mce();
 
99
  }
100
- public function admin_footer()
101
- {
102
- do_action('emodal_admin_footer');
103
  }
104
- public function styles()
105
- {
106
- wp_enqueue_style(EMCORE_SLUG.'-admin', EMCORE_URL.'/assets/styles/'.EMCORE_SLUG.'-admin.css', false, 0.1);
107
  }
108
- public function scripts()
109
- {
110
- if($_GET['page'] == emodal_admin_slug())
111
- {
112
- wp_enqueue_script('word-count');
113
- wp_enqueue_script('post');
114
- wp_enqueue_script('editor');
115
- wp_enqueue_script('media-upload');
116
- }
117
- elseif($_GET['page'] == emodal_admin_slug('themes'))
118
- {
119
- wp_enqueue_style('wp-color-picker');
120
- wp_enqueue_script('jquery-ui-slider');
121
  }
122
- wp_enqueue_script(EMCORE_SLUG.'-admin', EMCORE_URL.'/assets/scripts/'.EMCORE_SLUG.'-admin.js', array('jquery', 'wp-color-picker', 'jquery-ui-slider'/*, 'jquery-ui-core', 'jquery-ui-slider', 'jquery-colorpicker'*/));
 
 
 
 
 
123
  }
124
- public function action_links($links, $file)
125
- {
126
- if($file == plugin_basename(EMCORE))
127
- {
128
- foreach(apply_filters('emodal_action_links', array(
129
- 'settings' => '<a href="'.emodal_admin_url('settings') .'">'.__('Settings', 'easy-modal' ).'</a>',
130
- 'gopro' => '<a href="https://easy-modal.com/pricing?utm_source=em-free&utm_medium=plugins+page&utm_campaign=go+pro" target="_blank">'.__('Go Pro', 'easy-modal' ).'</a>',
131
- )) as $link)
132
- {
133
  array_unshift( $links, $link );
134
  }
135
  }
 
136
  return $links;
137
  }
 
138
  public function reset_emodal_db() {
139
 
140
 
141
- if( isset( $_POST['remove_old_emodal_data'] ) ) {
142
 
143
  // run a quick security check
144
- if( ! check_admin_referer( EMCORE_NONCE, EMCORE_NONCE ) )
145
- return; // get out if we didn't click the Activate button
 
146
 
147
  global $wpdb;
148
 
149
  $wpdb->query( "DELETE FROM $wpdb->options WHERE `option_name` LIKE 'EasyModal%';" );
150
 
151
- do_action('remove_old_emodal_data');
152
 
153
  }
154
 
155
 
156
- if( isset( $_POST['reset_emodal_db'] ) ) {
157
 
158
  // run a quick security check
159
- if( ! check_admin_referer( EMCORE_NONCE, EMCORE_NONCE ) )
160
- return; // get out if we didn't click the Activate button
 
161
 
162
  global $wpdb;
163
  $wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_modal_metas`;" );
@@ -165,9 +168,9 @@
165
  $wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_theme_metas`;" );
166
  $wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_themes`;" );
167
 
168
- emodal_delete_option(EMCORE_SLUG.'_db_version');
169
 
170
- do_action('emodal_db_update', false);
171
 
172
  /*
173
  $wpdb->query( "DELETE FROM $wpdb->em_modal_metas" );
@@ -175,19 +178,19 @@
175
  $wpdb->query( "DELETE FROM $wpdb->em_theme_metas" );
176
  $wpdb->query( "DELETE FROM $wpdb->em_themes" );
177
  */
178
- do_action('emodal_reset_db');
179
 
180
  }
181
 
182
 
183
- if( isset( $_POST['migrate_emodal_db'] ) ) {
184
 
185
  // run a quick security check
186
- if( ! check_admin_referer( EMCORE_NONCE, EMCORE_NONCE ) )
187
- return; // get out if we didn't click the Activate button
 
188
 
189
- if(emodal_get_option('EasyModal_Version'))
190
- {
191
  global $wpdb;
192
  $wpdb->query( "DELETE FROM $wpdb->em_modal_metas" );
193
  $wpdb->query( "DELETE FROM $wpdb->em_modals" );
@@ -195,17 +198,18 @@
195
  $wpdb->query( "DELETE FROM $wpdb->em_themes" );
196
  new EModal_Migrate_Pre_V2;
197
 
198
- do_action('emodal_migrate_db');
199
  }
200
 
201
  }
202
 
203
 
204
- if( isset( $_POST['uninstall_emodal_db'] ) ) {
205
 
206
  // run a quick security check
207
- if( ! check_admin_referer( EMCORE_NONCE, EMCORE_NONCE ) )
208
- return; // get out if we didn't click the Activate button
 
209
 
210
  global $wpdb;
211
  $wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_modal_metas`;" );
@@ -215,23 +219,61 @@
215
 
216
  $wpdb->query( "DELETE FROM $wpdb->options WHERE `option_name` LIKE 'easy-modal%';" );
217
 
218
- do_action('emodal_uninstall');
 
 
 
 
219
 
220
- emodal_update_option( EMCORE_SLUG.'_uninstalled', true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  }
222
  }
223
 
224
  }
225
 
226
- add_filter('emodal_admin_current_controller', 'emodal_admin_current_controller', 1);
227
- function emodal_admin_current_controller($controller)
228
- {
229
- switch($_GET['page'])
230
- {
231
- case emodal_admin_slug('themes'): $controller = 'EModal_Controller_Admin_Theme'; break;
232
- case emodal_admin_slug('settings'): $controller = 'EModal_Controller_Admin_Settings'; break;
233
- case emodal_admin_slug('addons'): $controller = 'EModal_Controller_Admin_Addons'; break;
234
- case emodal_admin_slug('help'): $controller = 'EModal_Controller_Admin_Help'; break;
 
 
 
 
 
 
235
  }
 
236
  return $controller;
237
  }
1
  <?php class EModal_Admin {
2
+
3
  public static $Updaters = array();
4
+
5
+ public function __construct() {
6
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  global $EModal_License, $EModal_Admin_Menu, $EModal_Admin_Editor, $EModal_Admin_Postmeta;
8
+ $EModal_Admin_Menu = new EModal_Admin_Menu;
9
+ $EModal_Admin_Editor = new EModal_Admin_Editor;
10
  $EModal_Admin_Postmeta = new EModal_Admin_Postmeta;
11
+ $EModal_License = new EModal_License;
12
+ if ( emodal_get_option( 'EasyModal_Version' ) && emodal_get_option( EMCORE_SLUG . '_migration_approved' ) ) {
 
13
  EModal_Migrate_Pre_V2::delete_all();
14
  }
15
+ add_filter( 'plugin_action_links', array( $this, 'action_links' ), 10, 2 );
16
 
17
+ add_action( "init", array( $this, 'update_transient_plugin_slugs' ) );
18
 
19
+ //add_filter ('pre_set_site_transient_update_plugins', array(&$this, 'transient_update_plugins'));
20
+ //add_filter ('pre_set_transient_update_plugins', array(&$this, 'transient_update_plugins'));
21
 
22
+ add_action( 'admin_init', array( $this, 'reset_emodal_db' ) );
23
 
24
+ add_action( 'admin_notices', array( $this, 'popup_maker_notice' ) );
25
+ add_action( 'admin_init', array( $this, 'dismiss_popup_maker_notice' ) );
26
 
27
+
28
+ if ( is_emodal_admin_page() ) {
29
+ add_action( 'admin_init', array( $this, 'admin_init' ) );
30
+ add_action( 'admin_head', array( $this, 'admin_head' ) );
31
+ add_action( "admin_enqueue_scripts", array( $this, 'styles' ) );
32
+ add_action( "admin_enqueue_scripts", array( $this, 'scripts' ) );
33
+ add_action( 'admin_print_footer_scripts', array( $this, 'admin_footer' ), 1000 );
34
  }
35
  }
36
+
37
+ public static function check_updates( $slug = null ) {
38
+ if ( $slug !== null && ! empty( self::$Updaters[ $slug ] ) ) {
39
+ self::$Updaters[ $slug ]->checkForUpdates();
40
+ } elseif ( ! $slug ) {
41
+ foreach ( self::$Updaters as $slug => $Updater ) {
42
+ $Updater->checkForUpdates();
43
+ }
44
+ }
45
+ }
46
+
47
+ public function transient_update_plugins( $transient ) {
48
  $addons = EModal_License::available_addons();
49
+ if ( ! empty( $addons ) ) {
50
+ foreach ( $addons as $addon ) {
51
+ $obj = new stdClass();
52
+ $obj->slug = $addon->slug . '.php';
53
+ $obj->new_version = ! empty( $addon->version ) ? $addon->version : $addon->new_version;
54
+ $obj->url = $addon->homepage;
55
+ $obj->package = ! empty( $addon->download_url ) ? $addon->download_url : null;
56
+ $transient->checked[ $addon->slug . '/' . $addon->slug . '.php' ] = $obj->new_version;
57
+ if ( version_compare( $transient->checked[ $addon->slug . '/' . $addon->slug . '.php' ], $obj->new_version ) == - 1 ) {
58
+ $transient->response[ $addon->slug . '/' . $addon->slug . '.php' ] = $obj;
59
+ }
60
+ }
61
+ }
62
+
63
+ return $transient;
64
  }
65
+
66
+ public function update_transient_plugin_slugs() {
67
  $transient = get_option( '_transient_plugin_slugs' );
68
+ if ( $transient ) {
69
+ $save = false;
 
70
  $addons = EModal_License::available_addons();
71
+ if ( ! empty( $addons ) ) {
72
+ foreach ( $addons as $addon ) {
73
+ if ( ! in_array( $addon->slug . '/' . $addon->slug . '.php', $transient ) ) {
74
+ $transient[] = $addon->slug . '/' . $addon->slug . '.php';
75
+ $save = true;
 
 
 
76
  }
77
+ }
78
+ }
79
+ if ( $save ) {
80
+ update_option( '_transient_plugin_slugs', $transient );
81
  }
 
 
 
 
82
  }
83
  }
84
+
85
+ public function admin_init() {
86
+ call_user_func( array(
87
+ apply_filters( 'emodal_admin_current_controller', 'EModal_Controller_Admin_Modals' ),
88
+ 'factory',
89
+ ) );
90
  }
91
+
92
+ public function admin_head() {
93
+ if ( ! function_exists( 'wp_editor' ) ) {
94
  wp_tiny_mce();
95
+ }
96
  }
97
+
98
+ public function admin_footer() {
99
+ do_action( 'emodal_admin_footer' );
100
  }
101
+
102
+ public function styles() {
103
+ wp_enqueue_style( EMCORE_SLUG . '-admin', EMCORE_URL . '/assets/styles/' . EMCORE_SLUG . '-admin.css', false, 0.1 );
104
  }
105
+
106
+ public function scripts() {
107
+ if ( $_GET['page'] == emodal_admin_slug() ) {
108
+ wp_enqueue_script( 'word-count' );
109
+ wp_enqueue_script( 'post' );
110
+ wp_enqueue_script( 'editor' );
111
+ wp_enqueue_script( 'media-upload' );
112
+ } elseif ( $_GET['page'] == emodal_admin_slug( 'themes' ) ) {
113
+ wp_enqueue_style( 'wp-color-picker' );
114
+ wp_enqueue_script( 'jquery-ui-slider' );
 
 
 
115
  }
116
+ wp_enqueue_script( EMCORE_SLUG . '-admin', EMCORE_URL . '/assets/scripts/' . EMCORE_SLUG . '-admin.js', array(
117
+ 'jquery',
118
+ 'wp-color-picker',
119
+ 'jquery-ui-slider'
120
+ /*, 'jquery-ui-core', 'jquery-ui-slider', 'jquery-colorpicker'*/
121
+ ) );
122
  }
123
+
124
+ public function action_links( $links, $file ) {
125
+ if ( $file == plugin_basename( EMCORE ) ) {
126
+ foreach (
127
+ apply_filters( 'emodal_action_links', array(
128
+ 'settings' => '<a href="' . emodal_admin_url( 'settings' ) . '">' . __( 'Settings', 'easy-modal' ) . '</a>',
129
+ 'gopro' => '<a href="https://easy-modal.com/pricing?utm_source=em-free&utm_medium=plugins+page&utm_campaign=go+pro" target="_blank">' . __( 'Go Pro', 'easy-modal' ) . '</a>',
130
+ ) ) as $link
131
+ ) {
132
  array_unshift( $links, $link );
133
  }
134
  }
135
+
136
  return $links;
137
  }
138
+
139
  public function reset_emodal_db() {
140
 
141
 
142
+ if ( isset( $_POST['remove_old_emodal_data'] ) ) {
143
 
144
  // run a quick security check
145
+ if ( ! check_admin_referer( EMCORE_NONCE, EMCORE_NONCE ) ) {
146
+ return;
147
+ } // get out if we didn't click the Activate button
148
 
149
  global $wpdb;
150
 
151
  $wpdb->query( "DELETE FROM $wpdb->options WHERE `option_name` LIKE 'EasyModal%';" );
152
 
153
+ do_action( 'remove_old_emodal_data' );
154
 
155
  }
156
 
157
 
158
+ if ( isset( $_POST['reset_emodal_db'] ) ) {
159
 
160
  // run a quick security check
161
+ if ( ! check_admin_referer( EMCORE_NONCE, EMCORE_NONCE ) ) {
162
+ return;
163
+ } // get out if we didn't click the Activate button
164
 
165
  global $wpdb;
166
  $wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_modal_metas`;" );
168
  $wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_theme_metas`;" );
169
  $wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_themes`;" );
170
 
171
+ emodal_delete_option( EMCORE_SLUG . '_db_version' );
172
 
173
+ do_action( 'emodal_db_update', false );
174
 
175
  /*
176
  $wpdb->query( "DELETE FROM $wpdb->em_modal_metas" );
178
  $wpdb->query( "DELETE FROM $wpdb->em_theme_metas" );
179
  $wpdb->query( "DELETE FROM $wpdb->em_themes" );
180
  */
181
+ do_action( 'emodal_reset_db' );
182
 
183
  }
184
 
185
 
186
+ if ( isset( $_POST['migrate_emodal_db'] ) ) {
187
 
188
  // run a quick security check
189
+ if ( ! check_admin_referer( EMCORE_NONCE, EMCORE_NONCE ) ) {
190
+ return;
191
+ } // get out if we didn't click the Activate button
192
 
193
+ if ( emodal_get_option( 'EasyModal_Version' ) ) {
 
194
  global $wpdb;
195
  $wpdb->query( "DELETE FROM $wpdb->em_modal_metas" );
196
  $wpdb->query( "DELETE FROM $wpdb->em_modals" );
198
  $wpdb->query( "DELETE FROM $wpdb->em_themes" );
199
  new EModal_Migrate_Pre_V2;
200
 
201
+ do_action( 'emodal_migrate_db' );
202
  }
203
 
204
  }
205
 
206
 
207
+ if ( isset( $_POST['uninstall_emodal_db'] ) ) {
208
 
209
  // run a quick security check
210
+ if ( ! check_admin_referer( EMCORE_NONCE, EMCORE_NONCE ) ) {
211
+ return;
212
+ } // get out if we didn't click the Activate button
213
 
214
  global $wpdb;
215
  $wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_modal_metas`;" );
219
 
220
  $wpdb->query( "DELETE FROM $wpdb->options WHERE `option_name` LIKE 'easy-modal%';" );
221
 
222
+ do_action( 'emodal_uninstall' );
223
+
224
+ emodal_update_option( EMCORE_SLUG . '_uninstalled', true );
225
+ }
226
+ }
227
 
228
+ public function popup_maker_notice() {
229
+ $user_id = get_current_user_id();
230
+ if ( ! get_user_meta( $user_id, 'emodal_popup_maker_notice_dismissed' ) ) {
231
+ $url = esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=popup-maker' ), 'install-plugin_popup-maker' ) );
232
+ ?>
233
+ <div class="notice notice-success" style="position: relative;">
234
+ <a style="text-decoration: none;" href="?emodal-dismiss-popup-maker-notice" class="notice-dismiss">
235
+ <span class="screen-reader-text"><?php _e( 'Dismiss this notice.' ); ?></span>
236
+ </a>
237
+ <p>Did you know, that Easy Modal has a fancy new replacement called <strong><a href="https://wordpress.org/plugins/popup-maker/" target="_blank">Popup Maker</a></strong>? It is the highest user rated popup & modal plugin available for WordPress.</p>
238
+ <ul class="ul-square">
239
+ <li>Unlimited themes</li>
240
+ <li>Precision Targeting, Triggers & Cookies</li>
241
+ <li>Customize everything</li>
242
+ <li>Full line of extensions</li>
243
+ <li>Extensive Documentation & Developer APIs</li>
244
+ <li><a href="https://wordpress.org/plugins/popup-maker/" target="_blank">Learn more</a> or <a href="<?php echo esc_url( $url ); ?>">Install it now!</a></li>
245
+ </ul>
246
+ </div>
247
+
248
+ <?php
249
+ }
250
+ }
251
+
252
+ public function dismiss_popup_maker_notice() {
253
+ $user_id = get_current_user_id();
254
+ if ( isset( $_GET['emodal-dismiss-popup-maker-notice'] ) ) {
255
+ add_user_meta( $user_id, 'emodal_popup_maker_notice_dismissed', 'true', true );
256
  }
257
  }
258
 
259
  }
260
 
261
+ add_filter( 'emodal_admin_current_controller', 'emodal_admin_current_controller', 1 );
262
+ function emodal_admin_current_controller( $controller ) {
263
+ switch ( $_GET['page'] ) {
264
+ case emodal_admin_slug( 'themes' ):
265
+ $controller = 'EModal_Controller_Admin_Theme';
266
+ break;
267
+ case emodal_admin_slug( 'settings' ):
268
+ $controller = 'EModal_Controller_Admin_Settings';
269
+ break;
270
+ case emodal_admin_slug( 'addons' ):
271
+ $controller = 'EModal_Controller_Admin_Addons';
272
+ break;
273
+ case emodal_admin_slug( 'help' ):
274
+ $controller = 'EModal_Controller_Admin_Help';
275
+ break;
276
  }
277
+
278
  return $controller;
279
  }
classes/controller/admin/modals.php CHANGED
@@ -1,194 +1,189 @@
1
  <?php class EModal_Controller_Admin_Modals extends EModal_Controller {
2
- static function factory()
3
- {
4
  self::$instance = new EModal_Controller_Admin_Modals;
5
- if(empty($_GET['action']))
6
- {
7
  self::$instance->action_index();
8
- }
9
- else
10
- {
11
- switch($_GET['action'])
12
- {
13
- case 'new': self::$instance->action_edit(); break;
14
- case 'edit': self::$instance->action_edit(); break;
15
- case 'clone': self::$instance->action_clone(); break;
16
- case 'delete': self::$instance->action_delete(); break;
17
- case 'untrash': self::$instance->action_untrash(); break;
18
- case 'empty_trash': self::$instance->action_trash(); break;
 
 
 
 
 
 
 
 
 
19
  }
20
  }
21
  }
22
- public function index_url()
23
- {
24
- return emodal_admin_url();
25
- }
26
- public function edit_url()
27
- {
28
- return emodal_admin_url() .'&action=edit&id='. get_current_modal_id();
29
- }
30
- public function new_url()
31
- {
32
- return emodal_admin_url() .'&action=new';
33
- }
34
- public function check_id()
35
- {
36
- if(empty($_GET['id']) && $_GET['action'] != 'new'){
37
- wp_redirect($this->index_url(), 302);
38
- exit();
39
- }
40
- return empty($_GET['id']) ? NULL : $_GET['id'];
41
- }
42
- public function action_index()
43
- {
44
  $view = new EModal_View_Admin_Modal_Index;
45
- $view->set('title', __('Modals', 'easy-modal' ));
46
- $view->set('modal_new_url', $this->new_url());
47
  self::$instance->view = $view;
48
  }
49
- public function action_edit()
50
- {
51
  global $current_modal;
52
- $current_modal = new EModal_Model_Modal($this->check_id());
53
- if($this->check_post_nonce())
54
- {
55
- $new_values = apply_filters('emodal_modal_pre_save', $current_modal->as_array());
56
- $current_modal->set_fields(apply_filters("emodal_model_modal_meta_defaults", $new_values));
57
- $current_modal->set_fields($new_values);
58
  $current_modal->save();
59
- if(!$current_modal->id)
60
- do_action('emodal_modal_new', $current_modal);
61
- do_action('emodal_modal_save', $current_modal);
62
- EModal_Admin_Notice::add($current_modal->id ? __('Modal Updated.', 'easy-modal' ) : __('Modal Created.', 'easy-modal' ), 'updated');
 
63
  $this->redirect_to_edit();
64
  }
65
  $view = new EModal_View_Admin_Modal_Form;
66
- $view->set('title', $current_modal->id ? __('Edit Modal', 'easy-modal' ) : __('Add New Modal', 'easy-modal' ));
67
- $view->set('modal_new_url', $this->new_url());
68
- $view->set('tabs', apply_filters('emodal_admin_modal_form_tabs', array()));
69
  self::$instance->view = $view;
70
  }
71
- public function action_clone()
72
- {
73
- if($this->check_get_nonce())
74
- {
75
  global $current_modal;
76
- $current_modal = new EModal_Model_Modal($this->check_id());
77
- $current_modal->id = NULL;
78
- $current_modal->meta->id = NULL;
79
  $current_modal->save();
80
- do_action('emodal_modal_clone', $current_modal);
81
- EModal_Admin_Notice::add(__('Modal cloned successfully', 'easy-modal' ), 'updated');
82
  $this->redirect_to_edit();
83
  }
84
- wp_redirect($this->index_url(), 302);
85
  exit();
86
  }
87
- public function action_delete()
88
- {
89
- if($this->check_get_nonce())
90
- {
91
- if(!empty($_GET['id']))
92
- {
93
- $ids = is_array($_GET['id']) ? $_GET['id'] : array($_GET['id']);
94
- }
95
- elseif(!empty($_GET['ids']))
96
- {
97
- $ids = $_GET['ids'];
98
- }
99
- elseif(!empty($_GET['modal']))
100
- {
101
- $ids = $_GET['modal'];
102
- }
103
- if(empty($ids))
104
- {
105
- EModal_Admin_Notice::add(__('No modals selected for deletion.', 'easy-modal' ), 'updated');
106
- wp_redirect($this->index_url(), 302);
 
 
107
  exit();
108
  }
109
  global $wpdb;
110
- $wpdb->query("UPDATE {$wpdb->prefix}em_modals SET is_trash = 1 WHERE id IN (".implode(',', $ids).")");
111
- do_action('emodal_modal_delete');
112
- EModal_Admin_Notice::add(count($ids) . __(' modals moved to the trash', 'easy-modal' ), 'updated');
113
  }
114
- wp_redirect($this->index_url(), 302);
115
  exit();
116
  }
117
- public function action_untrash()
118
- {
119
- if($this->check_get_nonce())
120
- {
121
- if(!empty($_GET['id']))
122
- {
123
- $ids = is_array($_GET['id']) ? $_GET['id'] : array($_GET['id']);
124
- }
125
- elseif(!empty($_GET['ids']))
126
- {
127
- $ids = $_GET['ids'];
128
- }
129
- elseif(!empty($_GET['modal']))
130
- {
131
- $ids = $_GET['modal'];
132
- }
133
- if(empty($ids))
134
- {
135
- EModal_Admin_Notice::add(__('No modals selected for undeletion.', 'easy-modal' ), 'updated');
136
- wp_redirect($this->index_url(), 302);
137
  exit();
138
  }
139
  global $wpdb;
140
- $wpdb->query("UPDATE {$wpdb->prefix}em_modals SET is_trash = 0 WHERE id IN ($ids)");
141
- EModal_Admin_Notice::add(count($ids) . __(' modal restored from trash.', 'easy-modal' ), 'updated');
142
- do_action('emodal_modal_untrash');
143
  }
144
- wp_redirect($this->index_url(), 302);
145
  exit();
146
  }
147
- public function action_trash()
148
- {
149
- if($this->check_get_nonce())
150
- {
151
  global $wpdb;
152
- $wpdb->delete( $wpdb->prefix.'em_modals', array('is_trash' => 1));
153
- EModal_Admin_Notice::add(__('Modal trash has been permanantly removed.', 'easy-modal' ), 'updated');
154
- do_action('emodal_modal_trash');
155
  }
156
- wp_redirect($this->index_url(), 302);
157
  exit();
158
  }
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  }
161
 
162
 
163
- add_filter('emodal_modal_pre_save', 'emodal_modal_pre_save', 1);
164
- function emodal_modal_pre_save($new_values)
165
- {
166
- $new_values['name'] = sanitize_text_field( empost('modal.name') );
167
- $new_values['theme_id'] = 1;
168
- $new_values['title'] = sanitize_text_field( empost('modal.title') );
169
- $new_values['content'] = balanceTags( empost('modal.content') );
170
- $new_values['is_sitewide'] = empost('modal.load_type') == 'sitewide' ? 1 : 0;
171
- $new_values['meta']['display']['overlay_disabled'] = empost('modal.meta.display.overlay_disabled') ? 1 : 0;
172
- $new_values['meta']['display']['size'] = empost('modal.meta.display.size');
173
- $new_values['meta']['display']['custom_width'] = floatval( empost('modal.meta.display.custom_width') );
174
- $new_values['meta']['display']['custom_width_unit'] = empost('modal.meta.display.custom_width_unit');
175
- $new_values['meta']['display']['custom_height_auto'] = empost('modal.meta.display.custom_height_auto') ? 1 : 0;
176
- $new_values['meta']['display']['custom_height'] = floatval( empost('modal.meta.display.custom_height') );
177
- $new_values['meta']['display']['custom_height_unit'] = empost('modal.meta.display.custom_height_unit');
178
- $new_values['meta']['display']['location'] = empost('modal.meta.display.location');
179
- $new_values['meta']['display']['position']['top'] = floatval( empost('modal.meta.display.position.top') );
180
- $new_values['meta']['display']['position']['left'] = floatval( empost('modal.meta.display.position.left') );
181
- $new_values['meta']['display']['position']['bottom'] = floatval( empost('modal.meta.display.position.bottom') );
182
- $new_values['meta']['display']['position']['right'] = floatval( empost('modal.meta.display.position.right') );
183
- $new_values['meta']['display']['position']['fixed'] = empost('modal.meta.display.position.fixed') ? 1 : 0;
184
-
185
-
186
-
187
- $new_values['meta']['display']['animation']['type'] = empost('modal.meta.display.animation.type');
188
- $new_values['meta']['display']['animation']['speed'] = empost('modal.meta.display.animation.speed');
189
- $new_values['meta']['display']['animation']['origin'] = empost('modal.meta.display.animation.origin');
190
- $new_values['meta']['close']['overlay_click'] = empost('modal.meta.close.overlay_click') ? 1 : 0;
191
- $new_values['meta']['close']['esc_press'] = empost('modal.meta.close.esc_press') ? 1 : 0;
192
 
193
  return $new_values;
194
  }
1
  <?php class EModal_Controller_Admin_Modals extends EModal_Controller {
2
+
3
+ static function factory() {
4
  self::$instance = new EModal_Controller_Admin_Modals;
5
+ if ( empty( $_GET['action'] ) ) {
 
6
  self::$instance->action_index();
7
+ } else {
8
+ switch ( $_GET['action'] ) {
9
+ case 'new':
10
+ self::$instance->action_edit();
11
+ break;
12
+ case 'edit':
13
+ self::$instance->action_edit();
14
+ break;
15
+ case 'clone':
16
+ self::$instance->action_clone();
17
+ break;
18
+ case 'delete':
19
+ self::$instance->action_delete();
20
+ break;
21
+ case 'untrash':
22
+ self::$instance->action_untrash();
23
+ break;
24
+ case 'empty_trash':
25
+ self::$instance->action_trash();
26
+ break;
27
  }
28
  }
29
  }
30
+
31
+ public function action_index() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  $view = new EModal_View_Admin_Modal_Index;
33
+ $view->set( 'title', __( 'Modals', 'easy-modal' ) );
34
+ $view->set( 'modal_new_url', $this->new_url() );
35
  self::$instance->view = $view;
36
  }
37
+
38
+ public function action_edit() {
39
  global $current_modal;
40
+ $current_modal = new EModal_Model_Modal( $this->check_id() );
41
+ if ( $this->check_post_nonce() ) {
42
+ $new_values = apply_filters( 'emodal_modal_pre_save', $current_modal->as_array() );
43
+ $current_modal->set_fields( apply_filters( "emodal_model_modal_meta_defaults", $new_values ) );
44
+ $current_modal->set_fields( $new_values );
 
45
  $current_modal->save();
46
+ if ( ! $current_modal->id ) {
47
+ do_action( 'emodal_modal_new', $current_modal );
48
+ }
49
+ do_action( 'emodal_modal_save', $current_modal );
50
+ EModal_Admin_Notice::add( $current_modal->id ? __( 'Modal Updated.', 'easy-modal' ) : __( 'Modal Created.', 'easy-modal' ), 'updated' );
51
  $this->redirect_to_edit();
52
  }
53
  $view = new EModal_View_Admin_Modal_Form;
54
+ $view->set( 'title', $current_modal->id ? __( 'Edit Modal', 'easy-modal' ) : __( 'Add New Modal', 'easy-modal' ) );
55
+ $view->set( 'modal_new_url', $this->new_url() );
56
+ $view->set( 'tabs', apply_filters( 'emodal_admin_modal_form_tabs', array() ) );
57
  self::$instance->view = $view;
58
  }
59
+
60
+ public function action_clone() {
61
+ if ( $this->check_get_nonce() ) {
 
62
  global $current_modal;
63
+ $current_modal = new EModal_Model_Modal( $this->check_id() );
64
+ $current_modal->id = null;
65
+ $current_modal->meta->id = null;
66
  $current_modal->save();
67
+ do_action( 'emodal_modal_clone', $current_modal );
68
+ EModal_Admin_Notice::add( __( 'Modal cloned successfully', 'easy-modal' ), 'updated' );
69
  $this->redirect_to_edit();
70
  }
71
+ wp_redirect( $this->index_url(), 302 );
72
  exit();
73
  }
74
+
75
+ public function request_ids() {
76
+ $ids = false;
77
+
78
+ if ( ! empty( $_GET['id'] ) ) {
79
+ $ids = is_array( $_GET['id'] ) ? $_GET['id'] : array( $_GET['id'] );
80
+ } elseif ( ! empty( $_GET['ids'] ) ) {
81
+ $ids = $_GET['ids'];
82
+ } elseif ( ! empty( $_GET['modal'] ) ) {
83
+ $ids = $_GET['modal'];
84
+ }
85
+
86
+ return wp_parse_id_list( $ids );
87
+ }
88
+
89
+ public function action_delete() {
90
+ if ( $this->check_get_nonce() ) {
91
+ $ids = $this->request_ids();
92
+
93
+ if ( empty( $ids ) ) {
94
+ EModal_Admin_Notice::add( __( 'No modals selected for deletion.', 'easy-modal' ), 'updated' );
95
+ wp_redirect( $this->index_url(), 302 );
96
  exit();
97
  }
98
  global $wpdb;
99
+ $wpdb->query( "UPDATE {$wpdb->prefix}em_modals SET is_trash = 1 WHERE id IN (" . implode( ',', $ids ) . ")" );
100
+ do_action( 'emodal_modal_delete' );
101
+ EModal_Admin_Notice::add( count( $ids ) . __( ' modals moved to the trash', 'easy-modal' ), 'updated' );
102
  }
103
+ wp_redirect( $this->index_url(), 302 );
104
  exit();
105
  }
106
+
107
+ public function action_untrash() {
108
+ if ( $this->check_get_nonce() ) {
109
+ $ids = $this->request_ids();
110
+
111
+ if ( empty( $ids ) ) {
112
+ EModal_Admin_Notice::add( __( 'No modals selected for undeletion.', 'easy-modal' ), 'updated' );
113
+ wp_redirect( $this->index_url(), 302 );
 
 
 
 
 
 
 
 
 
 
 
 
114
  exit();
115
  }
116
  global $wpdb;
117
+ $wpdb->query( "UPDATE {$wpdb->prefix}em_modals SET is_trash = 0 WHERE id IN ($ids)" );
118
+ EModal_Admin_Notice::add( count( $ids ) . __( ' modal restored from trash.', 'easy-modal' ), 'updated' );
119
+ do_action( 'emodal_modal_untrash' );
120
  }
121
+ wp_redirect( $this->index_url(), 302 );
122
  exit();
123
  }
124
+
125
+ public function action_trash() {
126
+ if ( $this->check_get_nonce() ) {
 
127
  global $wpdb;
128
+ $wpdb->delete( $wpdb->prefix . 'em_modals', array( 'is_trash' => 1 ) );
129
+ EModal_Admin_Notice::add( __( 'Modal trash has been permanantly removed.', 'easy-modal' ), 'updated' );
130
+ do_action( 'emodal_modal_trash' );
131
  }
132
+ wp_redirect( $this->index_url(), 302 );
133
  exit();
134
  }
135
 
136
+ public function new_url() {
137
+ return emodal_admin_url() . '&action=new';
138
+ }
139
+
140
+ public function check_id() {
141
+ if ( empty( $_GET['id'] ) && $_GET['action'] != 'new' ) {
142
+ wp_redirect( $this->index_url(), 302 );
143
+ exit();
144
+ }
145
+
146
+ return empty( $_GET['id'] ) ? null : $_GET['id'];
147
+ }
148
+
149
+ public function index_url() {
150
+ return emodal_admin_url();
151
+ }
152
+
153
+ public function edit_url() {
154
+ return emodal_admin_url() . '&action=edit&id=' . get_current_modal_id();
155
+ }
156
+
157
  }
158
 
159
 
160
+ add_filter( 'emodal_modal_pre_save', 'emodal_modal_pre_save', 1 );
161
+ function emodal_modal_pre_save( $new_values ) {
162
+ $new_values['name'] = sanitize_text_field( empost( 'modal.name' ) );
163
+ $new_values['theme_id'] = 1;
164
+ $new_values['title'] = sanitize_text_field( empost( 'modal.title' ) );
165
+ $new_values['content'] = balanceTags( empost( 'modal.content' ) );
166
+ $new_values['is_sitewide'] = empost( 'modal.load_type' ) == 'sitewide' ? 1 : 0;
167
+ $new_values['meta']['display']['overlay_disabled'] = empost( 'modal.meta.display.overlay_disabled' ) ? 1 : 0;
168
+ $new_values['meta']['display']['size'] = empost( 'modal.meta.display.size' );
169
+ $new_values['meta']['display']['custom_width'] = floatval( empost( 'modal.meta.display.custom_width' ) );
170
+ $new_values['meta']['display']['custom_width_unit'] = empost( 'modal.meta.display.custom_width_unit' );
171
+ $new_values['meta']['display']['custom_height_auto'] = empost( 'modal.meta.display.custom_height_auto' ) ? 1 : 0;
172
+ $new_values['meta']['display']['custom_height'] = floatval( empost( 'modal.meta.display.custom_height' ) );
173
+ $new_values['meta']['display']['custom_height_unit'] = empost( 'modal.meta.display.custom_height_unit' );
174
+ $new_values['meta']['display']['location'] = empost( 'modal.meta.display.location' );
175
+ $new_values['meta']['display']['position']['top'] = floatval( empost( 'modal.meta.display.position.top' ) );
176
+ $new_values['meta']['display']['position']['left'] = floatval( empost( 'modal.meta.display.position.left' ) );
177
+ $new_values['meta']['display']['position']['bottom'] = floatval( empost( 'modal.meta.display.position.bottom' ) );
178
+ $new_values['meta']['display']['position']['right'] = floatval( empost( 'modal.meta.display.position.right' ) );
179
+ $new_values['meta']['display']['position']['fixed'] = empost( 'modal.meta.display.position.fixed' ) ? 1 : 0;
180
+
181
+
182
+ $new_values['meta']['display']['animation']['type'] = empost( 'modal.meta.display.animation.type' );
183
+ $new_values['meta']['display']['animation']['speed'] = empost( 'modal.meta.display.animation.speed' );
184
+ $new_values['meta']['display']['animation']['origin'] = empost( 'modal.meta.display.animation.origin' );
185
+ $new_values['meta']['close']['overlay_click'] = empost( 'modal.meta.close.overlay_click' ) ? 1 : 0;
186
+ $new_values['meta']['close']['esc_press'] = empost( 'modal.meta.close.esc_press' ) ? 1 : 0;
 
 
187
 
188
  return $new_values;
189
  }
classes/controller/admin/theme.php CHANGED
@@ -1,106 +1,104 @@
1
  <?php class EModal_Controller_Admin_Theme extends EModal_Controller {
2
- static function factory()
3
- {
4
  self::$instance = new EModal_Controller_Admin_Theme;
5
  self::$instance->action_edit();
6
  }
7
- public function index_url()
8
- {
9
- return emodal_admin_url('themes');
10
- }
11
- public function edit_url()
12
- {
13
- return $this->index_url();
14
- }
15
- public function check_id()
16
- {
17
- return 1;
18
- }
19
- public function action_edit()
20
- {
21
  global $current_theme;
22
- $current_theme = new EModal_Model_Theme($this->check_id());
23
- if($this->check_post_nonce())
24
- {
25
- $new_values = apply_filters('emodal_theme_pre_save', $current_theme->as_array());
26
- $current_theme->set_fields(apply_filters("emodal_model_theme_meta_defaults", $new_values));
27
  $current_theme->save();
28
- do_action('emodal_theme_save', $current_theme);
29
- EModal_Admin_Notice::add(__('Theme Updated.', 'easy-modal' ), 'updated');
30
  $this->redirect_to_edit();
31
  }
32
  $view = new EModal_View_Admin_Theme_Form;
33
- $view->set('title', __('Edit Theme', 'easy-modal' ));
34
- $view->set('tabs', apply_filters('emodal_admin_theme_form_tabs', array()));
35
  self::$instance->view = $view;
36
  }
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
 
39
 
40
- add_filter('emodal_theme_pre_save', 'emodal_theme_pre_save', 1);
41
- function emodal_theme_pre_save($new_values)
42
- {
43
- $new_values['name'] = sanitize_text_field( empost('theme.name') );
 
 
44
 
45
- $new_values['meta']['overlay']['background']['color'] = sanitize_text_field( empost('theme.meta.overlay.background.color') );
46
- $new_values['meta']['overlay']['background']['opacity'] = floatval( empost('theme.meta.overlay.background.opacity') );
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
- $new_values['meta']['container']['padding'] = floatval( empost('theme.meta.container.padding') );
49
- $new_values['meta']['container']['background']['color'] = sanitize_text_field( empost('theme.meta.container.background.color') );
50
- $new_values['meta']['container']['background']['opacity'] = floatval( empost('theme.meta.container.background.opacity') );
51
- $new_values['meta']['container']['border']['style'] = empost('theme.meta.container.border.style');
52
- $new_values['meta']['container']['border']['color'] = sanitize_text_field( empost('theme.meta.container.border.color') );
53
- $new_values['meta']['container']['border']['width'] = floatval( empost('theme.meta.container.border.width') );
54
- $new_values['meta']['container']['border']['radius'] = floatval( empost('theme.meta.container.border.radius') );
55
- $new_values['meta']['container']['boxshadow']['inset'] = empost('theme.meta.container.boxshadow.inset');
56
- $new_values['meta']['container']['boxshadow']['horizontal'] = floatval( empost('theme.meta.container.boxshadow.horizontal') );
57
- $new_values['meta']['container']['boxshadow']['vertical'] = floatval( empost('theme.meta.container.boxshadow.vertical') );
58
- $new_values['meta']['container']['boxshadow']['blur'] = floatval( empost('theme.meta.container.boxshadow.blur') );
59
- $new_values['meta']['container']['boxshadow']['spread'] = floatval( empost('theme.meta.container.boxshadow.spread') );
60
- $new_values['meta']['container']['boxshadow']['color'] = sanitize_text_field( empost('theme.meta.container.boxshadow.color') );
61
- $new_values['meta']['container']['boxshadow']['opacity'] = floatval( empost('theme.meta.container.boxshadow.opacity') );
62
 
63
- $new_values['meta']['title']['font']['color'] = sanitize_text_field( empost('theme.meta.title.font.color') );
64
- $new_values['meta']['title']['font']['size'] = floatval( empost('theme.meta.title.font.size') );
65
- $new_values['meta']['title']['font']['family'] = empost('theme.meta.title.font.family');
66
- $new_values['meta']['title']['text']['align'] = empost('theme.meta.title.text.align');
67
- $new_values['meta']['title']['textshadow']['horizontal'] = floatval( empost('theme.meta.title.textshadow.horizontal') );
68
- $new_values['meta']['title']['textshadow']['vertical'] = floatval( empost('theme.meta.title.textshadow.vertical') );
69
- $new_values['meta']['title']['textshadow']['blur'] = floatval( empost('theme.meta.title.textshadow.blur') );
70
- $new_values['meta']['title']['textshadow']['color'] = sanitize_text_field( empost('theme.meta.title.textshadow.color') );
71
- $new_values['meta']['title']['textshadow']['opacity'] = floatval( empost('theme.meta.title.textshadow.opacity') );
72
 
73
- $new_values['meta']['content']['font']['color'] = sanitize_text_field( empost('theme.meta.content.font.color') );
74
- $new_values['meta']['content']['font']['family'] = empost('theme.meta.content.font.family');
75
-
76
- $new_values['meta']['close']['text'] = sanitize_text_field( empost('theme.meta.close.text') );
77
- $new_values['meta']['close']['location'] = empost('theme.meta.close.location');
78
- $new_values['meta']['close']['position']['top'] = empost('theme.meta.close.position.top');
79
- $new_values['meta']['close']['position']['left'] = empost('theme.meta.close.position.left');
80
- $new_values['meta']['close']['position']['bottom'] = empost('theme.meta.close.position.bottom');
81
- $new_values['meta']['close']['position']['right'] = empost('theme.meta.close.position.right');
82
- $new_values['meta']['close']['padding'] = floatval( empost('theme.meta.close.padding') );
83
- $new_values['meta']['close']['background']['color'] = sanitize_text_field( empost('theme.meta.close.background.color') );
84
- $new_values['meta']['close']['background']['opacity'] = floatval( empost('theme.meta.close.background.opacity') );
85
- $new_values['meta']['close']['font']['color'] = sanitize_text_field( empost('theme.meta.close.font.color') );
86
- $new_values['meta']['close']['font']['size'] = floatval( empost('theme.meta.close.font.size') );
87
- $new_values['meta']['close']['font']['family'] = empost('theme.meta.close.font.family');
88
- $new_values['meta']['close']['border']['style'] = empost('theme.meta.close.border.style');
89
- $new_values['meta']['close']['border']['color'] = sanitize_text_field( empost('theme.meta.close.border.color') );
90
- $new_values['meta']['close']['border']['width'] = floatval( empost('theme.meta.close.border.width') );
91
- $new_values['meta']['close']['border']['radius'] = floatval( empost('theme.meta.close.border.radius') );
92
- $new_values['meta']['close']['boxshadow']['inset'] = empost('theme.meta.close.boxshadow.inset');
93
- $new_values['meta']['close']['boxshadow']['horizontal'] = floatval( empost('theme.meta.close.boxshadow.horizontal') );
94
- $new_values['meta']['close']['boxshadow']['vertical'] = floatval( empost('theme.meta.close.boxshadow.vertical') );
95
- $new_values['meta']['close']['boxshadow']['blur'] = floatval( empost('theme.meta.close.boxshadow.blur') );
96
- $new_values['meta']['close']['boxshadow']['spread'] = floatval( empost('theme.meta.close.boxshadow.spread') );
97
- $new_values['meta']['close']['boxshadow']['color'] = sanitize_text_field( empost('theme.meta.close.boxshadow.color') );
98
- $new_values['meta']['close']['boxshadow']['opacity'] = floatval( empost('theme.meta.close.boxshadow.opacity') );
99
- $new_values['meta']['close']['textshadow']['horizontal'] = floatval( empost('theme.meta.close.textshadow.horizontal') );
100
- $new_values['meta']['close']['textshadow']['vertical'] = floatval( empost('theme.meta.close.textshadow.vertical') );
101
- $new_values['meta']['close']['textshadow']['blur'] = floatval( empost('theme.meta.close.textshadow.blur') );
102
- $new_values['meta']['close']['textshadow']['color'] = sanitize_text_field( empost('theme.meta.close.textshadow.color') );
103
- $new_values['meta']['close']['textshadow']['opacity'] = floatval( empost('theme.meta.close.textshadow.opacity') );
104
 
105
  return $new_values;
106
  }
1
  <?php class EModal_Controller_Admin_Theme extends EModal_Controller {
2
+
3
+ static function factory() {
4
  self::$instance = new EModal_Controller_Admin_Theme;
5
  self::$instance->action_edit();
6
  }
7
+
8
+ public function action_edit() {
 
 
 
 
 
 
 
 
 
 
 
 
9
  global $current_theme;
10
+ $current_theme = new EModal_Model_Theme( $this->check_id() );
11
+ if ( $this->check_post_nonce() ) {
12
+ $new_values = apply_filters( 'emodal_theme_pre_save', $current_theme->as_array() );
13
+ $current_theme->set_fields( apply_filters( "emodal_model_theme_meta_defaults", $new_values ) );
 
14
  $current_theme->save();
15
+ do_action( 'emodal_theme_save', $current_theme );
16
+ EModal_Admin_Notice::add( __( 'Theme Updated.', 'easy-modal' ), 'updated' );
17
  $this->redirect_to_edit();
18
  }
19
  $view = new EModal_View_Admin_Theme_Form;
20
+ $view->set( 'title', __( 'Edit Theme', 'easy-modal' ) );
21
+ $view->set( 'tabs', apply_filters( 'emodal_admin_theme_form_tabs', array() ) );
22
  self::$instance->view = $view;
23
  }
24
+
25
+ public function check_id() {
26
+ return 1;
27
+ }
28
+
29
+ public function edit_url() {
30
+ return $this->index_url();
31
+ }
32
+
33
+ public function index_url() {
34
+ return emodal_admin_url( 'themes' );
35
+ }
36
  }
37
 
38
 
39
+ add_filter( 'emodal_theme_pre_save', 'emodal_theme_pre_save', 1 );
40
+ function emodal_theme_pre_save( $new_values ) {
41
+ $new_values['name'] = sanitize_text_field( empost( 'theme.name' ) );
42
+
43
+ $new_values['meta']['overlay']['background']['color'] = sanitize_text_field( empost( 'theme.meta.overlay.background.color' ) );
44
+ $new_values['meta']['overlay']['background']['opacity'] = floatval( empost( 'theme.meta.overlay.background.opacity' ) );
45
 
46
+ $new_values['meta']['container']['padding'] = floatval( empost( 'theme.meta.container.padding' ) );
47
+ $new_values['meta']['container']['background']['color'] = sanitize_text_field( empost( 'theme.meta.container.background.color' ) );
48
+ $new_values['meta']['container']['background']['opacity'] = floatval( empost( 'theme.meta.container.background.opacity' ) );
49
+ $new_values['meta']['container']['border']['style'] = empost( 'theme.meta.container.border.style' );
50
+ $new_values['meta']['container']['border']['color'] = sanitize_text_field( empost( 'theme.meta.container.border.color' ) );
51
+ $new_values['meta']['container']['border']['width'] = floatval( empost( 'theme.meta.container.border.width' ) );
52
+ $new_values['meta']['container']['border']['radius'] = floatval( empost( 'theme.meta.container.border.radius' ) );
53
+ $new_values['meta']['container']['boxshadow']['inset'] = empost( 'theme.meta.container.boxshadow.inset' );
54
+ $new_values['meta']['container']['boxshadow']['horizontal'] = floatval( empost( 'theme.meta.container.boxshadow.horizontal' ) );
55
+ $new_values['meta']['container']['boxshadow']['vertical'] = floatval( empost( 'theme.meta.container.boxshadow.vertical' ) );
56
+ $new_values['meta']['container']['boxshadow']['blur'] = floatval( empost( 'theme.meta.container.boxshadow.blur' ) );
57
+ $new_values['meta']['container']['boxshadow']['spread'] = floatval( empost( 'theme.meta.container.boxshadow.spread' ) );
58
+ $new_values['meta']['container']['boxshadow']['color'] = sanitize_text_field( empost( 'theme.meta.container.boxshadow.color' ) );
59
+ $new_values['meta']['container']['boxshadow']['opacity'] = floatval( empost( 'theme.meta.container.boxshadow.opacity' ) );
60
 
61
+ $new_values['meta']['title']['font']['color'] = sanitize_text_field( empost( 'theme.meta.title.font.color' ) );
62
+ $new_values['meta']['title']['font']['size'] = floatval( empost( 'theme.meta.title.font.size' ) );
63
+ $new_values['meta']['title']['font']['family'] = empost( 'theme.meta.title.font.family' );
64
+ $new_values['meta']['title']['text']['align'] = empost( 'theme.meta.title.text.align' );
65
+ $new_values['meta']['title']['textshadow']['horizontal'] = floatval( empost( 'theme.meta.title.textshadow.horizontal' ) );
66
+ $new_values['meta']['title']['textshadow']['vertical'] = floatval( empost( 'theme.meta.title.textshadow.vertical' ) );
67
+ $new_values['meta']['title']['textshadow']['blur'] = floatval( empost( 'theme.meta.title.textshadow.blur' ) );
68
+ $new_values['meta']['title']['textshadow']['color'] = sanitize_text_field( empost( 'theme.meta.title.textshadow.color' ) );
69
+ $new_values['meta']['title']['textshadow']['opacity'] = floatval( empost( 'theme.meta.title.textshadow.opacity' ) );
 
 
 
 
 
70
 
71
+ $new_values['meta']['content']['font']['color'] = sanitize_text_field( empost( 'theme.meta.content.font.color' ) );
72
+ $new_values['meta']['content']['font']['family'] = empost( 'theme.meta.content.font.family' );
 
 
 
 
 
 
 
73
 
74
+ $new_values['meta']['close']['text'] = sanitize_text_field( empost( 'theme.meta.close.text' ) );
75
+ $new_values['meta']['close']['location'] = empost( 'theme.meta.close.location' );
76
+ $new_values['meta']['close']['position']['top'] = empost( 'theme.meta.close.position.top' );
77
+ $new_values['meta']['close']['position']['left'] = empost( 'theme.meta.close.position.left' );
78
+ $new_values['meta']['close']['position']['bottom'] = empost( 'theme.meta.close.position.bottom' );
79
+ $new_values['meta']['close']['position']['right'] = empost( 'theme.meta.close.position.right' );
80
+ $new_values['meta']['close']['padding'] = floatval( empost( 'theme.meta.close.padding' ) );
81
+ $new_values['meta']['close']['background']['color'] = sanitize_text_field( empost( 'theme.meta.close.background.color' ) );
82
+ $new_values['meta']['close']['background']['opacity'] = floatval( empost( 'theme.meta.close.background.opacity' ) );
83
+ $new_values['meta']['close']['font']['color'] = sanitize_text_field( empost( 'theme.meta.close.font.color' ) );
84
+ $new_values['meta']['close']['font']['size'] = floatval( empost( 'theme.meta.close.font.size' ) );
85
+ $new_values['meta']['close']['font']['family'] = empost( 'theme.meta.close.font.family' );
86
+ $new_values['meta']['close']['border']['style'] = empost( 'theme.meta.close.border.style' );
87
+ $new_values['meta']['close']['border']['color'] = sanitize_text_field( empost( 'theme.meta.close.border.color' ) );
88
+ $new_values['meta']['close']['border']['width'] = floatval( empost( 'theme.meta.close.border.width' ) );
89
+ $new_values['meta']['close']['border']['radius'] = floatval( empost( 'theme.meta.close.border.radius' ) );
90
+ $new_values['meta']['close']['boxshadow']['inset'] = empost( 'theme.meta.close.boxshadow.inset' );
91
+ $new_values['meta']['close']['boxshadow']['horizontal'] = floatval( empost( 'theme.meta.close.boxshadow.horizontal' ) );
92
+ $new_values['meta']['close']['boxshadow']['vertical'] = floatval( empost( 'theme.meta.close.boxshadow.vertical' ) );
93
+ $new_values['meta']['close']['boxshadow']['blur'] = floatval( empost( 'theme.meta.close.boxshadow.blur' ) );
94
+ $new_values['meta']['close']['boxshadow']['spread'] = floatval( empost( 'theme.meta.close.boxshadow.spread' ) );
95
+ $new_values['meta']['close']['boxshadow']['color'] = sanitize_text_field( empost( 'theme.meta.close.boxshadow.color' ) );
96
+ $new_values['meta']['close']['boxshadow']['opacity'] = floatval( empost( 'theme.meta.close.boxshadow.opacity' ) );
97
+ $new_values['meta']['close']['textshadow']['horizontal'] = floatval( empost( 'theme.meta.close.textshadow.horizontal' ) );
98
+ $new_values['meta']['close']['textshadow']['vertical'] = floatval( empost( 'theme.meta.close.textshadow.vertical' ) );
99
+ $new_values['meta']['close']['textshadow']['blur'] = floatval( empost( 'theme.meta.close.textshadow.blur' ) );
100
+ $new_values['meta']['close']['textshadow']['color'] = sanitize_text_field( empost( 'theme.meta.close.textshadow.color' ) );
101
+ $new_values['meta']['close']['textshadow']['opacity'] = floatval( empost( 'theme.meta.close.textshadow.opacity' ) );
 
 
 
102
 
103
  return $new_values;
104
  }
classes/view/admin/addons.php CHANGED
@@ -1,12 +1,16 @@
1
  <?php class EModal_View_Admin_Addons extends EModal_View {
2
  public function output()
3
  {
4
- extract($this->values);?>
 
 
5
  <div class="wrap">
6
  <h2><?php esc_html_e(__($title, 'easy-modal' ) );?></h2>
7
  <div id="poststuff">
8
  <div id="post-body" class="metabox-holder">
9
  <div id="post-body-content"><?php
 
 
10
  $addons = EModal_License::available_addons();?>
11
  <ul class="addons-available">
12
  <?php
@@ -102,6 +106,21 @@
102
  <?php endforeach;
103
  }?>
104
  </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  </div>
106
  </div>
107
  <br class="clear"/>
1
  <?php class EModal_View_Admin_Addons extends EModal_View {
2
  public function output()
3
  {
4
+ extract($this->values);
5
+
6
+ ?>
7
  <div class="wrap">
8
  <h2><?php esc_html_e(__($title, 'easy-modal' ) );?></h2>
9
  <div id="poststuff">
10
  <div id="post-body" class="metabox-holder">
11
  <div id="post-body-content"><?php
12
+ /*
13
+
14
  $addons = EModal_License::available_addons();?>
15
  <ul class="addons-available">
16
  <?php
106
  <?php endforeach;
107
  }?>
108
  </ul>
109
+
110
+ */
111
+
112
+ $url = esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=popup-maker' ), 'install-plugin_popup-maker' ) ); ?>
113
+ <p>Did you know, that Easy Modal has a fancy new replacement called <strong><a href="https://wordpress.org/plugins/popup-maker/" target="_blank">Popup Maker</a></strong>? It is the highest user rated popup & modal plugin available for WordPress.</p>
114
+ <ul class="ul-square">
115
+ <li>Unlimited themes</li>
116
+ <li>Precision Targeting, Triggers & Cookies</li>
117
+ <li>Customize everything</li>
118
+ <li>Full line of extensions</li>
119
+ <li>Extensive Documentation & Developer APIs</li>
120
+ <li><a href="https://wordpress.org/plugins/popup-maker/" target="_blank">Learn more</a> or <a href="<?php echo esc_url( $url ); ?>">Install it now!</a></li>
121
+ </ul>
122
+
123
+ <p>Easy Modal's addons have not been available for some time, for any premium functionality we recommend you move to Popup Maker.</p>
124
  </div>
125
  </div>
126
  <br class="clear"/>
classes/view/admin/modal/index.php CHANGED
@@ -1,209 +1,221 @@
1
  <?php class EModal_View_Admin_Modal_Index extends EModal_View {
2
- public function output()
3
- {
4
- extract($this->values);?>
5
- <div class="wrap">
6
- <h2><?php
7
- esc_html_e($title );
8
- if(!empty($modal_new_url))
9
- echo ' <a href="' . esc_url( $modal_new_url ) . '" class="add-new-h2">' . __('Add New', 'easy-modal' ) . '</a>';
10
- if(!count_all_modals())
11
- echo ' <div class="add-new-get-started">Add a new modal to get started!</div>';
 
 
12
  ?></h2>
13
- <div id="poststuff">
14
- <div id="post-body" class="metabox-holder columns-2">
15
- <div id="post-body-content">
16
- <?php if(count_all_modals() || count_deleted_modals())
17
- {?>
18
- <ul class="subsubsub">
19
- <li class="all">
20
- <a <?php echo empty($_GET['status']) || $_GET['status'] == 'all' ? 'class="current" ' : '';?>href="<?php echo esc_url( emodal_admin_url() .'&status=all');?>">
21
- All <span class="count">(<?php esc_html_e(count_all_modals());?>)</span>
22
- </a>
23
- </li>
24
- <?php if($trash = count_deleted_modals()){?>
25
- <li class="trash">|
26
- <a <?php echo !empty($_GET['status']) && $_GET['status'] == 'trash' ? 'class="current" ' : '';?>href="<?php echo esc_url( emodal_admin_url() .'&status=trash');?>">
27
- Trash <span class="count">(<?php esc_html_e($trash);?>)</span>
28
- </a>
29
- </li>
30
- <?php }?>
31
- </ul>
32
- <form id="modals-filter" method="get" action="">
33
- <?php wp_nonce_field( EMCORE_NONCE, EMCORE_NONCE, true, true );?>
34
- <input type="hidden" name="page" value="<?php echo EMCORE_SLUG;?>"/>
35
- <?php
36
- $table = new EModal_Modal_List_Table();
37
- $table->prepare_items();
38
- $table->display();
39
- ?>
40
- </form><?php
41
- }
42
- else
43
- {?>
44
- <div class="get-started-modal-welcome">
45
- <h1>Welcome to <span class="easy">Easy</span><span class="modal">Modal</span></h1>
46
- <p>Thank you for installing EasyModal! We hope you enjoy our plug-in! We strive for perfection, but we can’t do it without you! Give us your feedback (<a href="mailto:feedback@easymodal.com">feedback@easymodal.com</a>) and leave us a review at: <a target="_blank" href="http://www.wordpress.org/plugins/easymodal">http://www.wordpress.org/plugins/easymodal</a>
47
- </div><?php
48
- }?>
49
-
50
-
51
- </div>
52
- <div id="postbox-container-1" class="postbox-container">
53
- <?php do_action('emodal_admin_sidebar');?>
54
- </div>
55
- </div>
56
- <br class="clear"/>
57
- </div>
58
- </div><?php
 
 
 
 
 
 
 
 
 
59
  }
60
  }
61
 
62
  //Our class extends the WP_List_Table class, so we need to make sure that it's there
63
- if(!class_exists('WP_List_Table')){
64
- require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
65
  }
 
66
  class EModal_Modal_List_Table extends WP_List_Table {
67
- function __construct()
68
- {
69
- parent::__construct(array(
70
- 'singular'=> 'modal', //Singular label
71
- 'plural' => 'modals', //plural label, also this well be one of the table css class
72
- 'ajax' => false //We won't support Ajax for this table
73
- ));
74
  }
75
- function prepare_items()
76
- {
77
  global $wpdb, $_wp_column_headers;
78
 
79
- $table_name = $wpdb->prefix.'em_modals';
80
- $screen = get_current_screen();
81
 
82
  /* -- Preparing your query -- */
83
- $status = !empty($_GET['status']) ? $_GET['status'] : '';
84
- switch($status)
85
- {
86
- case "trash": $where = "WHERE `is_trash` = 1"; break;
87
- default: $where = "WHERE `is_trash` != 1"; break;
 
 
 
88
  }
89
 
90
  $query = "SELECT * FROM $table_name $where";
91
  /* -- Ordering parameters -- */
92
- //Parameters that are going to be used to order the result
93
- $orderby = !empty($_GET["orderby"]) ? mysql_real_escape_string($_GET["orderby"]) : 'ASC';
94
- $order = !empty($_GET["order"]) ? mysql_real_escape_string($_GET["order"]) : '';
95
- if(!empty($orderby) & !empty($order))
96
- {
97
- $query.=' ORDER BY '.$orderby.' '.$order;
98
- }
99
 
100
- /* -- Pagination parameters -- */
101
- //Number of elements in your table?
102
- $totalitems = $wpdb->query($query); //return the total number of affected rows
103
- //How many to display per page?
104
- $perpage = !empty($_GET["per_page"]) && intval($_GET["per_page"]) > 0 ? intval( $_GET["per_page"] ) : 10;
105
- //Which page is this?
106
- $paged = !empty($_GET["paged"]) && intval($_GET["paged"]) > 0 ? intval( $_GET["paged"] ) : 1;
107
- //How many pages do we have in total?
108
- $totalpages = ceil($totalitems/$perpage);
109
- //adjust the query to take pagination into account
110
- if(!empty($paged) && !empty($perpage))
111
- {
112
- $offset=($paged-1)*$perpage;
113
- $query.=' LIMIT '.(int)$offset.','.(int)$perpage;
114
- }
115
 
116
 
117
  /* -- Register the pagination -- */
118
- $this->set_pagination_args( array(
119
- "total_items" => $totalitems,
120
- "total_pages" => $totalpages,
121
- "per_page" => $perpage,
122
- ) );
123
 
124
- //The pagination links are automatically built according to those parameters
125
 
126
  /* -- Register the Columns -- */
127
- $columns = $this->get_columns();
128
- $hidden = array();
129
- $sortable = $this->get_sortable_columns();
130
- $this->_column_headers = array($columns, $hidden, $sortable);
131
 
132
  /* -- Fetch the items -- */
133
- $this->items = $wpdb->get_results($query);
134
  }
135
- function get_columns()
136
- {
137
- return apply_filters('emodal_admin_modal_table_columns', array(
138
- 'cb' => '<input type="checkbox" />',
139
- 'name' => __('Name'),
140
- 'class' => __('Class'),
141
- 'load' => __('Load Method'),
142
- ));
143
  }
144
- function get_sortable_columns()
145
- {
146
- return apply_filters('emodal_admin_modal_table_sortable_columns', array(
147
- 'name'=> 'name',
148
- 'class'=> 'class',
149
- 'load'=> 'load',
150
- ));
151
  }
152
 
153
  function display_tablenav( $which ) {
154
  //if ( 'top' == $which )
155
- ?>
156
- <div class="tablenav <?php echo esc_attr( $which ); ?>">
157
-
158
- <div class="alignleft actions bulkactions">
159
- <?php $this->bulk_actions(); ?>
160
- </div>
161
- <?php
162
- $this->extra_tablenav( $which );
163
- $this->pagination( $which );
164
- ?>
165
-
166
- <br class="clear" />
167
- </div>
168
- <?php
169
  }
170
 
171
  function get_bulk_actions() {
172
- $actions = array('delete' => __('Delete', 'easy-modal' ));
173
- if(!empty($_GET['status']) && $_GET['status'] == 'trash')
174
  $actions['untrash'] = __( 'Restore' );
175
- if(count_deleted_modals())
176
- $actions['empty_trash'] = __('Empty Trash', 'easy-modal' );
 
 
 
177
  return $actions;
178
  }
179
 
180
- function column_cb($item)
181
- {
182
- return sprintf(
183
- '<input type="checkbox" name="%1$s[]" value="%2$s" />',
184
- $this->_args['singular'],
185
- $item->id);
186
  }
187
- function column_class($item)
188
- {
189
- return '<code>eModal-'.stripslashes($item->id).'</code>';
190
  }
191
- function column_name($item)
192
- {
193
- $clone_link = esc_url( wp_nonce_url( emodal_admin_url() .'&action=clone&id='. $item->id, EMCORE_NONCE, EMCORE_NONCE));
194
- $edit_link = esc_url( emodal_admin_url() .'&action=edit&id='. $item->id);
195
- $delete_link = esc_url( wp_nonce_url( emodal_admin_url() .'&action=delete&id[]='. $item->id, EMCORE_NONCE, EMCORE_NONCE));
196
 
197
- $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr(sprintf( __( 'Edit &#8220;%s&#8221;', 'easy-modal' ), $item->name)) . '">' . $item->name . '</a></strong><br />';
 
 
 
 
 
198
 
199
  $actions = array();
200
  //if ( current_user_can( $tax->cap->edit_terms ) ) {
201
- $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit', 'easy-modal' ) . '</a>';
202
- //$actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick&nbsp;Edit' ) . '</a>';
203
  //}
204
- $actions['clone'] = '<a href="' . $clone_link . '">' . __('Clone', 'easy-modal' ) . '</a>';
205
  //if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )
206
- $actions['delete'] = "<a class='delete-tag' href='" . $delete_link . "'>" . __('Delete', 'easy-modal' ) . "</a>";
207
  //if ( $tax->public )
208
 
209
  //$actions = apply_filters( 'tag_row_actions', $actions, $tag );
@@ -219,38 +231,40 @@ class EModal_Modal_List_Table extends WP_List_Table {
219
 
220
  return $out;
221
  }
222
- function column_load($item)
223
- {
224
- if(!$item->is_sitewide)
225
- {
226
- return __('Per Page / Post');
227
- }
228
- elseif($item->is_sitewide)
229
- {
230
- return __('Sitewide');
231
  }
232
  }
233
 
234
  function search_box( $text, $input_id ) {
235
- if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
236
  return;
 
237
 
238
  $input_id = $input_id . '-search-input';
239
 
240
- if ( ! empty( $_REQUEST['orderby'] ) )
241
  echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
242
- if ( ! empty( $_REQUEST['order'] ) )
 
243
  echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
244
- if ( ! empty( $_REQUEST['post_mime_type'] ) )
 
245
  echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
246
- if ( ! empty( $_REQUEST['detached'] ) )
 
247
  echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
248
- ?>
249
- <p class="search-box">
250
- <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
251
- <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
252
- <?php submit_button( $text, 'button', false, false, array('id' => 'search-submit') ); ?>
253
- </p>
254
- <?php
 
255
  }
256
  }
1
  <?php class EModal_View_Admin_Modal_Index extends EModal_View {
2
+
3
+ public function output() {
4
+ extract( $this->values ); ?>
5
+ <div class="wrap">
6
+ <h2><?php
7
+ esc_html_e( $title );
8
+ if ( ! empty( $modal_new_url ) ) {
9
+ echo ' <a href="' . esc_url( $modal_new_url ) . '" class="add-new-h2">' . __( 'Add New', 'easy-modal' ) . '</a>';
10
+ }
11
+ if ( ! count_all_modals() ) {
12
+ echo ' <div class="add-new-get-started">Add a new modal to get started!</div>';
13
+ }
14
  ?></h2>
15
+ <div id="poststuff">
16
+ <div id="post-body" class="metabox-holder columns-2">
17
+ <div id="post-body-content">
18
+ <?php if ( count_all_modals() || count_deleted_modals() ) {
19
+ ?>
20
+ <ul class="subsubsub">
21
+ <li class="all">
22
+ <a <?php echo empty( $_GET['status'] ) || $_GET['status'] == 'all' ? 'class="current" ' : ''; ?>href="<?php echo esc_url( emodal_admin_url() . '&status=all' ); ?>">
23
+ All <span class="count">(<?php esc_html_e( count_all_modals() ); ?>)</span>
24
+ </a>
25
+ </li>
26
+ <?php if ( $trash = count_deleted_modals() ) { ?>
27
+ <li class="trash">|
28
+ <a <?php echo ! empty( $_GET['status'] ) && $_GET['status'] == 'trash' ? 'class="current" ' : ''; ?>href="<?php echo esc_url( emodal_admin_url() . '&status=trash' ); ?>">
29
+ Trash <span class="count">(<?php esc_html_e( $trash ); ?>)</span>
30
+ </a>
31
+ </li>
32
+ <?php } ?>
33
+ </ul>
34
+ <form id="modals-filter" method="get" action="">
35
+ <?php wp_nonce_field( EMCORE_NONCE, EMCORE_NONCE, true, true ); ?>
36
+ <input type="hidden" name="page" value="<?php echo EMCORE_SLUG; ?>" />
37
+ <?php
38
+ $table = new EModal_Modal_List_Table();
39
+ $table->prepare_items();
40
+ $table->display();
41
+ ?>
42
+ </form><?php
43
+ } else {
44
+ $url = esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=popup-maker' ), 'install-plugin_popup-maker' ) );
45
+ ?>
46
+ <div class="get-started-modal-welcome">
47
+ <h1>Welcome to <span class="easy">Easy</span><span class="modal">Modal</span></h1>
48
+ <p>Thank you for installing EasyModal! We hope you enjoy our plug-in! We strive for perfection, but we can’t do it without you! Give us your feedback (<a href="mailto:feedback@easymodal.com">feedback@easymodal.com</a>) and leave us a review at:<a target="_blank" href="http://www.wordpress.org/plugins/easymodal">http://www.wordpress.org/plugins/easymodal</a></p>
49
+ <p>That said, did you know, that Easy Modal has a fancy new replacement called <strong><a href="https://wordpress.org/plugins/popup-maker/" target="_blank">Popup Maker</a></strong>? It is the highest user rated popup & modal plugin available for WordPress.</p>
50
+ <ul class="ul-square">
51
+ <li>Unlimited themes</li>
52
+ <li>Precision Targeting, Triggers & Cookies</li>
53
+ <li>Customize everything</li>
54
+ <li>Full line of extensions</li>
55
+ <li>Extensive Documentation & Developer APIs</li>
56
+ <li><a href="https://wordpress.org/plugins/popup-maker/" target="_blank">Learn more</a> or <a href="<?php echo esc_url( $url ); ?>">Install it now!</a></li>
57
+ </ul>
58
+ </div><?php
59
+ } ?>
60
+
61
+
62
+ </div>
63
+ <div id="postbox-container-1" class="postbox-container">
64
+ <?php do_action( 'emodal_admin_sidebar' ); ?>
65
+ </div>
66
+ </div>
67
+ <br class="clear" />
68
+ </div>
69
+ </div><?php
70
  }
71
  }
72
 
73
  //Our class extends the WP_List_Table class, so we need to make sure that it's there
74
+ if ( ! class_exists( 'WP_List_Table' ) ) {
75
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
76
  }
77
+
78
  class EModal_Modal_List_Table extends WP_List_Table {
79
+
80
+ function __construct() {
81
+ parent::__construct( array(
82
+ 'singular' => 'modal', //Singular label
83
+ 'plural' => 'modals', //plural label, also this well be one of the table css class
84
+ 'ajax' => false //We won't support Ajax for this table
85
+ ) );
86
  }
87
+
88
+ function prepare_items() {
89
  global $wpdb, $_wp_column_headers;
90
 
91
+ $table_name = $wpdb->prefix . 'em_modals';
92
+ $screen = get_current_screen();
93
 
94
  /* -- Preparing your query -- */
95
+ $status = ! empty( $_GET['status'] ) ? $_GET['status'] : '';
96
+ switch ( $status ) {
97
+ case "trash":
98
+ $where = "WHERE `is_trash` = 1";
99
+ break;
100
+ default:
101
+ $where = "WHERE `is_trash` != 1";
102
+ break;
103
  }
104
 
105
  $query = "SELECT * FROM $table_name $where";
106
  /* -- Ordering parameters -- */
107
+ //Parameters that are going to be used to order the result
108
+ $orderby = ! empty( $_GET["orderby"] ) ? mysql_real_escape_string( $_GET["orderby"] ) : 'ASC';
109
+ $order = ! empty( $_GET["order"] ) ? mysql_real_escape_string( $_GET["order"] ) : '';
110
+ if ( ! empty( $orderby ) & ! empty( $order ) ) {
111
+ $query .= ' ORDER BY ' . $orderby . ' ' . $order;
112
+ }
 
113
 
114
+ /* -- Pagination parameters -- */
115
+ //Number of elements in your table?
116
+ $totalitems = $wpdb->query( $query ); //return the total number of affected rows
117
+ //How many to display per page?
118
+ $perpage = ! empty( $_GET["per_page"] ) && intval( $_GET["per_page"] ) > 0 ? intval( $_GET["per_page"] ) : 10;
119
+ //Which page is this?
120
+ $paged = ! empty( $_GET["paged"] ) && intval( $_GET["paged"] ) > 0 ? intval( $_GET["paged"] ) : 1;
121
+ //How many pages do we have in total?
122
+ $totalpages = ceil( $totalitems / $perpage );
123
+ //adjust the query to take pagination into account
124
+ if ( ! empty( $paged ) && ! empty( $perpage ) ) {
125
+ $offset = ( $paged - 1 ) * $perpage;
126
+ $query .= ' LIMIT ' . (int) $offset . ',' . (int) $perpage;
127
+ }
 
128
 
129
 
130
  /* -- Register the pagination -- */
131
+ $this->set_pagination_args( array(
132
+ "total_items" => $totalitems,
133
+ "total_pages" => $totalpages,
134
+ "per_page" => $perpage,
135
+ ) );
136
 
137
+ //The pagination links are automatically built according to those parameters
138
 
139
  /* -- Register the Columns -- */
140
+ $columns = $this->get_columns();
141
+ $hidden = array();
142
+ $sortable = $this->get_sortable_columns();
143
+ $this->_column_headers = array( $columns, $hidden, $sortable );
144
 
145
  /* -- Fetch the items -- */
146
+ $this->items = $wpdb->get_results( $query );
147
  }
148
+
149
+ function get_columns() {
150
+ return apply_filters( 'emodal_admin_modal_table_columns', array(
151
+ 'cb' => '<input type="checkbox" />',
152
+ 'name' => __( 'Name' ),
153
+ 'class' => __( 'Class' ),
154
+ 'load' => __( 'Load Method' ),
155
+ ) );
156
  }
157
+
158
+ function get_sortable_columns() {
159
+ return apply_filters( 'emodal_admin_modal_table_sortable_columns', array(
160
+ 'name' => 'name',
161
+ 'class' => 'class',
162
+ 'load' => 'load',
163
+ ) );
164
  }
165
 
166
  function display_tablenav( $which ) {
167
  //if ( 'top' == $which )
168
+ ?>
169
+ <div class="tablenav <?php echo esc_attr( $which ); ?>">
170
+
171
+ <div class="alignleft actions bulkactions">
172
+ <?php $this->bulk_actions(); ?>
173
+ </div>
174
+ <?php
175
+ $this->extra_tablenav( $which );
176
+ $this->pagination( $which );
177
+ ?>
178
+
179
+ <br class="clear" />
180
+ </div>
181
+ <?php
182
  }
183
 
184
  function get_bulk_actions() {
185
+ $actions = array( 'delete' => __( 'Delete', 'easy-modal' ) );
186
+ if ( ! empty( $_GET['status'] ) && $_GET['status'] == 'trash' ) {
187
  $actions['untrash'] = __( 'Restore' );
188
+ }
189
+ if ( count_deleted_modals() ) {
190
+ $actions['empty_trash'] = __( 'Empty Trash', 'easy-modal' );
191
+ }
192
+
193
  return $actions;
194
  }
195
 
196
+ function column_cb( $item ) {
197
+ return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', $this->_args['singular'], $item->id );
 
 
 
 
198
  }
199
+
200
+ function column_class( $item ) {
201
+ return '<code>eModal-' . stripslashes( $item->id ) . '</code>';
202
  }
 
 
 
 
 
203
 
204
+ function column_name( $item ) {
205
+ $clone_link = esc_url( wp_nonce_url( emodal_admin_url() . '&action=clone&id=' . $item->id, EMCORE_NONCE, EMCORE_NONCE ) );
206
+ $edit_link = esc_url( emodal_admin_url() . '&action=edit&id=' . $item->id );
207
+ $delete_link = esc_url( wp_nonce_url( emodal_admin_url() . '&action=delete&id[]=' . $item->id, EMCORE_NONCE, EMCORE_NONCE ) );
208
+
209
+ $out = '<strong><a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;', 'easy-modal' ), $item->name ) ) . '">' . $item->name . '</a></strong><br />';
210
 
211
  $actions = array();
212
  //if ( current_user_can( $tax->cap->edit_terms ) ) {
213
+ $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit', 'easy-modal' ) . '</a>';
214
+ //$actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __( 'Quick&nbsp;Edit' ) . '</a>';
215
  //}
216
+ $actions['clone'] = '<a href="' . $clone_link . '">' . __( 'Clone', 'easy-modal' ) . '</a>';
217
  //if ( current_user_can( $tax->cap->delete_terms ) && $tag->term_id != $default_term )
218
+ $actions['delete'] = "<a class='delete-tag' href='" . $delete_link . "'>" . __( 'Delete', 'easy-modal' ) . "</a>";
219
  //if ( $tax->public )
220
 
221
  //$actions = apply_filters( 'tag_row_actions', $actions, $tag );
231
 
232
  return $out;
233
  }
234
+
235
+ function column_load( $item ) {
236
+ if ( ! $item->is_sitewide ) {
237
+ return __( 'Per Page / Post' );
238
+ } elseif ( $item->is_sitewide ) {
239
+ return __( 'Sitewide' );
 
 
 
240
  }
241
  }
242
 
243
  function search_box( $text, $input_id ) {
244
+ if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
245
  return;
246
+ }
247
 
248
  $input_id = $input_id . '-search-input';
249
 
250
+ if ( ! empty( $_REQUEST['orderby'] ) ) {
251
  echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
252
+ }
253
+ if ( ! empty( $_REQUEST['order'] ) ) {
254
  echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
255
+ }
256
+ if ( ! empty( $_REQUEST['post_mime_type'] ) ) {
257
  echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />';
258
+ }
259
+ if ( ! empty( $_REQUEST['detached'] ) ) {
260
  echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
261
+ }
262
+ ?>
263
+ <p class="search-box">
264
+ <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
265
+ <input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
266
+ <?php submit_button( $text, 'button', false, false, array( 'id' => 'search-submit' ) ); ?>
267
+ </p>
268
+ <?php
269
  }
270
  }
easy-modal.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Easy Modal
4
  Plugin URI: http://easy-modal.com
5
  Description: Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos & more.
6
  Author: Daniel Iser
7
- Version: 2.0.17
8
  Author URI: http://danieliser.com
9
  Text Domain: easy-modal
10
  */
@@ -21,7 +21,7 @@ if (!defined('EMCORE_URL'))
21
  if (!defined('EMCORE_NONCE'))
22
  define('EMCORE_NONCE', EMCORE_SLUG.'_nonce' );
23
  if (!defined('EMCORE_VERSION'))
24
- define('EMCORE_VERSION', '2.0.17' );
25
  if (!defined('EMCORE_DB_VERSION'))
26
  define('EMCORE_DB_VERSION', '1.1' );
27
  if (!defined('EMCORE_API_URL'))
4
  Plugin URI: http://easy-modal.com
5
  Description: Easily create & style modals with any content. Theme editor to quickly style your modals. Add forms, social media boxes, videos & more.
6
  Author: Daniel Iser
7
+ Version: 2.1.0
8
  Author URI: http://danieliser.com
9
  Text Domain: easy-modal
10
  */
21
  if (!defined('EMCORE_NONCE'))
22
  define('EMCORE_NONCE', EMCORE_SLUG.'_nonce' );
23
  if (!defined('EMCORE_VERSION'))
24
+ define('EMCORE_VERSION', '2.1.0' );
25
  if (!defined('EMCORE_DB_VERSION'))
26
  define('EMCORE_DB_VERSION', '1.1' );
27
  if (!defined('EMCORE_API_URL'))
includes/admin/sidebar.php CHANGED
@@ -1,57 +1,85 @@
1
  <?php
2
- add_action('emodal_admin_sidebar', 'emodal_admin_sidebar_share', 10);
3
- function emodal_admin_sidebar_share()
4
- {?>
5
- <h3 class="loveit-shareit" style="text-align:center">Love It? <span>Share It!</span></h3>
6
- <ul class="share-buttons">
7
- <li><div class="fb-like" data-href="http://easy-modal.com" data-width="100" data-layout="box_count" data-action="like" data-show-faces="false" data-send="true"></div></li>
8
- <li><a href="https://twitter.com/intent/tweet" class="twitter-share-button" data-count="vertical" data-url="http://easy-modal.com" data-via="wizard_is" data-related="wizard_is">Tweet</a></li>
9
- <li><div class="g-plusone" data-href="http://easy-modal.com" data-size="tall"></div></li>
10
- </ul>
11
- <br class="clear" />
12
- <br class="clear" />
13
- <div style="text-align:center">
14
- <a class="button rounded" href="http://wordpress.org/support/view/plugin-reviews/easy-modal#postform">Rate us on WordPress!</a>
15
- </div><?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
 
18
- add_action('emodal_admin_sidebar', 'emodal_admin_sidebar_documentation', 20);
19
- function emodal_admin_sidebar_documentation()
20
- {?>
21
- <a href="http://easy-modal.com/documentation?utm_source=emcore&utm_medium=dashboard+link&utm_campaign=documentation" target="_blank">
22
- <img src="<?php echo EMCORE_URL;?>/assets/images/admin/sidebar-documentation.jpg" alt="Easy Modal Documentation" style="max-width:100%;" />
23
- </a><?php
24
  }
25
 
26
- add_action('emodal_admin_sidebar', 'emodal_admin_sidebar_support', 30);
27
- function emodal_admin_sidebar_support()
28
- {?>
29
- <hr/>
30
- <p class="emodal-feature-list" style="text-align:center">
31
- <a href="http://easy-modal.com/support/pricing?utm_source=emcore&utm_medium=dashboard+link&utm_campaign=get+support+now" target="_blank"><img src="<?php echo EMCORE_URL;?>/assets/images/admin/sidebar-priority-support.png" alt="Priority Support"/></a><br/>
32
- <a href="http://easy-modal.com/support?utm_source=emcore&utm_medium=dashboard+link&utm_campaign=visit+support" target="_blank">Visit the Support Page</a>
33
- </p><?php
34
  }
35
 
36
  //add_action('emodal_admin_sidebar', 'emodal_admin_sidebar_upgrade', 30);
37
- function emodal_admin_sidebar_upgrade()
38
- {?>
39
- <hr/>
40
- <p class="emodal-feature-list" style="text-align:center">
41
- More &amp; Extended Features<br/>
42
- Unlimited Themes <span>&middot;</span> Exclusive Add Ons<br/>
43
- Exclusive Themes <span>&middot;</span> Priority Support<br/>
44
- <img src="<?php echo EMCORE_URL;?>/assets/images/admin/sidebar-logo.png" alt="Easy Modal Pro" /><br/>
45
- <a href="https://easy-modal.com/pricing" class="btn" target="_blank">Upgrade</a><br/>
46
- <a href="http://easy-modal.com" target="_blank">See what you’re missing out on</a>
47
- </p><?php
48
  }
49
 
50
- add_action('emodal_admin_sidebar', 'emodal_admin_sidebar_follow', 50);
51
- function emodal_admin_sidebar_follow()
52
- {?>
53
- <div class="follow-box">
54
- <a href="https://twitter.com/EasyModal" class="twitter-follow-button" data-show-count="true" data-show-screen-name="true" data-size="medium" data-lang="en">Follow Us</a><br />
55
- <div class="fb-like" data-href="https://facebook.com/EasyModal" data-send="false" data-width="100px" data-show-faces="false"></div>
56
- </div><?php
57
  }
1
  <?php
2
+
3
+
4
+ add_action( 'emodal_admin_sidebar', 'emodal_admin_sidebar_popup_maker', 5 );
5
+ function emodal_admin_sidebar_popup_maker() {
6
+ $user_id = get_current_user_id();
7
+ if ( ! get_user_meta( $user_id, 'emodal_popup_maker_notice_dismissed' ) ) {
8
+ return;
9
+ } elseif ( empty( $_GET['action'] ) && ! count_all_modals() && ! count_deleted_modals() ) {
10
+ return;
11
+ }
12
+
13
+ $url = esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=popup-maker' ), 'install-plugin_popup-maker' ) );
14
+ ?>
15
+ <p>Did you know, that Easy Modal has a fancy new replacement called <strong><a href="https://wordpress.org/plugins/popup-maker/" target="_blank">Popup Maker</a></strong>? It is the highest user rated popup & modal plugin available for WordPress.</p>
16
+ <ul class="ul-square">
17
+ <li>Unlimited themes</li>
18
+ <li>Precision Targeting, Triggers & Cookies</li>
19
+ <li>Customize everything</li>
20
+ <li>Full line of extensions</li>
21
+ <li>Extensive Documentation & Developer APIs</li>
22
+ <li><a href="https://wordpress.org/plugins/popup-maker/" target="_blank">Learn more</a> or <a href="<?php echo esc_url( $url ); ?>">Install it now!</a></li>
23
+ </ul>
24
+ <?php
25
+ }
26
+
27
+
28
+ add_action( 'emodal_admin_sidebar', 'emodal_admin_sidebar_share', 10 );
29
+ function emodal_admin_sidebar_share() {
30
+ ?>
31
+ <h3 class="loveit-shareit" style="text-align:center">Love It? <span>Share It!</span></h3>
32
+ <ul class="share-buttons">
33
+ <li>
34
+ <div class="fb-like" data-href="http://easy-modal.com" data-width="100" data-layout="box_count" data-action="like" data-show-faces="false" data-send="true"></div>
35
+ </li>
36
+ <li>
37
+ <a href="https://twitter.com/intent/tweet" class="twitter-share-button" data-count="vertical" data-url="http://easy-modal.com" data-via="wizard_is" data-related="wizard_is">Tweet</a>
38
+ </li>
39
+ <li>
40
+ <div class="g-plusone" data-href="http://easy-modal.com" data-size="tall"></div>
41
+ </li>
42
+ </ul> <br class="clear" /> <br class="clear" />
43
+ <div style="text-align:center">
44
+ <a class="button rounded" href="http://wordpress.org/support/view/plugin-reviews/easy-modal#postform">Rate us on WordPress!</a>
45
+ </div><?php
46
  }
47
 
48
+ add_action( 'emodal_admin_sidebar', 'emodal_admin_sidebar_documentation', 20 );
49
+ function emodal_admin_sidebar_documentation() {
50
+ ?>
51
+ <a href="http://easy-modal.com/documentation?utm_source=emcore&utm_medium=dashboard+link&utm_campaign=documentation" target="_blank">
52
+ <img src="<?php echo EMCORE_URL; ?>/assets/images/admin/sidebar-documentation.jpg" alt="Easy Modal Documentation" style="max-width:100%;" />
53
+ </a><?php
54
  }
55
 
56
+ add_action( 'emodal_admin_sidebar', 'emodal_admin_sidebar_support', 30 );
57
+ function emodal_admin_sidebar_support() {
58
+ ?>
59
+ <hr /> <p class="emodal-feature-list" style="text-align:center">
60
+ <a href="http://easy-modal.com/support/pricing?utm_source=emcore&utm_medium=dashboard+link&utm_campaign=get+support+now" target="_blank"><img src="<?php echo EMCORE_URL; ?>/assets/images/admin/sidebar-priority-support.png" alt="Priority Support" /></a><br />
61
+ <a href="http://easy-modal.com/support?utm_source=emcore&utm_medium=dashboard+link&utm_campaign=visit+support" target="_blank">Visit the Support Page</a>
62
+ </p><?php
 
63
  }
64
 
65
  //add_action('emodal_admin_sidebar', 'emodal_admin_sidebar_upgrade', 30);
66
+ function emodal_admin_sidebar_upgrade() {
67
+ ?>
68
+ <hr /> <p class="emodal-feature-list" style="text-align:center">
69
+ More &amp; Extended Features<br />
70
+ Unlimited Themes <span>&middot;</span> Exclusive Add Ons<br />
71
+ Exclusive Themes <span>&middot;</span> Priority Support<br />
72
+ <img src="<?php echo EMCORE_URL; ?>/assets/images/admin/sidebar-logo.png" alt="Easy Modal Pro" /><br />
73
+ <a href="https://easy-modal.com/pricing" class="btn" target="_blank">Upgrade</a><br />
74
+ <a href="http://easy-modal.com" target="_blank">See what you’re missing out on</a>
75
+ </p><?php
 
76
  }
77
 
78
+ add_action( 'emodal_admin_sidebar', 'emodal_admin_sidebar_follow', 50 );
79
+ function emodal_admin_sidebar_follow() {
80
+ ?>
81
+ <div class="follow-box">
82
+ <a href="https://twitter.com/EasyModal" class="twitter-follow-button" data-show-count="true" data-show-screen-name="true" data-size="medium" data-lang="en">Follow Us</a><br />
83
+ <div class="fb-like" data-href="https://facebook.com/EasyModal" data-send="false" data-width="100px" data-show-faces="false"></div>
84
+ </div><?php
85
  }
includes/functions.php CHANGED
@@ -1,4 +1,58 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  if(!function_exists("get_all_modals")){
3
  function enqueue_modal($id)
4
  {
1
  <?php
2
+ if ( ! function_exists( 'array_replace_recursive' ) ) :
3
+ /**
4
+ * PHP-agnostic version of {@link array_replace_recursive()}.
5
+ *
6
+ * The array_replace_recursive() function is a PHP 5.3 function. WordPress
7
+ * currently supports down to PHP 5.2, so this method is a workaround
8
+ * for PHP 5.2.
9
+ *
10
+ * Note: array_replace_recursive() supports infinite arguments, but for our use-
11
+ * case, we only need to support two arguments.
12
+ *
13
+ * Subject to removal once WordPress makes PHP 5.3.0 the minimum requirement.
14
+ *
15
+ * @since 4.5.3
16
+ *
17
+ * @see https://secure.php.net/manual/en/function.array-replace-recursive.php#109390
18
+ *
19
+ * @param array $base Array with keys needing to be replaced.
20
+ * @param array $replacements Array with the replaced keys.
21
+ *
22
+ * @return array
23
+ */
24
+ function array_replace_recursive( $base = array(), $replacements = array() ) {
25
+ foreach ( array_slice( func_get_args(), 1 ) as $replacements ) {
26
+ $bref_stack = array( &$base );
27
+ $head_stack = array( $replacements );
28
+
29
+ do {
30
+ end( $bref_stack );
31
+
32
+ $bref = &$bref_stack[ key( $bref_stack ) ];
33
+ $head = array_pop( $head_stack );
34
+
35
+ unset( $bref_stack[ key( $bref_stack ) ] );
36
+
37
+ foreach ( array_keys( $head ) as $key ) {
38
+ if ( isset( $key, $bref ) &&
39
+ isset( $bref[ $key ] ) && is_array( $bref[ $key ] ) &&
40
+ isset( $head[ $key ] ) && is_array( $head[ $key ] )
41
+ ) {
42
+ $bref_stack[] = &$bref[ $key ];
43
+ $head_stack[] = $head[ $key ];
44
+ } else {
45
+ $bref[ $key ] = $head[ $key ];
46
+ }
47
+ }
48
+ } while ( count( $head_stack ) );
49
+ }
50
+
51
+ return $base;
52
+ }
53
+ endif;
54
+
55
+
56
  if(!function_exists("get_all_modals")){
57
  function enqueue_modal($id)
58
  {
readme.txt CHANGED
@@ -1,16 +1,25 @@
1
  === Easy Modal ===
2
- Contributors: danieliser, waltmesser
3
- Author URI: http://wizardinternetsolutions.com
4
- Plugin URI: https://easy-modal.com
5
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PQTG2JYUKSLFW
6
  Tags: modal,modal box,modal form,modal window,popup,popup box,popup form,popup window,ajax forms, lightbox
7
- Requires at least: 3.4
8
- Tested up to: 4.0
9
- Stable tag: 2.0.17
 
10
  The #1 WordPress Popup Plugin! Make glorious & powerful popups and market your content like never before - all in minutes!
11
 
12
  == Description ==
13
- Easy Modal 3.0 has transformed into Popup Maker! Popup Maker delivers the ultimate, most versatile, all-in-one popup plugin to WordPress.
 
 
 
 
 
 
 
 
14
 
15
  We hope you enjoy using Popup Maker to destroy your old conversion rates!
16
 
@@ -18,10 +27,6 @@ We hope you enjoy using Popup Maker to destroy your old conversion rates!
18
 
19
  If you're an existing Easy Modal user, transitioning from Easy Modal to Popup Maker is a snap with our custom Importer! [See How!](https://wppopupmaker.com/kb/upgrading-easy-modal-popup-maker "Upgrade from Easy Modal to Popup Maker")
20
 
21
- If you own Easy Modal Addons, you can upgrade to Popup Maker for free.
22
- * [Yes, I want to upgrade for free!](https://wppopupmaker.com/easy-modal-customer-upgrade "Upgrade Your Easy Modal Product for Free") (recommended)
23
- * No thanks! I just [need support on my Easy Modal product](https://easy-modal.com/support "Get Support on Your Easy Modal Product").
24
-
25
  == Installation ==
26
  1. Login to WordPress and update to/install EasyModal version 2.0.13.
27
  2. For current users, settings from previously existing functionality will be imported to the appropriate Addons containing respective functionality automatically.
@@ -29,6 +34,12 @@ If you own Easy Modal Addons, you can upgrade to Popup Maker for free.
29
 
30
  == Changelog ==
31
 
 
 
 
 
 
 
32
  = v2.0.17 =
33
  * Tweak: Updated language domain information for upcoming translation by glotpress.
34
 
1
  === Easy Modal ===
2
+ Contributors: danieliser, wppopupmaker
3
+ Author URI: https://wizardis.com/
4
+ Plugin URI: https://wppopupmaker.com/
5
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PQTG2JYUKSLFW
6
  Tags: modal,modal box,modal form,modal window,popup,popup box,popup form,popup window,ajax forms, lightbox
7
+ Requires at least: 3.3.0
8
+ Tested up to: 4.7.3
9
+ Stable tag: 2.1.0
10
+
11
  The #1 WordPress Popup Plugin! Make glorious & powerful popups and market your content like never before - all in minutes!
12
 
13
  == Description ==
14
+
15
+ Did you know, that Easy Modal has a fancy new replacement called **[Popup Maker](https://wordpress.org/plugins/popup-maker/)**? It is the highest user rated popup & modal plugin available for WordPress.
16
+
17
+ * Unlimited themes
18
+ * Precision Targeting, Triggers & Cookies
19
+ * Customize everything
20
+ * Full line of extensions
21
+ * Extensive Documentation & Developer APIs
22
+ * [Learn more](https://wordpress.org/plugins/popup-maker/)!
23
 
24
  We hope you enjoy using Popup Maker to destroy your old conversion rates!
25
 
27
 
28
  If you're an existing Easy Modal user, transitioning from Easy Modal to Popup Maker is a snap with our custom Importer! [See How!](https://wppopupmaker.com/kb/upgrading-easy-modal-popup-maker "Upgrade from Easy Modal to Popup Maker")
29
 
 
 
 
 
30
  == Installation ==
31
  1. Login to WordPress and update to/install EasyModal version 2.0.13.
32
  2. For current users, settings from previously existing functionality will be imported to the appropriate Addons containing respective functionality automatically.
34
 
35
  == Changelog ==
36
 
37
+ = v2.1.0 =
38
+ * Tweak: Added a dismissible notice to the admin to let users know about **[Popup Maker](https://wordpress.org/plugins/popup-maker/)**.
39
+ * Fix: Patched minor security vulnerability.
40
+ * Discovered with DefenseCode ThunderScan Source Code Security Analyzer by Neven Biruski
41
+ * This can only be exploited by a user who already has access to the admin with a valid nonce.
42
+
43
  = v2.0.17 =
44
  * Tweak: Updated language domain information for upcoming translation by glotpress.
45