Version Description
Download this release
Release Info
Developer | danieliser |
Plugin | Easy Modal |
Version | 2.0.11 |
Comparing to | |
See all releases |
Code changes from version 2.0.10 to 2.0.11
- assets/images/admin/sidebar-documentation.jpg +0 -0
- assets/images/admin/sidebar-priority-support.png +0 -0
- assets/scripts/easy-modal-site.js +41 -33
- assets/styles/easy-modal-admin.css +9 -2
- classes/admin.php +35 -2
- classes/controller/admin/settings.php +24 -1
- classes/controller/admin/theme.php +1 -1
- classes/license.php +19 -0
- classes/model.php +3 -2
- classes/model/modal/meta.php +38 -1
- classes/model/theme.php +5 -2
- classes/model/theme/meta.php +36 -1
- classes/view/admin/addons.php +10 -25
- easy-modal.php +8 -14
- includes/admin/modal-form-general-tab.php +1 -1
- includes/admin/options.php +61 -63
- includes/admin/settings-form-general-tab.php +12 -0
- includes/admin/settings-form-licenses-tab.php +32 -0
- includes/admin/sidebar.php +12 -2
- includes/admin/theme-form-close-tab.php +7 -0
- includes/admin/theme-form-container-tab.php +7 -0
- includes/admin/theme-form-general-tab.php +2 -2
- includes/admin/theme-form-overlay-tab.php +8 -7
- includes/functions.php +42 -0
- includes/plugin-updater.php +170 -0
- includes/shortcodes.php +2 -0
- init.php +4 -1
- readme.txt +30 -41
assets/images/admin/sidebar-documentation.jpg
CHANGED
Binary file
|
assets/images/admin/sidebar-priority-support.png
CHANGED
Binary file
|
assets/scripts/easy-modal-site.js
CHANGED
@@ -56,10 +56,11 @@
|
|
56 |
});
|
57 |
},
|
58 |
setup_close: function () {
|
59 |
-
var $this = jQuery(this)
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
63 |
$close
|
64 |
.off('click.emodal')
|
65 |
.on("click.emodal", function (e) {
|
@@ -112,8 +113,8 @@
|
|
112 |
},
|
113 |
close: function () {
|
114 |
return this.each(function () {
|
115 |
-
var $this = jQuery(this)
|
116 |
-
|
117 |
$this
|
118 |
.trigger('emodalBeforeClose')
|
119 |
.removeClass('active')
|
@@ -706,32 +707,39 @@
|
|
706 |
return result;
|
707 |
};
|
708 |
|
709 |
-
}(jQuery));
|
710 |
-
jQuery(document).ready(function () {
|
711 |
-
jQuery('.emodal')
|
712 |
-
.emodal()
|
713 |
-
.each(function () {
|
714 |
-
var $this = jQuery(this);
|
715 |
-
jQuery('.' + $this.attr('id')).on('click', function (e) {
|
716 |
-
e.preventDefault();
|
717 |
-
e.stopPropagation();
|
718 |
-
$this.emodal('open');
|
719 |
-
});
|
720 |
-
jQuery('.' + $this.attr('id')).css('cursor', 'pointer');
|
721 |
-
})
|
722 |
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
jQuery(
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
734 |
});
|
735 |
-
|
736 |
-
|
737 |
-
})
|
|
|
|
56 |
});
|
57 |
},
|
58 |
setup_close: function () {
|
59 |
+
var $this = jQuery(this),
|
60 |
+
settings = $this.data('emodal'),
|
61 |
+
$overlay = jQuery('#' + settings.overlay.attr.id),
|
62 |
+
$close = jQuery('.' + settings.close.attr.class, $this);
|
63 |
+
|
64 |
$close
|
65 |
.off('click.emodal')
|
66 |
.on("click.emodal", function (e) {
|
113 |
},
|
114 |
close: function () {
|
115 |
return this.each(function () {
|
116 |
+
var $this = jQuery(this),
|
117 |
+
settings = $this.data('emodal');
|
118 |
$this
|
119 |
.trigger('emodalBeforeClose')
|
120 |
.removeClass('active')
|
707 |
return result;
|
708 |
};
|
709 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
710 |
|
711 |
+
|
712 |
+
jQuery(document).ready(function () {
|
713 |
+
jQuery('.emodal')
|
714 |
+
.emodal()
|
715 |
+
.each(function () {
|
716 |
+
var $this = jQuery(this);
|
717 |
+
jQuery('.' + $this.attr('id')).on('click', function (e) {
|
718 |
+
e.preventDefault();
|
719 |
+
e.stopPropagation();
|
720 |
+
$this.emodal('open');
|
721 |
+
});
|
722 |
+
jQuery('.' + $this.attr('id')).css('cursor', 'pointer');
|
723 |
+
// Close Overlay
|
724 |
+
$this.on('emodalBeforeClose', function (e) {
|
725 |
+
var $this = jQuery(this),
|
726 |
+
settings = $this.data('emodal'),
|
727 |
+
$overlay = jQuery('#' + settings.overlay.attr.id);
|
728 |
+
if ($overlay.length && $overlay.is(":visible")) {
|
729 |
+
$overlay.fadeOut(settings.close.close_speed);
|
730 |
+
}
|
731 |
+
})
|
732 |
+
// Reset Videos
|
733 |
+
.on('emodalAfterClose', function (e) {
|
734 |
+
var $this = jQuery(this),
|
735 |
+
settings = $this.data('emodal');
|
736 |
+
|
737 |
+
jQuery('iframe', $this).filter('[src*="youtube"],[src*="vimeo"]').each(function () {
|
738 |
+
var src = jQuery(this).attr('src');
|
739 |
+
jQuery(this).attr('src', '').attr('src', src);
|
740 |
});
|
741 |
+
});
|
742 |
+
|
743 |
+
})
|
744 |
+
});
|
745 |
+
}(jQuery));
|
assets/styles/easy-modal-admin.css
CHANGED
@@ -31,7 +31,7 @@
|
|
31 |
.button.rounded {
|
32 |
box-shadow: none;
|
33 |
border:0;
|
34 |
-
border-radius:
|
35 |
background:#0074a2;
|
36 |
color:#fff;
|
37 |
padding-left:18px;
|
@@ -41,7 +41,12 @@
|
|
41 |
}
|
42 |
.button.rounded:hover {
|
43 |
color:#fff;
|
44 |
-
background:#
|
|
|
|
|
|
|
|
|
|
|
45 |
transform:scale(1.125);
|
46 |
}
|
47 |
.loveit-shareit {
|
@@ -290,6 +295,7 @@
|
|
290 |
.addons-available .action-links .button {
|
291 |
display:inline-block;
|
292 |
margin-bottom: 10px;
|
|
|
293 |
background:#00b7cd;
|
294 |
color:#fff;
|
295 |
border-radius: 0;
|
@@ -315,6 +321,7 @@
|
|
315 |
font-size:14px;
|
316 |
text-align: center;
|
317 |
font-style: italic;
|
|
|
318 |
}
|
319 |
.addons-available a {
|
320 |
display:block;
|
31 |
.button.rounded {
|
32 |
box-shadow: none;
|
33 |
border:0;
|
34 |
+
border-radius:2px;
|
35 |
background:#0074a2;
|
36 |
color:#fff;
|
37 |
padding-left:18px;
|
41 |
}
|
42 |
.button.rounded:hover {
|
43 |
color:#fff;
|
44 |
+
background:#007fb1;
|
45 |
+
transform:scale(1.125);
|
46 |
+
}
|
47 |
+
.button.rounded:focus {
|
48 |
+
color:#fff;
|
49 |
+
background:#007fb1;
|
50 |
transform:scale(1.125);
|
51 |
}
|
52 |
.loveit-shareit {
|
295 |
.addons-available .action-links .button {
|
296 |
display:inline-block;
|
297 |
margin-bottom: 10px;
|
298 |
+
margin-top:8px;
|
299 |
background:#00b7cd;
|
300 |
color:#fff;
|
301 |
border-radius: 0;
|
321 |
font-size:14px;
|
322 |
text-align: center;
|
323 |
font-style: italic;
|
324 |
+
min-height: 4.5em;
|
325 |
}
|
326 |
.addons-available a {
|
327 |
display:block;
|
classes/admin.php
CHANGED
@@ -16,6 +16,7 @@
|
|
16 |
}
|
17 |
public function __construct()
|
18 |
{
|
|
|
19 |
global $EModal_License, $EModal_Admin_Menu, $EModal_Admin_Editor, $EModal_Admin_Postmeta;
|
20 |
$EModal_Admin_Menu = new EModal_Admin_Menu;
|
21 |
$EModal_Admin_Editor = new EModal_Admin_Editor;
|
@@ -129,6 +130,21 @@
|
|
129 |
public function reset_emodal_db() {
|
130 |
|
131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
if( isset( $_POST['reset_emodal_db'] ) ) {
|
133 |
|
134 |
// run a quick security check
|
@@ -136,12 +152,21 @@
|
|
136 |
return; // get out if we didn't click the Activate button
|
137 |
|
138 |
global $wpdb;
|
|
|
|
|
|
|
|
|
139 |
|
|
|
|
|
|
|
|
|
|
|
140 |
$wpdb->query( "DELETE FROM $wpdb->em_modal_metas" );
|
141 |
$wpdb->query( "DELETE FROM $wpdb->em_modals" );
|
142 |
$wpdb->query( "DELETE FROM $wpdb->em_theme_metas" );
|
143 |
$wpdb->query( "DELETE FROM $wpdb->em_themes" );
|
144 |
-
|
145 |
do_action('emodal_reset_db');
|
146 |
|
147 |
}
|
@@ -155,6 +180,11 @@
|
|
155 |
|
156 |
if(emodal_get_option('EasyModal_Version'))
|
157 |
{
|
|
|
|
|
|
|
|
|
|
|
158 |
new EModal_Migrate_Pre_V2;
|
159 |
|
160 |
do_action('emodal_migrate_db');
|
@@ -169,14 +199,17 @@
|
|
169 |
if( ! check_admin_referer( EMCORE_NONCE, EMCORE_NONCE ) )
|
170 |
return; // get out if we didn't click the Activate button
|
171 |
|
|
|
172 |
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_modal_metas`;" );
|
173 |
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_modals`;" );
|
174 |
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_theme_metas`;" );
|
175 |
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_themes`;" );
|
176 |
|
|
|
|
|
177 |
do_action('emodal_uninstall');
|
178 |
|
179 |
-
emodal_update_option('
|
180 |
}
|
181 |
}
|
182 |
|
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;
|
130 |
public function reset_emodal_db() {
|
131 |
|
132 |
|
133 |
+
if( isset( $_POST['remove_old_emodal_data'] ) ) {
|
134 |
+
|
135 |
+
// run a quick security check
|
136 |
+
if( ! check_admin_referer( EMCORE_NONCE, EMCORE_NONCE ) )
|
137 |
+
return; // get out if we didn't click the Activate button
|
138 |
+
|
139 |
+
global $wpdb;
|
140 |
+
|
141 |
+
$wpdb->query( "DELETE FROM $wpdb->options WHERE `option_name` LIKE 'EasyModal%';" );
|
142 |
+
|
143 |
+
do_action('remove_old_emodal_data');
|
144 |
+
|
145 |
+
}
|
146 |
+
|
147 |
+
|
148 |
if( isset( $_POST['reset_emodal_db'] ) ) {
|
149 |
|
150 |
// run a quick security check
|
152 |
return; // get out if we didn't click the Activate button
|
153 |
|
154 |
global $wpdb;
|
155 |
+
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_modal_metas`;" );
|
156 |
+
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_modals`;" );
|
157 |
+
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_theme_metas`;" );
|
158 |
+
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_themes`;" );
|
159 |
|
160 |
+
emodal_delete_option(EMCORE_SLUG.'_db_version');
|
161 |
+
|
162 |
+
do_action('emodal_db_update', false);
|
163 |
+
|
164 |
+
/*
|
165 |
$wpdb->query( "DELETE FROM $wpdb->em_modal_metas" );
|
166 |
$wpdb->query( "DELETE FROM $wpdb->em_modals" );
|
167 |
$wpdb->query( "DELETE FROM $wpdb->em_theme_metas" );
|
168 |
$wpdb->query( "DELETE FROM $wpdb->em_themes" );
|
169 |
+
*/
|
170 |
do_action('emodal_reset_db');
|
171 |
|
172 |
}
|
180 |
|
181 |
if(emodal_get_option('EasyModal_Version'))
|
182 |
{
|
183 |
+
global $wpdb;
|
184 |
+
$wpdb->query( "DELETE FROM $wpdb->em_modal_metas" );
|
185 |
+
$wpdb->query( "DELETE FROM $wpdb->em_modals" );
|
186 |
+
$wpdb->query( "DELETE FROM $wpdb->em_theme_metas" );
|
187 |
+
$wpdb->query( "DELETE FROM $wpdb->em_themes" );
|
188 |
new EModal_Migrate_Pre_V2;
|
189 |
|
190 |
do_action('emodal_migrate_db');
|
199 |
if( ! check_admin_referer( EMCORE_NONCE, EMCORE_NONCE ) )
|
200 |
return; // get out if we didn't click the Activate button
|
201 |
|
202 |
+
global $wpdb;
|
203 |
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_modal_metas`;" );
|
204 |
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_modals`;" );
|
205 |
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_theme_metas`;" );
|
206 |
$wpdb->query( "DROP TABLE IF EXISTS `$wpdb->em_themes`;" );
|
207 |
|
208 |
+
$wpdb->query( "DELETE FROM $wpdb->options WHERE `option_name` LIKE 'easy-modal%';" );
|
209 |
+
|
210 |
do_action('emodal_uninstall');
|
211 |
|
212 |
+
emodal_update_option( EMCORE_SLUG.'_uninstalled', true);
|
213 |
}
|
214 |
}
|
215 |
|
classes/controller/admin/settings.php
CHANGED
@@ -26,13 +26,36 @@
|
|
26 |
{
|
27 |
if($this->check_post_nonce() && isset($_POST['publish']))
|
28 |
{
|
|
|
29 |
$EModal_License = new EModal_License;
|
30 |
$EModal_License->check_license(empost('license.key'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
$new_values = apply_filters('emodal_settings_pre_save', emodal_get_option('emodal_settings'));
|
32 |
emodal_update_option('emodal_settings', $new_values);
|
33 |
do_action('emodal_settings_save', $new_values);
|
34 |
EModal_Admin_Notice::add(__('Settings Updated.',EMCORE_SLUG), 'updated');
|
35 |
-
EModal_Admin::check_updates();
|
36 |
$this->redirect_to_edit();
|
37 |
}
|
38 |
$view = new EModal_View_Admin_Settings_Form;
|
26 |
{
|
27 |
if($this->check_post_nonce() && isset($_POST['publish']))
|
28 |
{
|
29 |
+
/*
|
30 |
$EModal_License = new EModal_License;
|
31 |
$EModal_License->check_license(empost('license.key'));
|
32 |
+
if(!empty(empost('access_key')))
|
33 |
+
{
|
34 |
+
$new = empost('access_key');
|
35 |
+
$old = emodal_get_option( EMCORE_SLUG. '_access_key' );
|
36 |
+
if($new != '')
|
37 |
+
{
|
38 |
+
if($old === null || $old == '')
|
39 |
+
{
|
40 |
+
$new = SHA1($new);
|
41 |
+
}
|
42 |
+
elseif($old && $old != $new && $old != SHA1($new))
|
43 |
+
{
|
44 |
+
$new = SHA1($new);
|
45 |
+
}
|
46 |
+
emodal_update_option(EMCORE_SLUG. '_access_key', $new);
|
47 |
+
}
|
48 |
+
else
|
49 |
+
{
|
50 |
+
emodal_delete_option(EMCORE_SLUG. '_access_key');
|
51 |
+
}
|
52 |
+
}
|
53 |
+
*/
|
54 |
$new_values = apply_filters('emodal_settings_pre_save', emodal_get_option('emodal_settings'));
|
55 |
emodal_update_option('emodal_settings', $new_values);
|
56 |
do_action('emodal_settings_save', $new_values);
|
57 |
EModal_Admin_Notice::add(__('Settings Updated.',EMCORE_SLUG), 'updated');
|
58 |
+
//EModal_Admin::check_updates();
|
59 |
$this->redirect_to_edit();
|
60 |
}
|
61 |
$view = new EModal_View_Admin_Settings_Form;
|
classes/controller/admin/theme.php
CHANGED
@@ -23,7 +23,7 @@
|
|
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($new_values);
|
27 |
$current_theme->save();
|
28 |
do_action('emodal_theme_save', $current_theme);
|
29 |
EModal_Admin_Notice::add(__('Theme Updated.',EMCORE_SLUG), 'updated');
|
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("{$class_name}_defaults", $new_values));
|
27 |
$current_theme->save();
|
28 |
do_action('emodal_theme_save', $current_theme);
|
29 |
EModal_Admin_Notice::add(__('Theme Updated.',EMCORE_SLUG), 'updated');
|
classes/license.php
CHANGED
@@ -21,6 +21,25 @@
|
|
21 |
{
|
22 |
if(!$addons = get_transient(EMCORE_SLUG.'-addon-list'))
|
23 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
global $EModal_License;
|
25 |
$addons = $EModal_License->api_request('addon_list');
|
26 |
set_transient(EMCORE_SLUG.'-addon-list', $addons, 12 * HOUR_IN_SECONDS);
|
21 |
{
|
22 |
if(!$addons = get_transient(EMCORE_SLUG.'-addon-list'))
|
23 |
{
|
24 |
+
|
25 |
+
$access_key = trim( emodal_get_license('key') );
|
26 |
+
|
27 |
+
|
28 |
+
// data to send in our API request
|
29 |
+
$api_params = array(
|
30 |
+
'edd_action'=> 'addon_list',
|
31 |
+
'access_key' => $access_key,
|
32 |
+
'url' => home_url()
|
33 |
+
);
|
34 |
+
// Call the custom API.
|
35 |
+
$response = wp_remote_get( add_query_arg( $api_params, EMCORE_API_URL ), array( 'timeout' => 15, 'sslverify' => false ) );
|
36 |
+
|
37 |
+
// make sure the response came back okay
|
38 |
+
if ( is_wp_error( $response ) )
|
39 |
+
return false;
|
40 |
+
|
41 |
+
return json_decode( wp_remote_retrieve_body( $response ) );
|
42 |
+
|
43 |
global $EModal_License;
|
44 |
$addons = $EModal_License->api_request('addon_list');
|
45 |
set_transient(EMCORE_SLUG.'-addon-list', $addons, 12 * HOUR_IN_SECONDS);
|
classes/model.php
CHANGED
@@ -9,8 +9,9 @@
|
|
9 |
{
|
10 |
global $wpdb;
|
11 |
$table_name = $wpdb->prefix . $this->_table_name;
|
|
|
12 |
|
13 |
-
$this->_data = apply_filters("{$
|
14 |
|
15 |
if($id && is_numeric($id))
|
16 |
{
|
@@ -22,7 +23,7 @@
|
|
22 |
}
|
23 |
else
|
24 |
{
|
25 |
-
$this->set_fields(apply_filters("{$
|
26 |
}
|
27 |
return $this;
|
28 |
}
|
9 |
{
|
10 |
global $wpdb;
|
11 |
$table_name = $wpdb->prefix . $this->_table_name;
|
12 |
+
$class_name = strtolower($this->_class_name);
|
13 |
|
14 |
+
$this->_data = apply_filters("{$class_name}_fields", $this->_default_fields);
|
15 |
|
16 |
if($id && is_numeric($id))
|
17 |
{
|
23 |
}
|
24 |
else
|
25 |
{
|
26 |
+
$this->set_fields(apply_filters("{$class_name}_defaults", array()));
|
27 |
}
|
28 |
return $this;
|
29 |
}
|
classes/model/modal/meta.php
CHANGED
@@ -10,7 +10,44 @@
|
|
10 |
);
|
11 |
public function __construct($id = NULL)
|
12 |
{
|
|
|
|
|
|
|
|
|
13 |
$this->_default_fields['modal_id'] = $id;
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
10 |
);
|
11 |
public function __construct($id = NULL)
|
12 |
{
|
13 |
+
global $wpdb;
|
14 |
+
$table_name = $wpdb->prefix . $this->_table_name;
|
15 |
+
$class_name = strtolower($this->_class_name);
|
16 |
+
|
17 |
$this->_default_fields['modal_id'] = $id;
|
18 |
+
|
19 |
+
$this->_data = apply_filters("{$class_name}_fields", $this->_default_fields);
|
20 |
+
|
21 |
+
if($id && is_numeric($id))
|
22 |
+
{
|
23 |
+
$row = $wpdb->get_row("SELECT * FROM $table_name WHERE modal_id = $id ORDER BY id DESC LIMIT 1", ARRAY_A);
|
24 |
+
if($row[$this->_pk])
|
25 |
+
{
|
26 |
+
$this->process_load($row);
|
27 |
+
}
|
28 |
+
}
|
29 |
+
else
|
30 |
+
{
|
31 |
+
$this->set_fields(apply_filters("{$class_name}_defaults", array()));
|
32 |
+
}
|
33 |
+
return $this;
|
34 |
}
|
35 |
+
public function save()
|
36 |
+
{
|
37 |
+
global $wpdb;
|
38 |
+
$table_name = $wpdb->prefix . $this->_table_name;
|
39 |
+
|
40 |
+
$rows = $wpdb->get_col("SELECT id FROM $table_name WHERE modal_id = $this->modal_id ORDER BY id DESC");
|
41 |
+
if(count($rows))
|
42 |
+
{
|
43 |
+
$this->id = $rows[0];
|
44 |
+
$wpdb->update( $table_name, $this->serialized_values(), array('id' => $this->id));
|
45 |
+
}
|
46 |
+
else
|
47 |
+
{
|
48 |
+
$wpdb->insert( $table_name, $this->serialized_values());
|
49 |
+
$this->id = $wpdb->insert_id;
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
}
|
classes/model/theme.php
CHANGED
@@ -69,9 +69,12 @@ function get_all_modal_themes($where = "is_active = 1"){
|
|
69 |
$themes[$theme->id] = $theme;
|
70 |
$theme_ids[] = $theme->id;
|
71 |
}
|
72 |
-
|
73 |
{
|
74 |
-
|
|
|
|
|
|
|
75 |
}
|
76 |
return $themes;
|
77 |
}}
|
69 |
$themes[$theme->id] = $theme;
|
70 |
$theme_ids[] = $theme->id;
|
71 |
}
|
72 |
+
if(count($themes))
|
73 |
{
|
74 |
+
foreach($EModal_Model_Theme_Meta->load("SELECT * FROM {$wpdb->prefix}em_theme_metas WHERE theme_id IN (".implode(',', $theme_ids).")") as $meta)
|
75 |
+
{
|
76 |
+
$themes[$meta->theme_id]->meta->process_load($meta->as_array());
|
77 |
+
}
|
78 |
}
|
79 |
return $themes;
|
80 |
}}
|
classes/model/theme/meta.php
CHANGED
@@ -13,7 +13,42 @@
|
|
13 |
);
|
14 |
public function __construct($id = NULL)
|
15 |
{
|
|
|
|
|
|
|
|
|
16 |
$this->_default_fields['theme_id'] = $id;
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
13 |
);
|
14 |
public function __construct($id = NULL)
|
15 |
{
|
16 |
+
global $wpdb;
|
17 |
+
$table_name = $wpdb->prefix . $this->_table_name;
|
18 |
+
$class_name = strtolower($this->_class_name);
|
19 |
+
|
20 |
$this->_default_fields['theme_id'] = $id;
|
21 |
+
$this->_data = apply_filters("{$class_name}_fields", $this->_default_fields);
|
22 |
+
if($id && is_numeric($id))
|
23 |
+
{
|
24 |
+
$row = $wpdb->get_row("SELECT * FROM $table_name WHERE theme_id = $id ORDER BY id DESC LIMIT 1", ARRAY_A);
|
25 |
+
if($row[$this->_pk])
|
26 |
+
{
|
27 |
+
$this->process_load($row);
|
28 |
+
}
|
29 |
+
}
|
30 |
+
else
|
31 |
+
{
|
32 |
+
$this->set_fields(apply_filters("{$class_name}_defaults", array()));
|
33 |
+
}
|
34 |
+
return $this;
|
35 |
}
|
36 |
+
public function save()
|
37 |
+
{
|
38 |
+
global $wpdb;
|
39 |
+
$table_name = $wpdb->prefix . $this->_table_name;
|
40 |
+
|
41 |
+
$rows = $wpdb->get_col("SELECT id FROM $table_name WHERE theme_id = $this->theme_id ORDER BY id DESC");
|
42 |
+
if(count($rows))
|
43 |
+
{
|
44 |
+
$this->id = $rows[0];
|
45 |
+
$wpdb->update( $table_name, $this->serialized_values(), array('id' => $this->id));
|
46 |
+
}
|
47 |
+
else
|
48 |
+
{
|
49 |
+
$wpdb->insert( $table_name, $this->serialized_values());
|
50 |
+
$this->id = $wpdb->insert_id;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
}
|
classes/view/admin/addons.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
<div class="wrap">
|
6 |
<h2><?php esc_html_e(__($title, EMCORE_SLUG) );?></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">
|
@@ -45,16 +45,16 @@
|
|
45 |
foreach($addons as $addon) :?>
|
46 |
<li class="available-addon-inner">
|
47 |
<h3><?php esc_html_e($addon->name)?></h3>
|
48 |
-
<img class="addon-thumbnail" src="<?php esc_attr_e($addon->
|
49 |
-
<p><?php esc_html_e($addon->
|
50 |
<hr/><?php
|
51 |
-
if(!empty($addon->
|
52 |
{
|
53 |
$installerUrl = add_query_arg(
|
54 |
array(
|
55 |
'action' => 'install-plugin',
|
56 |
'plugin' => $addon->slug,
|
57 |
-
'
|
58 |
),
|
59 |
network_admin_url('update.php')
|
60 |
//admin_url('update.php')
|
@@ -64,7 +64,7 @@
|
|
64 |
printf(
|
65 |
'<a class="button install" href="%s">%s</a>',
|
66 |
esc_attr($installerUrl),
|
67 |
-
__('Install'
|
68 |
);?>
|
69 |
</span><?php
|
70 |
}
|
@@ -76,7 +76,7 @@
|
|
76 |
printf(
|
77 |
'<a class="button install" href="%s">%s</a>',
|
78 |
esc_attr($installed_plugins[$addon->slug.'/'.$addon->slug.'.php']["activation_url"]),
|
79 |
-
__('Activate'
|
80 |
);
|
81 |
|
82 |
}
|
@@ -85,35 +85,20 @@
|
|
85 |
printf(
|
86 |
'<a class="button install" href="%s">%s</a>',
|
87 |
esc_attr($installed_plugins[$addon->slug.'/'.$addon->slug.'.php']["deactivation_url"]),
|
88 |
-
__('Deactivate'
|
89 |
);
|
90 |
}?>
|
91 |
</span><?php
|
92 |
}
|
93 |
else
|
94 |
{
|
95 |
-
?><
|
96 |
-
if($addon->required_license == 'developer')
|
97 |
-
{
|
98 |
-
_e('This add on requires a Pro Developer License.', EMCORE_SLUG);
|
99 |
-
}
|
100 |
-
else
|
101 |
-
{
|
102 |
-
_e('This add on requires a Pro License.', EMCORE_SLUG);
|
103 |
-
}
|
104 |
-
?></span></div>
|
105 |
-
<span class="action-links"><a class="button" target="_blank" href="https://easy-modal.com/pricing"><?php _e('Upgrade', EMCORE_SLUG);?></a></span><?php
|
106 |
}?>
|
107 |
-
<a href="<?php echo esc_url($addon->homepage);?>" target="_blank"><?php _e('View the entire Add On Specs'
|
108 |
</li>
|
109 |
<?php endforeach;?>
|
110 |
</ul>
|
111 |
</div>
|
112 |
-
<div id="postbox-container-1" class="postbox-container">
|
113 |
-
<div class="meta-box-sortables ui-sortable" id="side-sortables">
|
114 |
-
<?php do_action('emodal_admin_sidebar');?>
|
115 |
-
</div>
|
116 |
-
</div>
|
117 |
</div>
|
118 |
<br class="clear"/>
|
119 |
</div>
|
5 |
<div class="wrap">
|
6 |
<h2><?php esc_html_e(__($title, EMCORE_SLUG) );?></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">
|
45 |
foreach($addons as $addon) :?>
|
46 |
<li class="available-addon-inner">
|
47 |
<h3><?php esc_html_e($addon->name)?></h3>
|
48 |
+
<img class="addon-thumbnail" src="<?php esc_attr_e($addon->image)?>">
|
49 |
+
<p><?php esc_html_e($addon->excerpt)?></p>
|
50 |
<hr/><?php
|
51 |
+
if(!empty($addon->download_link) && !isset($installed_plugins[$addon->slug.'/'.$addon->slug.'.php']))
|
52 |
{
|
53 |
$installerUrl = add_query_arg(
|
54 |
array(
|
55 |
'action' => 'install-plugin',
|
56 |
'plugin' => $addon->slug,
|
57 |
+
'edd_sample_plugin' => 1
|
58 |
),
|
59 |
network_admin_url('update.php')
|
60 |
//admin_url('update.php')
|
64 |
printf(
|
65 |
'<a class="button install" href="%s">%s</a>',
|
66 |
esc_attr($installerUrl),
|
67 |
+
__('Install')
|
68 |
);?>
|
69 |
</span><?php
|
70 |
}
|
76 |
printf(
|
77 |
'<a class="button install" href="%s">%s</a>',
|
78 |
esc_attr($installed_plugins[$addon->slug.'/'.$addon->slug.'.php']["activation_url"]),
|
79 |
+
__('Activate')
|
80 |
);
|
81 |
|
82 |
}
|
85 |
printf(
|
86 |
'<a class="button install" href="%s">%s</a>',
|
87 |
esc_attr($installed_plugins[$addon->slug.'/'.$addon->slug.'.php']["deactivation_url"]),
|
88 |
+
__('Deactivate')
|
89 |
);
|
90 |
}?>
|
91 |
</span><?php
|
92 |
}
|
93 |
else
|
94 |
{
|
95 |
+
?><span class="action-links"><a class="button" target="_blank" href="<?php esc_attr_e($addon->homepage);?>"><?php _e('Get It Now');?></a></span><?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
}?>
|
97 |
+
<a href="<?php echo esc_url($addon->homepage);?>" target="_blank"><?php _e('View the entire Add On Specs');?></a>
|
98 |
</li>
|
99 |
<?php endforeach;?>
|
100 |
</ul>
|
101 |
</div>
|
|
|
|
|
|
|
|
|
|
|
102 |
</div>
|
103 |
<br class="clear"/>
|
104 |
</div>
|
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: Wizard Internet Solutions
|
7 |
-
Version: 2.0.
|
8 |
Author URI: http://wizardinternetsolutions.com
|
9 |
Text Domain: easy-modal
|
10 |
*/
|
@@ -21,11 +21,11 @@ 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.
|
25 |
if (!defined('EMCORE_DB_VERSION'))
|
26 |
define('EMCORE_DB_VERSION', '1' );
|
27 |
if (!defined('EMCORE_API_URL'))
|
28 |
-
define('EMCORE_API_URL', 'http://easy-modal.com
|
29 |
|
30 |
load_plugin_textdomain( EMCORE_SLUG, false, EMCORE_SLUG.'/languages');
|
31 |
|
@@ -38,7 +38,7 @@ class EModal {
|
|
38 |
register_activation_hook( __FILE__, array($this,'activate') );
|
39 |
register_activation_hook( __FILE__, array($this,'install_data') );
|
40 |
|
41 |
-
if(!emodal_get_option('
|
42 |
{
|
43 |
add_action('plugins_loaded', array($this, 'activate'));
|
44 |
add_action('emodal_db_update', array($this,'install'), 1);
|
@@ -62,7 +62,7 @@ class EModal {
|
|
62 |
}
|
63 |
public function deactivate()
|
64 |
{
|
65 |
-
emodal_delete_option('
|
66 |
}
|
67 |
public function inject_addons($response, $action, $args) {
|
68 |
|
@@ -170,9 +170,7 @@ class EModal {
|
|
170 |
close longtext,
|
171 |
title longtext,
|
172 |
content longtext,
|
173 |
-
PRIMARY KEY (id)
|
174 |
-
KEY theme_id (theme_id),
|
175 |
-
CONSTRAINT {$wpdb->prefix}em_theme_metas_ibfk_1 FOREIGN KEY (theme_id) REFERENCES {$wpdb->prefix}em_themes (id) ON DELETE CASCADE ON UPDATE CASCADE
|
176 |
)$charset_collate;";
|
177 |
dbDelta( $sql );
|
178 |
|
@@ -189,9 +187,7 @@ class EModal {
|
|
189 |
is_system tinyint(1) NOT NULL DEFAULT '0',
|
190 |
is_active tinyint(1) NOT NULL DEFAULT '1',
|
191 |
is_trash tinyint(1) NOT NULL DEFAULT '0',
|
192 |
-
PRIMARY KEY (id)
|
193 |
-
KEY {$wpdb->prefix}em_modals_ibfk_1 (theme_id),
|
194 |
-
CONSTRAINT {$wpdb->prefix}em_modals_ibfk_1 FOREIGN KEY (theme_id) REFERENCES {$wpdb->prefix}em_themes (id) ON DELETE RESTRICT ON UPDATE CASCADE
|
195 |
)$charset_collate;";
|
196 |
dbDelta( $sql );
|
197 |
|
@@ -201,9 +197,7 @@ class EModal {
|
|
201 |
modal_id mediumint(9) unsigned NOT NULL,
|
202 |
display longtext,
|
203 |
close longtext,
|
204 |
-
PRIMARY KEY (id)
|
205 |
-
KEY modal_id (modal_id),
|
206 |
-
CONSTRAINT {$wpdb->prefix}em_modal_metas_ibfk_1 FOREIGN KEY (modal_id) REFERENCES {$wpdb->prefix}em_modals (id) ON DELETE CASCADE ON UPDATE CASCADE
|
207 |
)$charset_collate;";
|
208 |
dbDelta( $sql );
|
209 |
|
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: Wizard Internet Solutions
|
7 |
+
Version: 2.0.11
|
8 |
Author URI: http://wizardinternetsolutions.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.0.11' );
|
25 |
if (!defined('EMCORE_DB_VERSION'))
|
26 |
define('EMCORE_DB_VERSION', '1' );
|
27 |
if (!defined('EMCORE_API_URL'))
|
28 |
+
define('EMCORE_API_URL', 'http://easy-modal.com');
|
29 |
|
30 |
load_plugin_textdomain( EMCORE_SLUG, false, EMCORE_SLUG.'/languages');
|
31 |
|
38 |
register_activation_hook( __FILE__, array($this,'activate') );
|
39 |
register_activation_hook( __FILE__, array($this,'install_data') );
|
40 |
|
41 |
+
if(!emodal_get_option(EMCORE_SLUG.'_uninstalled'))
|
42 |
{
|
43 |
add_action('plugins_loaded', array($this, 'activate'));
|
44 |
add_action('emodal_db_update', array($this,'install'), 1);
|
62 |
}
|
63 |
public function deactivate()
|
64 |
{
|
65 |
+
emodal_delete_option(EMCORE_SLUG.'_uninstalled');
|
66 |
}
|
67 |
public function inject_addons($response, $action, $args) {
|
68 |
|
170 |
close longtext,
|
171 |
title longtext,
|
172 |
content longtext,
|
173 |
+
PRIMARY KEY (id)
|
|
|
|
|
174 |
)$charset_collate;";
|
175 |
dbDelta( $sql );
|
176 |
|
187 |
is_system tinyint(1) NOT NULL DEFAULT '0',
|
188 |
is_active tinyint(1) NOT NULL DEFAULT '1',
|
189 |
is_trash tinyint(1) NOT NULL DEFAULT '0',
|
190 |
+
PRIMARY KEY (id)
|
|
|
|
|
191 |
)$charset_collate;";
|
192 |
dbDelta( $sql );
|
193 |
|
197 |
modal_id mediumint(9) unsigned NOT NULL,
|
198 |
display longtext,
|
199 |
close longtext,
|
200 |
+
PRIMARY KEY (id)
|
|
|
|
|
201 |
)$charset_collate;";
|
202 |
dbDelta( $sql );
|
203 |
|
includes/admin/modal-form-general-tab.php
CHANGED
@@ -47,7 +47,7 @@ function emodal_admin_modal_form_general_tab_settings_load_type()
|
|
47 |
<option value="per-page-post"<?php echo !get_current_modal('is_sitewide') ? ' selected="selected"' : '';?>><?php _e('Per Page/Post');?></option>
|
48 |
<option value="sitewide"<?php echo get_current_modal('is_sitewide') ? ' selected="selected"' : '';?>><?php _e('Load Sitewide');?></option>
|
49 |
</select>
|
50 |
-
<p class="description"><?php _e('Load this modal per page or sitewide.', EMCORE_SLUG)?></p>
|
51 |
</td>
|
52 |
</tr><?php
|
53 |
}
|
47 |
<option value="per-page-post"<?php echo !get_current_modal('is_sitewide') ? ' selected="selected"' : '';?>><?php _e('Per Page/Post');?></option>
|
48 |
<option value="sitewide"<?php echo get_current_modal('is_sitewide') ? ' selected="selected"' : '';?>><?php _e('Load Sitewide');?></option>
|
49 |
</select>
|
50 |
+
<p class="description"><?php _e('Load this modal per page or sitewide. If per page or post, select the modal on the edit page.', EMCORE_SLUG)?></p>
|
51 |
</td>
|
52 |
</tr><?php
|
53 |
}
|
includes/admin/options.php
CHANGED
@@ -27,71 +27,69 @@ function emodal_model_modal_meta_core_defaults($options){
|
|
27 |
|
28 |
add_action('emodal_model_theme_meta_defaults', 'emodal_model_theme_meta_core_defaults', 10);
|
29 |
function emodal_model_theme_meta_core_defaults($options){
|
30 |
-
$options['overlay']['background']['color'] = '#220E10';
|
31 |
-
$options['overlay']['background']['opacity'] = 85;
|
32 |
-
|
33 |
-
$options['container']['padding'] = 10;
|
34 |
-
$options['container']['background']['color'] = '#F7F5E7';
|
35 |
-
$options['container']['background']['opacity'] = 100;
|
36 |
-
$options['container']['border']['style'] = 'solid';
|
37 |
-
$options['container']['border']['color'] = '#f0532b';
|
38 |
-
$options['container']['border']['width'] = 1;
|
39 |
-
$options['container']['border']['radius'] = 8;
|
40 |
-
$options['container']['boxshadow']['inset'] = 'no';
|
41 |
-
$options['container']['boxshadow']['horizontal'] = 3;
|
42 |
-
$options['container']['boxshadow']['vertical'] = 3;
|
43 |
-
$options['container']['boxshadow']['blur'] = 2;
|
44 |
-
$options['container']['boxshadow']['spread'] = 0;
|
45 |
-
$options['container']['boxshadow']['color'] = '#000';
|
46 |
-
$options['container']['boxshadow']['opacity'] = 0.4;
|
47 |
-
|
48 |
-
$options['title']['font']['color'] = '#f0532b';
|
49 |
-
$options['title']['font']['size'] = 32;
|
50 |
-
$options['title']['font']['family'] = 'Tahoma';
|
51 |
-
$options['title']['text']['align'] = 'center';
|
52 |
-
$options['title']['textshadow']['horizontal'] = 0;
|
53 |
-
$options['title']['textshadow']['vertical'] = 0;
|
54 |
-
$options['title']['textshadow']['blur'] = 0;
|
55 |
-
$options['title']['textshadow']['color'] = '#000';
|
56 |
-
$options['title']['textshadow']['opacity'] = 0;
|
57 |
-
|
58 |
-
$options['content']['font']['color'] = '#f0532b';
|
59 |
-
$options['content']['font']['family'] = 'Times New Roman';
|
60 |
-
|
61 |
-
$options['close']['text'] = __('×', EMCORE_SLUG);
|
62 |
-
$options['close']['location'] = 'topright';
|
63 |
-
$options['close']['position']['top'] = 0;
|
64 |
-
$options['close']['position']['left'] = 0;
|
65 |
-
$options['close']['position']['bottom'] = 0;
|
66 |
-
$options['close']['position']['right'] = 0;
|
67 |
-
$options['close']['padding'] = 2;
|
68 |
-
$options['close']['background']['color'] = '#000';
|
69 |
-
$options['close']['background']['opacity'] = 100;
|
70 |
-
$options['close']['font']['color'] = '#f0532b';
|
71 |
-
$options['close']['font']['size'] = 16;
|
72 |
-
$options['close']['font']['family'] = 'Times New Roman';
|
73 |
-
$options['close']['border']['style'] = 'solid';
|
74 |
-
$options['close']['border']['color'] = '#fff';
|
75 |
-
$options['close']['border']['width'] = 1;
|
76 |
-
$options['close']['border']['radius'] = 10;
|
77 |
-
$options['close']['boxshadow']['inset'] = 'no';
|
78 |
-
$options['close']['boxshadow']['horizontal'] = 0;
|
79 |
-
$options['close']['boxshadow']['vertical'] = 0;
|
80 |
-
$options['close']['boxshadow']['blur'] = 0;
|
81 |
-
$options['close']['boxshadow']['spread'] = 0;
|
82 |
-
$options['close']['boxshadow']['color'] = '#000';
|
83 |
-
$options['close']['boxshadow']['opacity'] = 0;
|
84 |
-
$options['close']['textshadow']['horizontal'] = 0;
|
85 |
-
$options['close']['textshadow']['vertical'] = 0;
|
86 |
-
$options['close']['textshadow']['blur'] = 0;
|
87 |
-
$options['close']['textshadow']['color'] = '#000';
|
88 |
-
$options['close']['textshadow']['opacity'] = 0;
|
89 |
-
return $options;
|
90 |
-
}
|
91 |
-
|
92 |
-
|
93 |
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
|
97 |
add_filter('emodal_size_unit_options', 'emodal_core_size_unit_options',10);
|
27 |
|
28 |
add_action('emodal_model_theme_meta_defaults', 'emodal_model_theme_meta_core_defaults', 10);
|
29 |
function emodal_model_theme_meta_core_defaults($options){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
|
32 |
+
if(empty($options['overlay']['background']['color'])) $options['overlay']['background']['color'] = '#ffffff';
|
33 |
+
if(empty($options['overlay']['background']['opacity'])) $options['overlay']['background']['opacity'] = 100;
|
34 |
+
|
35 |
+
if(empty($options['container']['padding'])) $options['container']['padding'] = 18;
|
36 |
+
if(empty($options['container']['background']['color'])) $options['container']['background']['color'] = '#f9f9f9';
|
37 |
+
if(empty($options['container']['background']['opacity'])) $options['container']['background']['opacity'] = 100;
|
38 |
+
if(empty($options['container']['border']['style'])) $options['container']['border']['style'] = 'none';
|
39 |
+
if(empty($options['container']['border']['color'])) $options['container']['border']['color'] = '#000000';
|
40 |
+
if(empty($options['container']['border']['width'])) $options['container']['border']['width'] = 1;
|
41 |
+
if(empty($options['container']['border']['radius'])) $options['container']['border']['radius'] = 0;
|
42 |
+
if(empty($options['container']['boxshadow']['inset'])) $options['container']['boxshadow']['inset'] = 'no';
|
43 |
+
if(empty($options['container']['boxshadow']['horizontal'])) $options['container']['boxshadow']['horizontal'] = 1;
|
44 |
+
if(empty($options['container']['boxshadow']['vertical'])) $options['container']['boxshadow']['vertical'] = 1;
|
45 |
+
if(empty($options['container']['boxshadow']['blur'])) $options['container']['boxshadow']['blur'] = 3;
|
46 |
+
if(empty($options['container']['boxshadow']['spread'])) $options['container']['boxshadow']['spread'] = 0;
|
47 |
+
if(empty($options['container']['boxshadow']['color'])) $options['container']['boxshadow']['color'] = '#020202';
|
48 |
+
if(empty($options['container']['boxshadow']['opacity'])) $options['container']['boxshadow']['opacity'] = 23;
|
49 |
+
|
50 |
+
if(empty($options['title']['font']['color'])) $options['title']['font']['color'] = '#000000';
|
51 |
+
if(empty($options['title']['font']['size'])) $options['title']['font']['size'] = 32;
|
52 |
+
if(empty($options['title']['font']['family'])) $options['title']['font']['family'] = 'Tahoma';
|
53 |
+
if(empty($options['title']['text']['align'])) $options['title']['text']['align'] = 'left';
|
54 |
+
if(empty($options['title']['textshadow']['horizontal'])) $options['title']['textshadow']['horizontal'] = 0;
|
55 |
+
if(empty($options['title']['textshadow']['vertical'])) $options['title']['textshadow']['vertical'] = 0;
|
56 |
+
if(empty($options['title']['textshadow']['blur'])) $options['title']['textshadow']['blur'] = 0;
|
57 |
+
if(empty($options['title']['textshadow']['color'])) $options['title']['textshadow']['color'] = '#020202';
|
58 |
+
if(empty($options['title']['textshadow']['opacity'])) $options['title']['textshadow']['opacity'] = 0;
|
59 |
+
|
60 |
+
if(empty($options['content']['font']['color'])) $options['content']['font']['color'] = '#8c8c8c';
|
61 |
+
if(empty($options['content']['font']['family'])) $options['content']['font']['family'] = 'Times New Roman';
|
62 |
+
|
63 |
+
if(empty($options['close']['text'])) $options['close']['text'] = __('CLOSE', EMCORE_SLUG);
|
64 |
+
if(empty($options['close']['location'])) $options['close']['location'] = 'topright';
|
65 |
+
if(empty($options['close']['position']['top'])) $options['close']['position']['top'] = 0;
|
66 |
+
if(empty($options['close']['position']['left'])) $options['close']['position']['left'] = 0;
|
67 |
+
if(empty($options['close']['position']['bottom'])) $options['close']['position']['bottom'] = 0;
|
68 |
+
if(empty($options['close']['position']['right'])) $options['close']['position']['right'] = 0;
|
69 |
+
if(empty($options['close']['padding'])) $options['close']['padding'] = 8;
|
70 |
+
if(empty($options['close']['background']['color'])) $options['close']['background']['color'] = '#00b7cd';
|
71 |
+
if(empty($options['close']['background']['opacity'])) $options['close']['background']['opacity'] = 100;
|
72 |
+
if(empty($options['close']['font']['color'])) $options['close']['font']['color'] = '#ffffff';
|
73 |
+
if(empty($options['close']['font']['size'])) $options['close']['font']['size'] = 12;
|
74 |
+
if(empty($options['close']['font']['family'])) $options['close']['font']['family'] = 'Times New Roman';
|
75 |
+
if(empty($options['close']['border']['style'])) $options['close']['border']['style'] = 'none';
|
76 |
+
if(empty($options['close']['border']['color'])) $options['close']['border']['color'] = '#ffffff';
|
77 |
+
if(empty($options['close']['border']['width'])) $options['close']['border']['width'] = 1;
|
78 |
+
if(empty($options['close']['border']['radius'])) $options['close']['border']['radius'] = 0;
|
79 |
+
if(empty($options['close']['boxshadow']['inset'])) $options['close']['boxshadow']['inset'] = 'no';
|
80 |
+
if(empty($options['close']['boxshadow']['horizontal'])) $options['close']['boxshadow']['horizontal'] = 0;
|
81 |
+
if(empty($options['close']['boxshadow']['vertical'])) $options['close']['boxshadow']['vertical'] = 0;
|
82 |
+
if(empty($options['close']['boxshadow']['blur'])) $options['close']['boxshadow']['blur'] = 0;
|
83 |
+
if(empty($options['close']['boxshadow']['spread'])) $options['close']['boxshadow']['spread'] = 0;
|
84 |
+
if(empty($options['close']['boxshadow']['color'])) $options['close']['boxshadow']['color'] = '#020202';
|
85 |
+
if(empty($options['close']['boxshadow']['opacity'])) $options['close']['boxshadow']['opacity'] = 0;
|
86 |
+
if(empty($options['close']['textshadow']['horizontal'])) $options['close']['textshadow']['horizontal'] = 0;
|
87 |
+
if(empty($options['close']['textshadow']['vertical'])) $options['close']['textshadow']['vertical'] = 0;
|
88 |
+
if(empty($options['close']['textshadow']['blur'])) $options['close']['textshadow']['blur'] = 0;
|
89 |
+
if(empty($options['close']['textshadow']['color'])) $options['close']['textshadow']['color'] = '#000000';
|
90 |
+
if(empty($options['close']['textshadow']['opacity'])) $options['close']['textshadow']['opacity'] = 0;
|
91 |
+
return $options;
|
92 |
+
}
|
93 |
|
94 |
|
95 |
add_filter('emodal_size_unit_options', 'emodal_core_size_unit_options',10);
|
includes/admin/settings-form-general-tab.php
CHANGED
@@ -20,6 +20,7 @@ function emodal_admin_settings_form_general_tab()
|
|
20 |
add_action('emodal_admin_settings_form_tab_general_settings', 'emodal_admin_settings_form_general_tab_license', 10);
|
21 |
function emodal_admin_settings_form_general_tab_license()
|
22 |
{?>
|
|
|
23 |
<tr class="form-field">
|
24 |
<th scope="row">
|
25 |
<label for="license_key"><?php _e('License Key', EMCORE_SLUG);?></label>
|
@@ -50,7 +51,18 @@ function emodal_admin_settings_form_general_tab_license()
|
|
50 |
}?>
|
51 |
<img style="max-width:623px;width:100%;" src="<?php esc_attr_e($box_src.'.jpg');?>"/>
|
52 |
</td>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
</tr>
|
|
|
54 |
<tr class="form-field">
|
55 |
<th scope="row">
|
56 |
<label><?php _e('Reset Easy Modal Database', EMCORE_SLUG);?></label>
|
20 |
add_action('emodal_admin_settings_form_tab_general_settings', 'emodal_admin_settings_form_general_tab_license', 10);
|
21 |
function emodal_admin_settings_form_general_tab_license()
|
22 |
{?>
|
23 |
+
<!--
|
24 |
<tr class="form-field">
|
25 |
<th scope="row">
|
26 |
<label for="license_key"><?php _e('License Key', EMCORE_SLUG);?></label>
|
51 |
}?>
|
52 |
<img style="max-width:623px;width:100%;" src="<?php esc_attr_e($box_src.'.jpg');?>"/>
|
53 |
</td>
|
54 |
+
</tr>-->
|
55 |
+
<?php if(1==0 && emodal_get_option(EMCORE_SLUG.'_migration_approval')) : ?>
|
56 |
+
<tr class="form-field">
|
57 |
+
<th scope="row">
|
58 |
+
<label><?php _e('Approve Migration', EMCORE_SLUG);?></label>
|
59 |
+
</th>
|
60 |
+
<td>
|
61 |
+
<button type="submit" name="remove_old_emodal_data">Aprove</button>
|
62 |
+
<p class="description"><?php _e('Click this if you are sure your modals, themes and settings imported successfully.' , EMCORE_SLUG)?></p>
|
63 |
+
</td>
|
64 |
</tr>
|
65 |
+
<?php endif; ?>
|
66 |
<tr class="form-field">
|
67 |
<th scope="row">
|
68 |
<label><?php _e('Reset Easy Modal Database', EMCORE_SLUG);?></label>
|
includes/admin/settings-form-licenses-tab.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
add_filter('emodal_admin_settings_form_tabs', 'emodal_admin_settings_licenses_tab', 10);
|
3 |
+
function emodal_admin_settings_licenses_tab($tabs)
|
4 |
+
{
|
5 |
+
$tabs[] = array( 'id' => 'licenses', 'label' => __('Licenses', EMCORE_SLUG) );
|
6 |
+
return $tabs;
|
7 |
+
}
|
8 |
+
|
9 |
+
add_action('emodal_admin_settings_form_tab_licenses', 'emodal_admin_settings_form_licenses_tab', 20);
|
10 |
+
function emodal_admin_settings_form_licenses_tab()
|
11 |
+
{
|
12 |
+
?><table class="form-table">
|
13 |
+
<tbody>
|
14 |
+
<?php do_action('emodal_admin_settings_form_tab_licenses_settings');?>
|
15 |
+
</tbody>
|
16 |
+
</table><?php
|
17 |
+
}
|
18 |
+
|
19 |
+
|
20 |
+
//add_action('emodal_admin_settings_form_tab_licenses_settings', 'emodal_admin_settings_form_glicenses_tab_access_key', 10);
|
21 |
+
function emodal_admin_settings_form_glicenses_tab_access_key()
|
22 |
+
{?>
|
23 |
+
<tr class="form-field">
|
24 |
+
<th scope="row">
|
25 |
+
<label for="access_key"><?php _e('Access Key', EMCORE_SLUG);?></label>
|
26 |
+
</th>
|
27 |
+
<td>
|
28 |
+
<input type="<?php echo emodal_get_option('access_key') ? 'password' : 'text'?>" id="access_key" name="access_key" value="<?php esc_attr_e(emodal_get_option('access_key'))?>" class="regular-text"/>
|
29 |
+
<p class="description"><?php _e( 'Enter your access key to unlock addons.',EMCORE_SLUG)?></p>
|
30 |
+
</td>
|
31 |
+
</tr><?php
|
32 |
+
}
|
includes/admin/sidebar.php
CHANGED
@@ -19,11 +19,21 @@ 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" />
|
23 |
</a><?php
|
24 |
}
|
25 |
|
26 |
-
add_action('emodal_admin_sidebar', '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
function emodal_admin_sidebar_upgrade()
|
28 |
{?>
|
29 |
<hr/>
|
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/>
|
includes/admin/theme-form-close-tab.php
CHANGED
@@ -173,6 +173,13 @@ function emodal_admin_theme_form_close_tab_settings_background()
|
|
173 |
<span class="range-value regular-text"><span class="value"><?php esc_html_e(get_current_modal_theme('meta.close.background.opacity'));?></span>px</span>
|
174 |
</td>
|
175 |
</tr><?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
}
|
177 |
|
178 |
|
173 |
<span class="range-value regular-text"><span class="value"><?php esc_html_e(get_current_modal_theme('meta.close.background.opacity'));?></span>px</span>
|
174 |
</td>
|
175 |
</tr><?php
|
176 |
+
if(!class_exists('EMAdvancedThemeEditor')){?>
|
177 |
+
<tr>
|
178 |
+
<th colspan="2" class="pro-upgrade-tip">
|
179 |
+
<img style="" src="<?php echo EMCORE_URL;?>/assets/images/admin/icon-info-21x21.png"/> Wanna use background images? <a href="http://easy-modal.com/addons/unlimited-themes" target="_blank">Check out Advanced Theme Editor!</a>.
|
180 |
+
</th>
|
181 |
+
</tr><?php
|
182 |
+
}
|
183 |
}
|
184 |
|
185 |
|
includes/admin/theme-form-container-tab.php
CHANGED
@@ -55,6 +55,13 @@ function emodal_admin_theme_form_container_tab_settings_background()
|
|
55 |
<span class="range-value regular-text"><span class="value"><?php esc_html_e(get_current_modal_theme('meta.container.background.opacity'));?></span>%</span>
|
56 |
</td>
|
57 |
</tr><?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
}
|
59 |
|
60 |
add_action('emodal_admin_theme_form_tab_container_settings', 'emodal_admin_theme_form_container_tab_settings_border', 30);
|
55 |
<span class="range-value regular-text"><span class="value"><?php esc_html_e(get_current_modal_theme('meta.container.background.opacity'));?></span>%</span>
|
56 |
</td>
|
57 |
</tr><?php
|
58 |
+
if(!class_exists('EMAdvancedThemeEditor')){?>
|
59 |
+
<tr>
|
60 |
+
<th colspan="2" class="pro-upgrade-tip">
|
61 |
+
<img style="" src="<?php echo EMCORE_URL;?>/assets/images/admin/icon-info-21x21.png"/> Wanna use background images? <a href="http://easy-modal.com/addons/unlimited-themes" target="_blank">Check out Advanced Theme Editor!</a>.
|
62 |
+
</th>
|
63 |
+
</tr><?php
|
64 |
+
}
|
65 |
}
|
66 |
|
67 |
add_action('emodal_admin_theme_form_tab_container_settings', 'emodal_admin_theme_form_container_tab_settings_border', 30);
|
includes/admin/theme-form-general-tab.php
CHANGED
@@ -30,11 +30,11 @@ function emodal_admin_theme_form_general_tab_settings_name()
|
|
30 |
<input type="text" class="regular-text" name="theme[name]" id="name" value="<?php esc_attr_e(get_current_modal_theme('name'))?>" required/>
|
31 |
</td>
|
32 |
</tr><?php
|
33 |
-
if(!class_exists('
|
34 |
<tr>
|
35 |
<th colspan="2" class="pro-upgrade-tip">
|
36 |
<hr/>
|
37 |
-
<img style="" src="<?php echo EMCORE_URL;?>/assets/images/admin/icon-info-21x21.png"/> Free Users can only create one (1) theme. <a href="
|
38 |
</th>
|
39 |
</tr><?php
|
40 |
}
|
30 |
<input type="text" class="regular-text" name="theme[name]" id="name" value="<?php esc_attr_e(get_current_modal_theme('name'))?>" required/>
|
31 |
</td>
|
32 |
</tr><?php
|
33 |
+
if(!class_exists('EMUnlimitedThemes')){?>
|
34 |
<tr>
|
35 |
<th colspan="2" class="pro-upgrade-tip">
|
36 |
<hr/>
|
37 |
+
<img style="" src="<?php echo EMCORE_URL;?>/assets/images/admin/icon-info-21x21.png"/> Free Users can only create one (1) theme. <a href="http://easy-modal.com/addons/unlimited-themes" target="_blank">Check out Unlimited Modals!</a>.
|
38 |
</th>
|
39 |
</tr><?php
|
40 |
}
|
includes/admin/theme-form-overlay-tab.php
CHANGED
@@ -38,10 +38,11 @@ function emodal_admin_theme_form_overlay_tab_settings_background()
|
|
38 |
<p class="description"><?php _e('The opacity value for the overlay.',EMCORE_SLUG)?></p>
|
39 |
</td>
|
40 |
</tr><?php
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
|
38 |
<p class="description"><?php _e('The opacity value for the overlay.',EMCORE_SLUG)?></p>
|
39 |
</td>
|
40 |
</tr><?php
|
41 |
+
if(!class_exists('EMAdvancedThemeEditor')){?>
|
42 |
+
<tr>
|
43 |
+
<th colspan="2" class="pro-upgrade-tip">
|
44 |
+
<img style="" src="<?php echo EMCORE_URL;?>/assets/images/admin/icon-info-21x21.png"/> Wanna use background images? <a href="http://easy-modal.com/addons/unlimited-themes" target="_blank">Check out Advanced Theme Editor!</a>.
|
45 |
+
</th>
|
46 |
+
</tr><?php
|
47 |
+
}
|
48 |
+
}
|
includes/functions.php
CHANGED
@@ -85,7 +85,49 @@ function emresolve(array $a, $path, $default = null){
|
|
85 |
return $current;
|
86 |
}}
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
if(!function_exists("emodal_debug")){
|
91 |
function emodal_debug($var){
|
85 |
return $current;
|
86 |
}}
|
87 |
|
88 |
+
if (!function_exists('array_replace_recursive'))
|
89 |
+
{
|
90 |
+
function array_replace_recursive($array, $array1)
|
91 |
+
{
|
92 |
+
// handle the arguments, merge one by one
|
93 |
+
$args = func_get_args();
|
94 |
+
$array = $args[0];
|
95 |
+
if (!is_array($array))
|
96 |
+
{
|
97 |
+
return $array;
|
98 |
+
}
|
99 |
+
for ($i = 1; $i < count($args); $i++)
|
100 |
+
{
|
101 |
+
if (is_array($args[$i]))
|
102 |
+
{
|
103 |
+
$array = recurse($array, $args[$i]);
|
104 |
+
}
|
105 |
+
}
|
106 |
+
return $array;
|
107 |
+
}
|
108 |
+
}
|
109 |
+
if (!function_exists('recurse'))
|
110 |
+
{
|
111 |
+
function recurse($array, $array1)
|
112 |
+
{
|
113 |
+
foreach ($array1 as $key => $value)
|
114 |
+
{
|
115 |
+
// create new key in $array, if it is empty or not an array
|
116 |
+
if (!isset($array[$key]) || (isset($array[$key]) && !is_array($array[$key])))
|
117 |
+
{
|
118 |
+
$array[$key] = array();
|
119 |
+
}
|
120 |
|
121 |
+
// overwrite the value in the base array
|
122 |
+
if (is_array($value))
|
123 |
+
{
|
124 |
+
$value = recurse($array[$key], $value);
|
125 |
+
}
|
126 |
+
$array[$key] = $value;
|
127 |
+
}
|
128 |
+
return $array;
|
129 |
+
}
|
130 |
+
}
|
131 |
|
132 |
if(!function_exists("emodal_debug")){
|
133 |
function emodal_debug($var){
|
includes/plugin-updater.php
ADDED
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Allows plugins to use their own update API.
|
4 |
+
*
|
5 |
+
* @author Pippin Williamson
|
6 |
+
* @version 1.2
|
7 |
+
*/
|
8 |
+
|
9 |
+
/*
|
10 |
+
Note for wp.org admins. This is not called in the free hosted version and is simply used for hooking in addons to one update system rather than including it in each plugin.
|
11 |
+
*/
|
12 |
+
|
13 |
+
class EMCORE_Plugin_Updater {
|
14 |
+
private $api_url = '';
|
15 |
+
private $api_data = array();
|
16 |
+
private $name = '';
|
17 |
+
private $slug = '';
|
18 |
+
private $do_check = false;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Class constructor.
|
22 |
+
*
|
23 |
+
* @uses plugin_basename()
|
24 |
+
* @uses hook()
|
25 |
+
*
|
26 |
+
* @param string $_api_url The URL pointing to the custom API endpoint.
|
27 |
+
* @param string $_plugin_file Path to the plugin file.
|
28 |
+
* @param array $_api_data Optional data to send with API calls.
|
29 |
+
* @return void
|
30 |
+
*/
|
31 |
+
function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
|
32 |
+
$this->api_url = trailingslashit( $_api_url );
|
33 |
+
$this->api_data = urlencode_deep( $_api_data );
|
34 |
+
$this->name = plugin_basename( $_plugin_file );
|
35 |
+
$this->slug = basename( $_plugin_file, '.php');
|
36 |
+
$this->version = $_api_data['version'];
|
37 |
+
|
38 |
+
// Set up hooks.
|
39 |
+
$this->hook();
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Set up WordPress filters to hook into WP's update process.
|
44 |
+
*
|
45 |
+
* @uses add_filter()
|
46 |
+
*
|
47 |
+
* @return void
|
48 |
+
*/
|
49 |
+
private function hook() {
|
50 |
+
add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'pre_set_site_transient_update_plugins_filter' ) );
|
51 |
+
add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
|
52 |
+
add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 );
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Check for Updates at the defined API endpoint and modify the update array.
|
57 |
+
*
|
58 |
+
* This function dives into the update API just when WordPress creates its update array,
|
59 |
+
* then adds a custom API call and injects the custom plugin data retrieved from the API.
|
60 |
+
* It is reassembled from parts of the native WordPress plugin update code.
|
61 |
+
* See wp-includes/update.php line 121 for the original wp_update_plugins() function.
|
62 |
+
*
|
63 |
+
* @uses api_request()
|
64 |
+
*
|
65 |
+
* @param array $_transient_data Update array build by WordPress.
|
66 |
+
* @return array Modified update array with custom plugin data.
|
67 |
+
*/
|
68 |
+
function pre_set_site_transient_update_plugins_filter( $_transient_data ) {
|
69 |
+
|
70 |
+
if( empty( $_transient_data ) || ! $this->do_check ) {
|
71 |
+
|
72 |
+
// This ensures that the custom API request only runs on the second time that WP fires the update check
|
73 |
+
$this->do_check = true;
|
74 |
+
|
75 |
+
return $_transient_data;
|
76 |
+
}
|
77 |
+
|
78 |
+
$to_send = array( 'slug' => $this->slug );
|
79 |
+
|
80 |
+
$api_response = $this->api_request( 'plugin_latest_version', $to_send );
|
81 |
+
|
82 |
+
if( false !== $api_response && is_object( $api_response ) && isset( $api_response->new_version ) ) {
|
83 |
+
|
84 |
+
if( version_compare( $this->version, $api_response->new_version, '<' ) ) {
|
85 |
+
$_transient_data->response[$this->name] = $api_response;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
return $_transient_data;
|
89 |
+
}
|
90 |
+
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Updates information on the "View version x.x details" page with custom data.
|
94 |
+
*
|
95 |
+
* @uses api_request()
|
96 |
+
*
|
97 |
+
* @param mixed $_data
|
98 |
+
* @param string $_action
|
99 |
+
* @param object $_args
|
100 |
+
* @return object $_data
|
101 |
+
*/
|
102 |
+
function plugins_api_filter( $_data, $_action = '', $_args = null ) {
|
103 |
+
if ( ( $_action != 'plugin_information' ) || !isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) return $_data;
|
104 |
+
|
105 |
+
$to_send = array( 'slug' => $this->slug );
|
106 |
+
|
107 |
+
$api_response = $this->api_request( 'plugin_information', $to_send );
|
108 |
+
if ( false !== $api_response ) $_data = $api_response;
|
109 |
+
|
110 |
+
return $_data;
|
111 |
+
}
|
112 |
+
|
113 |
+
|
114 |
+
/**
|
115 |
+
* Disable SSL verification in order to prevent download update failures
|
116 |
+
*
|
117 |
+
* @param array $args
|
118 |
+
* @param string $url
|
119 |
+
* @return object $array
|
120 |
+
*/
|
121 |
+
function http_request_args( $args, $url ) {
|
122 |
+
// If it is an https request and we are performing a package download, disable ssl verification
|
123 |
+
if( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
|
124 |
+
$args['sslverify'] = false;
|
125 |
+
}
|
126 |
+
return $args;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Calls the API and, if successfull, returns the object delivered by the API.
|
131 |
+
*
|
132 |
+
* @uses get_bloginfo()
|
133 |
+
* @uses wp_remote_post()
|
134 |
+
* @uses is_wp_error()
|
135 |
+
*
|
136 |
+
* @param string $_action The requested action.
|
137 |
+
* @param array $_data Parameters for the API action.
|
138 |
+
* @return false||object
|
139 |
+
*/
|
140 |
+
private function api_request( $_action, $_data ) {
|
141 |
+
|
142 |
+
global $wp_version;
|
143 |
+
|
144 |
+
$data = array_merge( $this->api_data, $_data );
|
145 |
+
|
146 |
+
if( $data['slug'] != $this->slug )
|
147 |
+
return;
|
148 |
+
|
149 |
+
if( empty( $data['license'] ) )
|
150 |
+
return;
|
151 |
+
|
152 |
+
$api_params = array(
|
153 |
+
'edd_action' => 'get_version',
|
154 |
+
'license' => $data['license'],
|
155 |
+
'name' => $data['item_name'],
|
156 |
+
'slug' => $this->slug,
|
157 |
+
'author' => $data['author'],
|
158 |
+
'url' => home_url()
|
159 |
+
);
|
160 |
+
$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
|
161 |
+
if ( ! is_wp_error( $request ) ):
|
162 |
+
$request = json_decode( wp_remote_retrieve_body( $request ) );
|
163 |
+
if( $request && isset( $request->sections ) )
|
164 |
+
$request->sections = maybe_unserialize( $request->sections );
|
165 |
+
return $request;
|
166 |
+
else:
|
167 |
+
return false;
|
168 |
+
endif;
|
169 |
+
}
|
170 |
+
}
|
includes/shortcodes.php
CHANGED
@@ -7,6 +7,7 @@ function emodal_shortcode_modal($atts, $content = NULL)
|
|
7 |
'id' => "",
|
8 |
'theme_id' => 1,
|
9 |
'title' => "",
|
|
|
10 |
'size' => "auto",
|
11 |
'width' => "",
|
12 |
'widthUnit' => "px",
|
@@ -40,6 +41,7 @@ function emodal_shortcode_modal($atts, $content = NULL)
|
|
40 |
'meta' => array(
|
41 |
'display' => array(
|
42 |
'size' => $atts['size'],
|
|
|
43 |
'custom_width' => $atts['width'],
|
44 |
'custom_width_unit' => $atts['widthUnit'],
|
45 |
'custom_height' => $atts['height'],
|
7 |
'id' => "",
|
8 |
'theme_id' => 1,
|
9 |
'title' => "",
|
10 |
+
'overlay_disabled' => 0,
|
11 |
'size' => "auto",
|
12 |
'width' => "",
|
13 |
'widthUnit' => "px",
|
41 |
'meta' => array(
|
42 |
'display' => array(
|
43 |
'size' => $atts['size'],
|
44 |
+
'overlay_disabled' => $atts['overlay_disabled'],
|
45 |
'custom_width' => $atts['width'],
|
46 |
'custom_width_unit' => $atts['widthUnit'],
|
47 |
'custom_height' => $atts['height'],
|
init.php
CHANGED
@@ -32,7 +32,9 @@ if(is_admin())
|
|
32 |
|
33 |
// API
|
34 |
require EMCORE_DIR.'/classes/license.php';
|
35 |
-
require EMCORE_DIR.'/includes/updates/plugin-update-checker.php';
|
|
|
|
|
36 |
|
37 |
// Selectbox and Other Default Options
|
38 |
require EMCORE_DIR.'/includes/admin/options.php';
|
@@ -53,6 +55,7 @@ if(is_admin())
|
|
53 |
|
54 |
// Settings Tabs
|
55 |
require EMCORE_DIR.'/includes/admin/settings-form-general-tab.php';
|
|
|
56 |
|
57 |
// Help Tabs
|
58 |
require EMCORE_DIR.'/includes/admin/help-general-tab.php';
|
32 |
|
33 |
// API
|
34 |
require EMCORE_DIR.'/classes/license.php';
|
35 |
+
//require EMCORE_DIR.'/includes/updates/plugin-update-checker.php';
|
36 |
+
require EMCORE_DIR.'/includes/plugin-updater.php';
|
37 |
+
|
38 |
|
39 |
// Selectbox and Other Default Options
|
40 |
require EMCORE_DIR.'/includes/admin/options.php';
|
55 |
|
56 |
// Settings Tabs
|
57 |
require EMCORE_DIR.'/includes/admin/settings-form-general-tab.php';
|
58 |
+
require EMCORE_DIR.'/includes/admin/settings-form-licenses-tab.php';
|
59 |
|
60 |
// Help Tabs
|
61 |
require EMCORE_DIR.'/includes/admin/help-general-tab.php';
|
readme.txt
CHANGED
@@ -6,15 +6,14 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
6 |
Tags: modal,modal box,modal form,modal window,popup,popup box,popup form,popup window,ajax forms
|
7 |
Requires at least: 3.4
|
8 |
Tested up to: 3.9.2
|
9 |
-
Stable tag: 2.0.
|
10 |
-
Make a pop up
|
11 |
== Description ==
|
12 |
-
Make a pop up
|
13 |
|
14 |
= Core Features =
|
15 |
* Unlimited Customizable Modals
|
16 |
* One (1) Customizable Modal Theme
|
17 |
-
* Custom Background Image Capabilities
|
18 |
* Disable Background Overlay Option
|
19 |
* Add Modals Anywhere
|
20 |
* Complete Modal Positioning Control
|
@@ -27,48 +26,25 @@ Make a pop up - any pop up - Logins, Auto Exits, Scroll Pops, Age Verification P
|
|
27 |
* Customizable Modal Opening Animations
|
28 |
* Customize close functions, click overlay, press esc key.
|
29 |
* Hooks & Filters for Ultimate Customization
|
30 |
-
* Support Forum Access
|
31 |
-
|
32 |
-
= Pro Features =
|
33 |
-
* Unlimited Customizable Modals Themes
|
34 |
-
* Enhanced Visual Theme Editor:
|
35 |
-
* Force User Action Modals (Disable Close)
|
36 |
-
* Auto Open Modals (Per Page/Post or Site Wide)
|
37 |
-
* Access to Pro & Core Add Ons
|
38 |
-
* 1 Domain Only
|
39 |
-
* Pro Support Features:
|
40 |
-
* Page/Post Specific Modals
|
41 |
-
* Support Forum Access
|
42 |
-
* Pro User Support Requests
|
43 |
-
* Expedited Feature Requests
|
44 |
-
* Support Assistance
|
45 |
-
* Personal Customized Setup Assistance
|
46 |
-
|
47 |
-
= Pro Developer Features =
|
48 |
-
* EasyModal Core
|
49 |
-
* EasyModal Pro
|
50 |
-
* Access to Developer, Pro & Core Add Ons
|
51 |
-
* Unlimited Domains
|
52 |
-
* Pro Developer Support Features:
|
53 |
-
* Priority Developer Support
|
54 |
-
* Support Forum Access
|
55 |
-
* Pro User Support Requests
|
56 |
-
* Expedited Feature Requests
|
57 |
-
* Support Assistance
|
58 |
-
* Personal Customized Setup Assistance
|
59 |
-
|
60 |
|
61 |
= Add Ons =
|
62 |
-
*
|
63 |
-
*
|
64 |
-
* Exit Modals
|
65 |
* This add on allows you to create modals and pop-ups that appear when a user attempts to leave or exit your site
|
66 |
-
* Login Modals
|
67 |
* This add on gives you the ability to have ajax login forms appear in a pop-up. Also includes registration and forgot your password modals.
|
68 |
-
*
|
69 |
-
* This add on imports and exports settings from the EasyModal Plug-In
|
70 |
-
* Age Verification Add On (Pro & Pro Developer Only)
|
71 |
* This add on will pop-up and prompt users to verify their age by inputting the information in a form (or drop down), or use a simple button (click to proceed) format
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
|
74 |
|
@@ -88,6 +64,19 @@ To be notified of plugin updates, [follow us on Twitter](https://twitter.com/Eas
|
|
88 |
|
89 |
== Changelog ==
|
90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
= v2.0.10 =
|
92 |
* Bug
|
93 |
* Removed unused files.
|
6 |
Tags: modal,modal box,modal form,modal window,popup,popup box,popup form,popup window,ajax forms
|
7 |
Requires at least: 3.4
|
8 |
Tested up to: 3.9.2
|
9 |
+
Stable tag: 2.0.11
|
10 |
+
Make a pop up in minutes. Logins, Auto Exits, Scroll Pops, Age Verification Pops. Theme, customize, stream line your GUI & market your content!
|
11 |
== Description ==
|
12 |
+
Make a pop up in minutes - Logins, Auto Exits, Scroll Pops, Age Verification Pops - use EasyModal's ultimate theme capabilities and customization options to make glorious pop ups that increase your site's usability, conversion rates and market your most precious content.
|
13 |
|
14 |
= Core Features =
|
15 |
* Unlimited Customizable Modals
|
16 |
* One (1) Customizable Modal Theme
|
|
|
17 |
* Disable Background Overlay Option
|
18 |
* Add Modals Anywhere
|
19 |
* Complete Modal Positioning Control
|
26 |
* Customizable Modal Opening Animations
|
27 |
* Customize close functions, click overlay, press esc key.
|
28 |
* Hooks & Filters for Ultimate Customization
|
29 |
+
* WordPress Support Forum Access
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
= Add Ons =
|
32 |
+
* Auto Open Modals
|
33 |
+
* Open modals automatically when users visit your site or a specific page.
|
34 |
+
* Exit Modals
|
35 |
* This add on allows you to create modals and pop-ups that appear when a user attempts to leave or exit your site
|
36 |
+
* Login Modals
|
37 |
* This add on gives you the ability to have ajax login forms appear in a pop-up. Also includes registration and forgot your password modals.
|
38 |
+
* Age Verification
|
|
|
|
|
39 |
* This add on will pop-up and prompt users to verify their age by inputting the information in a form (or drop down), or use a simple button (click to proceed) format
|
40 |
+
* Unlimited Themes
|
41 |
+
* Create as many themes as you need. Choose which theme each modal uses.
|
42 |
+
* Scroll Pops
|
43 |
+
* Pop up modals when the user scrolls down the page.
|
44 |
+
* Force User Action
|
45 |
+
* Disable the close button, forcing the user to fill out your form or do another action.
|
46 |
+
* Advanced Theme Editor
|
47 |
+
* Add background images to the overlay, container and close button.
|
48 |
|
49 |
|
50 |
|
64 |
|
65 |
== Changelog ==
|
66 |
|
67 |
+
= v2.0.11 =
|
68 |
+
* Bug
|
69 |
+
* Fixed a bug in the default theme causing it to appear broken.
|
70 |
+
* Fixed bugs in missing options and defaults being applied.
|
71 |
+
* Fixed issues with modals closing.
|
72 |
+
* Fixed PHP backward compatability issues.
|
73 |
+
* Table relationship fixes and API change.
|
74 |
+
* Improvement
|
75 |
+
* Updates for new licensing system and API.
|
76 |
+
* Added reset options.
|
77 |
+
* Reorganized settings page.
|
78 |
+
* WordPress Admin GUI Improvements.
|
79 |
+
|
80 |
= v2.0.10 =
|
81 |
* Bug
|
82 |
* Removed unused files.
|