| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Admin Custom Login |
| 4 |
* Version: 1.7 |
| 5 |
* Description: Admin Custom Login plugin allows you to change your Login Form. |
| 6 |
* Author: weblizar |
| 7 |
* Author URI: http://www.weblizar.com |
| 8 |
* Plugin URI: http://weblizar.com/plugins/admin-custom-login |
| 9 |
*/ |
| 10 |
|
| 11 |
define("WEBLIZAR_NALF_PLUGIN_URL", plugin_dir_url(__FILE__)); |
| 12 |
define("WEBLIZAR_ACL", "WEBLIZAR_ACL" ); |
| 13 |
|
| 14 |
add_action('plugins_loaded', 'ACL_GetReadyTranslation'); |
| 15 |
function ACL_GetReadyTranslation() { |
| 16 |
load_plugin_textdomain(WEBLIZAR_ACL, FALSE, dirname( plugin_basename(__FILE__)).'/languages/' ); |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Admin Custom Login installation script |
| 21 |
*/ |
| 22 |
register_activation_hook( __FILE__, 'ACL_WeblizarDoInstallation' ); |
| 23 |
function ACL_WeblizarDoInstallation() { |
| 24 |
require_once('installation.php'); |
| 25 |
} |
| 26 |
|
| 27 |
/** |
| 28 |
* Admin Custom Login menu |
| 29 |
*/ |
| 30 |
require_once("login-form-screen.php"); |
| 31 |
add_action('admin_menu','acl_weblizar_admin_custom_login_menu'); |
| 32 |
function acl_weblizar_admin_custom_login_menu() { |
| 33 |
//plugin menu name for Admin Custom Login |
| 34 |
// $acl_menu = add_menu_page('Admin custom Login', 'Admin custom Login','administrator', 'admin_custom_login','acl_admin_custom_login_content'); |
| 35 |
$acl_menu = add_submenu_page( 'options-general.php','Admin custom Login', 'Admin custom Login','administrator', 'admin_custom_login','acl_admin_custom_login_content' ); |
| 36 |
//add hook to add styles and scripts for Admin Custom Login admin page |
| 37 |
add_action( 'admin_print_styles-' . $acl_menu, 'acl_admin_custom_login_js_css' ); |
| 38 |
} |
| 39 |
|
| 40 |
function acl_admin_custom_login_js_css() { |
| 41 |
//enqueue scripts page for Admin Custom Login plugin admin panel |
| 42 |
wp_enqueue_script('theme-preview'); |
| 43 |
wp_enqueue_style('dashboard'); |
| 44 |
wp_enqueue_style('wp-color-picker'); |
| 45 |
wp_enqueue_style('thickbox'); |
| 46 |
wp_enqueue_style('acl-bootstrap-css', WEBLIZAR_NALF_PLUGIN_URL.'css/bootstrap.css'); |
| 47 |
wp_enqueue_style('acl-smartech-css', WEBLIZAR_NALF_PLUGIN_URL.'css/smartech.css'); |
| 48 |
wp_enqueue_style('acl-jquery-ui-css', WEBLIZAR_NALF_PLUGIN_URL.'css/jquery-ui.css'); |
| 49 |
wp_enqueue_style('acl-font-awesome_min', WEBLIZAR_NALF_PLUGIN_URL.'font-awesome/css/font-awesome.min.css'); |
| 50 |
wp_enqueue_style('acl-font-animate', WEBLIZAR_NALF_PLUGIN_URL.'css/animate.css'); |
| 51 |
wp_enqueue_style('acl-fontawesome-iconpicker', WEBLIZAR_NALF_PLUGIN_URL.'css/fontawesome-iconpicker.css'); |
| 52 |
|
| 53 |
wp_enqueue_style('acl-dialog', WEBLIZAR_NALF_PLUGIN_URL.'css/dialog/dialog.css'); |
| 54 |
wp_enqueue_style('acl-dialog-box-style', WEBLIZAR_NALF_PLUGIN_URL.'css/dialog/dialog-box-style.css'); |
| 55 |
wp_enqueue_style('acl-dialog-jamie', WEBLIZAR_NALF_PLUGIN_URL.'css/dialog/dialog-jamie.css'); |
| 56 |
|
| 57 |
wp_enqueue_script('jquery'); |
| 58 |
|
| 59 |
wp_enqueue_script('acl-media-uploads',WEBLIZAR_NALF_PLUGIN_URL.'js/acl-media-upload-script.js',array('media-upload','thickbox','jquery')); |
| 60 |
wp_enqueue_script('acl-color-picker-script', WEBLIZAR_NALF_PLUGIN_URL.'js/acl-color-picker-script.js', array( 'wp-color-picker' ), false, true ); |
| 61 |
|
| 62 |
wp_enqueue_script('acl-bootstrap-min-js',WEBLIZAR_NALF_PLUGIN_URL.'js/bootstrap.min.js'); |
| 63 |
wp_enqueue_script('acl-metisMenu',WEBLIZAR_NALF_PLUGIN_URL.'js/plugins/metisMenu/metisMenu.min.js'); |
| 64 |
wp_enqueue_script('aclsmartech',WEBLIZAR_NALF_PLUGIN_URL.'js/smartech.js',array('jquery')); |
| 65 |
wp_enqueue_script('acl-nalf-sidebar-nav',WEBLIZAR_NALF_PLUGIN_URL.'js/nalf_sidebar_nav.js'); |
| 66 |
wp_enqueue_script('acl-media-upload-script-2-js',WEBLIZAR_NALF_PLUGIN_URL.'js/acl-media-upload-script-2.js'); |
| 67 |
wp_enqueue_script('acl-font-icon-picker-js',WEBLIZAR_NALF_PLUGIN_URL.'js/fontawesome-iconpicker.js'); |
| 68 |
|
| 69 |
wp_enqueue_script('acl-snap-svg-min',WEBLIZAR_NALF_PLUGIN_URL.'js/dialog/snap.svg-min.js'); |
| 70 |
wp_enqueue_script('acl-modernizr-custom',WEBLIZAR_NALF_PLUGIN_URL.'js/dialog/modernizr.custom.js'); |
| 71 |
wp_enqueue_script('acl-classie',WEBLIZAR_NALF_PLUGIN_URL.'js/dialog/classie.js'); |
| 72 |
wp_enqueue_script('acl-dialogFx',WEBLIZAR_NALF_PLUGIN_URL.'js/dialog/dialogFx.js'); |
| 73 |
} |
| 74 |
|
| 75 |
function acl_advanced_login_form_plugin() { |
| 76 |
wp_enqueue_script('jquery'); |
| 77 |
$dashboard_page = unserialize(get_option('Admin_custome_login_dashboard')); |
| 78 |
$top_page = unserialize(get_option('Admin_custome_login_top')); |
| 79 |
if ($top_page['top_bg_type'] == "slider-background" && $dashboard_page['dashboard_status'] == "enable"){ |
| 80 |
wp_enqueue_script('modernizr',WEBLIZAR_NALF_PLUGIN_URL.'js/modernizr.custom.86080.js'); |
| 81 |
wp_enqueue_style('demo', WEBLIZAR_NALF_PLUGIN_URL.'css/demo.css'); |
| 82 |
} |
| 83 |
wp_enqueue_style('font-awesome_min', WEBLIZAR_NALF_PLUGIN_URL.'font-awesome/css/font-awesome.min.css'); |
| 84 |
} |
| 85 |
add_action('login_enqueue_scripts', 'acl_advanced_login_form_plugin'); |
| 86 |
|
| 87 |
function acl_footer_func() { |
| 88 |
$text_and_color_page = unserialize(get_option('Admin_custome_login_text')); |
| 89 |
$user_input_icon = $text_and_color_page['user_input_icon']; |
| 90 |
$password_input_icon = $text_and_color_page['password_input_icon']; |
| 91 |
$enable_inputbox_icon = $text_and_color_page['enable_inputbox_icon']; |
| 92 |
$heading_font_color = $text_and_color_page['heading_font_color']; |
| 93 |
$heading_font_size = $text_and_color_page['heading_font_size']; |
| 94 |
$input_font_size = $text_and_color_page['input_font_size']; |
| 95 |
$top_page = unserialize(get_option('Admin_custome_login_top')); |
| 96 |
$Social_page = unserialize(get_option('Admin_custome_login_Social')); |
| 97 |
?> |
| 98 |
<script> |
| 99 |
jQuery(document).ready(function(){ |
| 100 |
|
| 101 |
jQuery('html body').attr('id', 'screen'); |
| 102 |
jQuery('#loginform label[for="user_login"]').attr('id', 'log_input_lable'); |
| 103 |
jQuery('#loginform label[for="user_pass"]').attr('id', 'pwd_input_lable'); |
| 104 |
|
| 105 |
<?php if($enable_inputbox_icon=='yes'){?> |
| 106 |
if (jQuery('#log_input_lable').length) |
| 107 |
{ |
| 108 |
document.getElementById("log_input_lable").innerHTML="<?php _e('User Name','WEBLIZAR_ACL');?><div class='input-container'> <div class='icon-ph'><i class='fa <?php echo $user_input_icon; ?>'></i></div> <input id='user_login' name='log' class='input' type='text' placeholder='<?php _e('User Name','WEBLIZAR_ACL');?>'></div>"; |
| 109 |
document.getElementById("pwd_input_lable").innerHTML="<?php _e('Password','WEBLIZAR_ACL');?><div class='input-container'> <div class='icon-ph'><i class='fa <?php echo $password_input_icon; ?>'></i></div> <input id='user_pass' name='pwd' class='input' type='password' placeholder='<?php _e('Password','WEBLIZAR_ACL');?>'></div>"; |
| 110 |
jQuery('body.login div#login form .input, .login input[type="text"]').css('padding','5px 5px 5px 45px'); |
| 111 |
} |
| 112 |
<?php } else { ?> |
| 113 |
if (jQuery('#log_input_lable').length) |
| 114 |
{ |
| 115 |
jQuery('#loginform #user_login').attr('placeholder', '<?php _e('User Name','WEBLIZAR_ACL');?>'); |
| 116 |
jQuery('#loginform #user_pass').attr('placeholder', '<?php _e('Password','WEBLIZAR_ACL');?>'); |
| 117 |
jQuery('body.login div#login form .input, .login input[type="text"]').css('padding','5px 5px 5px 5px'); |
| 118 |
} |
| 119 |
<?php }?> |
| 120 |
<?php if ($top_page['top_bg_type'] == "slider-background"){ ?> |
| 121 |
jQuery('#screen').prepend('<ul class="cb-slideshow"> <li><span>Image 01</span></li> <li><span>Image 02</span></li> <li><span>Image 03</span></li> <li><span>Image 04</span></li> <li><span>Image 05</span></li> <li><span>Image 06</span></li> </ul>') |
| 122 |
<?php } ?> |
| 123 |
|
| 124 |
//enable Social Icon In inner login form |
| 125 |
<?php if($Social_page['enable_social_icon'] == "inner" || $Social_page['enable_social_icon'] == "both") {?> |
| 126 |
jQuery( ".forgetmenot, #lostpasswordform" ).append('<div style="padding-top:16px"><div style="color:<?php echo $heading_font_color; ?>; font-size:<?php echo $heading_font_size;?>px; "><?php _e('Contact Us:','WEBLIZAR_ACL'); ?> :</div><div style="padding-top:5px"><?php if($Social_page['social_twitter_link']!=''){ ?><a href="<?php echo $Social_page['social_twitter_link'];?>" class="icon-button twitter"><i class="fa fa-twitter"></i><span></span></a><?php } if($Social_page['social_facebook_link']!=''){ ?> <a href="<?php echo $Social_page['social_facebook_link'];?>" class="icon-button facebook"><i class="fa fa-facebook"></i><span></span></a> <?php } if($Social_page['social_google_plus_link']!=''){ ?> <a href="<?php echo $Social_page['social_google_plus_link'];?>" class="icon-button google-plus"><i class="fa fa-google-plus"></i><span></span></a><?php } if($Social_page['social_linkedin_link']!=''){ ?> <a href="<?php echo $Social_page['social_linkedin_link'];?>" class="icon-button linkedin"> <i class="fa fa-linkedin"> </i> <span></span> </a> <?php } if($Social_page['social_pinterest_link']!=''){ ?><a href="<?php echo $Social_page['social_pinterest_link'];?>" class="icon-button pinterest"><i class="fa fa-pinterest"></i><span></span></a><?php } ?><div></div>' ); |
| 127 |
<?php } ?> |
| 128 |
//enable Social Icon In outer login form |
| 129 |
<?php if($Social_page['enable_social_icon'] == "outer" || $Social_page['enable_social_icon'] == "both") {?> |
| 130 |
jQuery( "#backtoblog" ).append('<div class="divsocial"><?php if($Social_page['social_twitter_link']!=''){?> <a href="<?php echo $Social_page['social_twitter_link']; ?>" class="icon-button twitter"><i class="fa fa-twitter"></i><span></span></a><?php } if($Social_page['social_facebook_link']!=''){?><a href="<?php echo $Social_page['social_facebook_link']; ?>" class="icon-button facebook"><i class="fa fa-facebook"></i><span></span></a> <?php } if($Social_page['social_google_plus_link']!=''){?><a href="<?php echo $Social_page['social_google_plus_link']; ?>" class="icon-button google-plus"><i class="fa fa-google-plus"></i><span></span></a><?php } if($Social_page['social_linkedin_link']!=''){?><a href="<?php echo $Social_page['social_linkedin_link']; ?>" class="icon-button linkedin"><i class="fa fa-linkedin"></i><span></span></a><?php } if($Social_page['social_pinterest_link']!=''){?><a href="<?php echo $Social_page['social_pinterest_link']; ?>" class="icon-button pinterest"><i class="fa fa-pinterest"></i><span></span></a><?php } ?></div>'); |
| 131 |
<?php } ?> |
| 132 |
}) |
| 133 |
</script> |
| 134 |
<?php |
| 135 |
} |
| 136 |
$dashboard_page = unserialize(get_option('Admin_custome_login_dashboard')); |
| 137 |
if($dashboard_page['dashboard_status'] == "enable") { |
| 138 |
add_action('login_head', 'acl_footer_func'); |
| 139 |
} |
| 140 |
|
| 141 |
function acl_admin_custom_login_content() { |
| 142 |
require_once('includes/content.php'); |
| 143 |
} |
| 144 |
|
| 145 |
/** |
| 146 |
* Process a settings export that generates a .json file of the shop settings |
| 147 |
*/ |
| 148 |
|
| 149 |
function acl_export_settings() { |
| 150 |
|
| 151 |
if( empty( $_POST['acl_action'] ) || 'export_settings' != $_POST['acl_action'] ) |
| 152 |
return; |
| 153 |
|
| 154 |
if( ! wp_verify_nonce( $_POST['acl_export_nonce'], 'acl_export_nonce' ) ) |
| 155 |
return; |
| 156 |
|
| 157 |
if( ! current_user_can( 'manage_options' ) ) |
| 158 |
return; |
| 159 |
|
| 160 |
|
| 161 |
// Get value of Dashboard page |
| 162 |
$dashboard_page = unserialize(get_option('Admin_custome_login_dashboard')); |
| 163 |
$dashboard_status = $dashboard_page['dashboard_status']; |
| 164 |
|
| 165 |
// Get value of Top page |
| 166 |
$top_page = unserialize(get_option('Admin_custome_login_top')); |
| 167 |
$top_bg_type = $top_page['top_bg_type']; |
| 168 |
$top_color = $top_page['top_color']; |
| 169 |
$top_image = $top_page['top_image']; |
| 170 |
$top_cover = $top_page['top_cover']; |
| 171 |
$top_repeat = $top_page['top_repeat']; |
| 172 |
$top_position = $top_page['top_position']; |
| 173 |
$top_attachment = $top_page['top_attachment']; |
| 174 |
global $top_slideshow_no ; |
| 175 |
$top_slideshow_no = $top_page['top_slideshow_no']; |
| 176 |
$top_bg_slider_animation = $top_page['top_bg_slider_animation']; |
| 177 |
|
| 178 |
// Get value of Login page |
| 179 |
$login_page = unserialize(get_option('Admin_custome_login_login')); |
| 180 |
$login_bg_type = $login_page['login_bg_type']; |
| 181 |
$login_form_float = $login_page['login_form_float']; |
| 182 |
$login_bg_color = $login_page['login_bg_color']; |
| 183 |
$login_bg_effect = $login_page['login_bg_effect']; |
| 184 |
$login_bg_image = $login_page['login_bg_image']; |
| 185 |
$login_form_opacity = $login_page['login_form_opacity']; |
| 186 |
$login_form_width = $login_page['login_form_width']; |
| 187 |
$login_form_radius = $login_page['login_form_radius']; |
| 188 |
$login_border_style = $login_page['login_border_style']; |
| 189 |
$login_border_thikness = $login_page['login_border_thikness']; |
| 190 |
$login_border_color = $login_page['login_border_color']; |
| 191 |
$login_bg_repeat = $login_page['login_bg_repeat']; |
| 192 |
$login_bg_position = $login_page['login_bg_position']; |
| 193 |
$login_enable_shadow = $login_page['login_enable_shadow']; |
| 194 |
$login_shadow_color = $login_page['login_shadow_color']; |
| 195 |
|
| 196 |
// Get value of Text and Color page |
| 197 |
$text_and_color_page = unserialize(get_option('Admin_custome_login_text')); |
| 198 |
$heading_font_color = $text_and_color_page['heading_font_color']; |
| 199 |
$input_font_color = $text_and_color_page['input_font_color']; |
| 200 |
$link_color = $text_and_color_page['link_color']; |
| 201 |
$button_color = $text_and_color_page['button_color']; |
| 202 |
$heading_font_size = $text_and_color_page['heading_font_size']; |
| 203 |
$input_font_size = $text_and_color_page['input_font_size']; |
| 204 |
$link_size = $text_and_color_page['link_size']; |
| 205 |
$button_font_size = $text_and_color_page['button_font_size']; |
| 206 |
$enable_link_shadow = $text_and_color_page['enable_link_shadow']; |
| 207 |
$link_shadow_color = $text_and_color_page['link_shadow_color']; |
| 208 |
$heading_font_style = $text_and_color_page['heading_font_style']; |
| 209 |
$input_font_style = $text_and_color_page['input_font_style']; |
| 210 |
$link_font_style = $text_and_color_page['link_font_style']; |
| 211 |
$button_font_style = $text_and_color_page['button_font_style']; |
| 212 |
$enable_inputbox_icon = $text_and_color_page['enable_inputbox_icon']; |
| 213 |
$user_input_icon = $text_and_color_page['user_input_icon']; |
| 214 |
$password_input_icon = $text_and_color_page['password_input_icon']; |
| 215 |
|
| 216 |
// Get value of Logo page |
| 217 |
$logo_page = unserialize(get_option('Admin_custome_login_logo')); |
| 218 |
$logo_image = $logo_page['logo_image']; |
| 219 |
$logo_width = $logo_page['logo_width']; |
| 220 |
$logo_height = $logo_page['logo_height']; |
| 221 |
$logo_url = $logo_page['logo_url']; |
| 222 |
$logo_url_title = $logo_page['logo_url_title']; |
| 223 |
|
| 224 |
// Get value of Slidshow image |
| 225 |
$Slidshow_image = unserialize(get_option('Admin_custome_login_Slidshow')); |
| 226 |
$Slidshow_image_1=$Slidshow_image['Slidshow_image_1']; |
| 227 |
$Slidshow_image_2=$Slidshow_image['Slidshow_image_2']; |
| 228 |
$Slidshow_image_3=$Slidshow_image['Slidshow_image_3']; |
| 229 |
$Slidshow_image_4=$Slidshow_image['Slidshow_image_4']; |
| 230 |
$Slidshow_image_5=$Slidshow_image['Slidshow_image_5']; |
| 231 |
$Slidshow_image_6=$Slidshow_image['Slidshow_image_6']; |
| 232 |
|
| 233 |
$Slidshow_image_label_1=$Slidshow_image['Slidshow_image_label_1']; |
| 234 |
$Slidshow_image_label_2=$Slidshow_image['Slidshow_image_label_2']; |
| 235 |
$Slidshow_image_label_3=$Slidshow_image['Slidshow_image_label_3']; |
| 236 |
$Slidshow_image_label_4=$Slidshow_image['Slidshow_image_label_4']; |
| 237 |
$Slidshow_image_label_5=$Slidshow_image['Slidshow_image_label_5']; |
| 238 |
$Slidshow_image_label_6=$Slidshow_image['Slidshow_image_label_6']; |
| 239 |
|
| 240 |
$Social_page = unserialize(get_option('Admin_custome_login_Social')); |
| 241 |
$enable_social_icon=$Social_page['enable_social_icon']; |
| 242 |
$social_icon_size=$Social_page['social_icon_size']; |
| 243 |
$social_icon_layout=$Social_page['social_icon_layout']; |
| 244 |
$social_icon_color=$Social_page['social_icon_color']; |
| 245 |
$social_icon_color_onhover=$Social_page['social_icon_color_onhover']; |
| 246 |
$social_icon_bg=$Social_page['social_icon_bg']; |
| 247 |
$social_icon_bg_onhover=$Social_page['social_icon_bg_onhover']; |
| 248 |
$social_facebook_link=$Social_page['social_facebook_link']; |
| 249 |
$social_twitter_link=$Social_page['social_twitter_link']; |
| 250 |
$social_linkedin_link=$Social_page['social_linkedin_link']; |
| 251 |
$social_google_plus_link=$Social_page['social_google_plus_link']; |
| 252 |
$social_pinterest_link=$Social_page['social_pinterest_link']; |
| 253 |
|
| 254 |
$ACL_ALL_Settings= serialize(array( |
| 255 |
'dashboard_status' => $dashboard_status, |
| 256 |
'top_bg_type' => $top_bg_type, |
| 257 |
'top_color' => $top_color, |
| 258 |
'top_image' => $top_image, |
| 259 |
'top_cover' => $top_cover, |
| 260 |
'top_repeat' => $top_repeat, |
| 261 |
'top_position' => $top_position, |
| 262 |
'top_attachment' => $top_attachment, |
| 263 |
'top_slideshow_no' => $top_slideshow_no, |
| 264 |
'top_bg_slider_animation' => $top_bg_slider_animation, |
| 265 |
|
| 266 |
'login_bg_type' => $login_bg_type, |
| 267 |
'login_form_float' => $login_form_float, |
| 268 |
'login_bg_color' => $login_bg_color, |
| 269 |
'login_bg_effect' => $login_bg_effect, |
| 270 |
'login_bg_image' => $login_bg_image, |
| 271 |
'login_form_opacity' => $login_form_opacity, |
| 272 |
'login_form_width' => $login_form_width, |
| 273 |
'login_form_radius' => $login_form_radius, |
| 274 |
'login_border_style' => $login_border_style, |
| 275 |
'login_border_thikness' => $login_border_thikness, |
| 276 |
'login_border_color' => $login_border_color, |
| 277 |
'login_bg_repeat' => $login_bg_repeat, |
| 278 |
'login_bg_position' => $login_bg_position, |
| 279 |
'login_enable_shadow' => $login_enable_shadow, |
| 280 |
'login_shadow_color' => $login_shadow_color, |
| 281 |
|
| 282 |
'heading_font_color' => $heading_font_color, |
| 283 |
'input_font_color' => $input_font_color, |
| 284 |
'link_color' => $link_color, |
| 285 |
'button_color' => $button_color, |
| 286 |
'heading_font_size' => $heading_font_size, |
| 287 |
'input_font_size' => $input_font_size, |
| 288 |
'link_size' => $link_size, |
| 289 |
'button_font_size' => $button_font_size, |
| 290 |
'enable_link_shadow' => $enable_link_shadow, |
| 291 |
'link_shadow_color' => $link_shadow_colo, |
| 292 |
'heading_font_style' => $heading_font_style, |
| 293 |
'input_font_style' => $input_font_style, |
| 294 |
'link_font_style' => $link_font_style, |
| 295 |
'button_font_style' => $button_font_style, |
| 296 |
'enable_inputbox_icon' => $enable_inputbox_icon, |
| 297 |
'user_input_icon' => $user_input_icon, |
| 298 |
'password_input_icon' => $password_input_icon, |
| 299 |
|
| 300 |
'logo_image' => $logo_image, |
| 301 |
'logo_width' => $logo_width, |
| 302 |
'logo_height' => $logo_height, |
| 303 |
'logo_url' => $logo_url, |
| 304 |
'logo_url_title' => $logo_url_title, |
| 305 |
|
| 306 |
'enable_social_icon' => $enable_social_icon, |
| 307 |
'social_icon_size' => $social_icon_size , |
| 308 |
'social_icon_layout' => $social_icon_layout , |
| 309 |
'social_icon_color' => $social_icon_color , |
| 310 |
'social_icon_color_onhover' => $social_icon_color_onhover , |
| 311 |
'social_icon_bg' => $social_icon_bg, |
| 312 |
'social_icon_bg_onhover' => $social_icon_bg_onhover , |
| 313 |
'social_facebook_link' => $social_facebook_link , |
| 314 |
'social_twitter_link' => $social_twitter_link, |
| 315 |
'social_linkedin_link' => $social_linkedin_link, |
| 316 |
'social_google_plus_link' => $social_google_plus_link, |
| 317 |
'social_pinterest_link' => $social_pinterest_link, |
| 318 |
|
| 319 |
'Slidshow_image_1' => $Slidshow_image_1, |
| 320 |
'Slidshow_image_2' => $Slidshow_image_2, |
| 321 |
'Slidshow_image_3' => $Slidshow_image_3, |
| 322 |
'Slidshow_image_4' => $Slidshow_image_4, |
| 323 |
'Slidshow_image_5' => $Slidshow_image_5, |
| 324 |
'Slidshow_image_6' => $Slidshow_image_6, |
| 325 |
'Slidshow_image_label_1' => $Slidshow_image_label_1, |
| 326 |
'Slidshow_image_label_2' => $Slidshow_image_label_2, |
| 327 |
'Slidshow_image_label_3' => $Slidshow_image_label_3, |
| 328 |
'Slidshow_image_label_4' => $Slidshow_image_label_4, |
| 329 |
'Slidshow_image_label_5' => $Slidshow_image_label_5, |
| 330 |
'Slidshow_image_label_6' => $Slidshow_image_label_6 |
| 331 |
)); |
| 332 |
|
| 333 |
ignore_user_abort( true ); |
| 334 |
|
| 335 |
nocache_headers(); |
| 336 |
header( 'Content-Type: application/json; charset=utf-8' ); |
| 337 |
header( 'Content-Disposition: attachment; filename=pwsix-settings-export-' . date( 'm-d-Y' ) . '.json' ); |
| 338 |
header( "Expires: 0" ); |
| 339 |
|
| 340 |
echo json_encode( $ACL_ALL_Settings ); |
| 341 |
exit; |
| 342 |
} |
| 343 |
add_action( 'admin_init', 'acl_export_settings' ); |
| 344 |
|
| 345 |
/** |
| 346 |
* Process a settings import from a json file |
| 347 |
*/ |
| 348 |
|
| 349 |
function acl_import_settings() { |
| 350 |
|
| 351 |
if( empty( $_POST['acl_action'] ) || 'import_settings' != $_POST['acl_action'] ) |
| 352 |
return; |
| 353 |
|
| 354 |
if( ! wp_verify_nonce( $_POST['acl_import_nonce'], 'acl_import_nonce' ) ) |
| 355 |
return; |
| 356 |
|
| 357 |
if( ! current_user_can( 'manage_options' ) ) |
| 358 |
return; |
| 359 |
|
| 360 |
list($oteher_extension, $extension) = explode(".", $_FILES['import_file']['name']); |
| 361 |
//$extension = end( explode( '.', $_FILES['import_file']['name'] ) ); |
| 362 |
|
| 363 |
if( $extension != 'json' ) { |
| 364 |
wp_die( __( 'Please upload a valid .json file' ) ); |
| 365 |
} |
| 366 |
|
| 367 |
$import_file = $_FILES['import_file']['tmp_name']; |
| 368 |
|
| 369 |
if( empty( $import_file ) ) { |
| 370 |
wp_die( __( 'Please upload a file to import' ) ); |
| 371 |
} |
| 372 |
|
| 373 |
// Retrieve the settings from the file. |
| 374 |
$settings = json_decode( file_get_contents( $import_file ) ); |
| 375 |
|
| 376 |
$ACL_Settings = unserialize($settings); |
| 377 |
|
| 378 |
$dashboard_status = $ACL_Settings['dashboard_status']; |
| 379 |
|
| 380 |
$top_bg_type = $ACL_Settings['top_bg_type']; |
| 381 |
$top_color = $ACL_Settings['top_color']; |
| 382 |
$top_image = $ACL_Settings['top_image']; |
| 383 |
$top_cover = $ACL_Settings['top_cover']; |
| 384 |
$top_repeat = $ACL_Settings['top_repeat']; |
| 385 |
$top_position = $ACL_Settings['top_position']; |
| 386 |
$top_attachment = $ACL_Settings['top_attachment']; |
| 387 |
$top_slideshow_no = $ACL_Settings['top_slideshow_no']; |
| 388 |
$top_bg_slider_animation = $ACL_Settings['top_bg_slider_animation']; |
| 389 |
|
| 390 |
$login_bg_type = $ACL_Settings['login_bg_type']; |
| 391 |
$login_form_float = $ACL_Settings['login_form_float']; |
| 392 |
$login_bg_color = $ACL_Settings['login_bg_color']; |
| 393 |
$login_bg_effect = $ACL_Settings['login_bg_effect']; |
| 394 |
$login_bg_image = $ACL_Settings['login_bg_image']; |
| 395 |
$login_form_opacity = $ACL_Settings['login_form_opacity']; |
| 396 |
$login_form_width = $ACL_Settings['login_form_width']; |
| 397 |
$login_form_radius = $ACL_Settings['login_form_radius']; |
| 398 |
$login_border_style = $ACL_Settings['login_border_style']; |
| 399 |
$login_border_thikness = $ACL_Settings['login_border_thikness']; |
| 400 |
$login_border_color = $ACL_Settings['login_border_color']; |
| 401 |
$login_bg_repeat = $ACL_Settings['login_bg_repeat']; |
| 402 |
$login_bg_position = $ACL_Settings['login_bg_position']; |
| 403 |
$login_enable_shadow = $ACL_Settings['login_enable_shadow']; |
| 404 |
$login_shadow_color = $ACL_Settings['login_shadow_color']; |
| 405 |
|
| 406 |
$heading_font_color = $ACL_Settings['heading_font_color']; |
| 407 |
$input_font_color = $ACL_Settings['input_font_color']; |
| 408 |
$link_color = $ACL_Settings['link_color']; |
| 409 |
$button_color = $ACL_Settings['button_color']; |
| 410 |
$heading_font_size = $ACL_Settings['heading_font_size']; |
| 411 |
$input_font_size = $ACL_Settings['input_font_size']; |
| 412 |
$link_size = $ACL_Settings['link_size']; |
| 413 |
$button_font_size = $ACL_Settings['button_font_size']; |
| 414 |
$enable_link_shadow = $ACL_Settings['enable_link_shadow']; |
| 415 |
$link_shadow_color = $ACL_Settings['link_shadow_color']; |
| 416 |
$heading_font_style = $ACL_Settings['heading_font_style']; |
| 417 |
$input_font_style = $ACL_Settings['input_font_style']; |
| 418 |
$link_font_style = $ACL_Settings['link_font_style']; |
| 419 |
$button_font_style = $ACL_Settings['button_font_style']; |
| 420 |
$enable_inputbox_icon = $ACL_Settings['enable_inputbox_icon']; |
| 421 |
$user_input_icon = $ACL_Settings['user_input_icon']; |
| 422 |
$password_input_icon = $ACL_Settings['password_input_icon']; |
| 423 |
|
| 424 |
$logo_image = $ACL_Settings['logo_image']; |
| 425 |
$logo_width = $ACL_Settings['logo_width']; |
| 426 |
$logo_height = $ACL_Settings['logo_height']; |
| 427 |
$logo_url = $ACL_Settings['logo_url']; |
| 428 |
$logo_url_title = $ACL_Settings['logo_url_title']; |
| 429 |
|
| 430 |
$Slidshow_image_1 = $ACL_Settings['Slidshow_image_1']; |
| 431 |
$Slidshow_image_2 = $ACL_Settings['Slidshow_image_2']; |
| 432 |
$Slidshow_image_3 = $ACL_Settings['Slidshow_image_3']; |
| 433 |
$Slidshow_image_4 = $ACL_Settings['Slidshow_image_4']; |
| 434 |
$Slidshow_image_5 = $ACL_Settings['Slidshow_image_5']; |
| 435 |
$Slidshow_image_6 = $ACL_Settings['Slidshow_image_6']; |
| 436 |
|
| 437 |
$Slidshow_image_label_1 = $ACL_Settings['Slidshow_image_label_1']; |
| 438 |
$Slidshow_image_label_2 = $ACL_Settings['Slidshow_image_label_2']; |
| 439 |
$Slidshow_image_label_3 = $ACL_Settings['Slidshow_image_label_3']; |
| 440 |
$Slidshow_image_label_4 = $ACL_Settings['Slidshow_image_label_4']; |
| 441 |
$Slidshow_image_label_5 = $ACL_Settings['Slidshow_image_label_5']; |
| 442 |
$Slidshow_image_label_6 = $ACL_Settings['Slidshow_image_label_6']; |
| 443 |
|
| 444 |
$enable_social_icon = $ACL_Settings['enable_social_icon']; |
| 445 |
$social_icon_size = $ACL_Settings['social_icon_size']; |
| 446 |
$social_icon_layout = $ACL_Settings['social_icon_layout']; |
| 447 |
$social_icon_color = $ACL_Settings['social_icon_color']; |
| 448 |
$social_icon_color_onhover= $ACL_Settings['social_icon_color_onhover']; |
| 449 |
$social_icon_bg = $ACL_Settings['social_icon_bg']; |
| 450 |
$social_icon_bg_onhover = $ACL_Settings['social_icon_bg_onhover']; |
| 451 |
$social_facebook_link = $ACL_Settings['social_facebook_link']; |
| 452 |
$social_twitter_link = $ACL_Settings['social_twitter_link']; |
| 453 |
$social_linkedin_link = $ACL_Settings['social_linkedin_link']; |
| 454 |
$social_google_plus_link= $ACL_Settings['social_google_plus_link']; |
| 455 |
$social_pinterest_link = $ACL_Settings['social_pinterest_link']; |
| 456 |
|
| 457 |
$upload_dir = wp_upload_dir(); |
| 458 |
$plugins_dir = plugins_url(); |
| 459 |
|
| 460 |
// Top Background Image |
| 461 |
$data = $top_image; |
| 462 |
if (strpos($data,'uploads') == true) { |
| 463 |
list($oteher_path, $image_path) = explode("uploads", $data); |
| 464 |
$top_image = $upload_dir['baseurl']. $image_path; |
| 465 |
}else if (strpos($data,'plugins') == true){ |
| 466 |
list($oteher_path, $image_path) = explode("plugins", $data); |
| 467 |
$top_image = $plugins_dir. $image_path; |
| 468 |
} |
| 469 |
|
| 470 |
// Login From Background Image |
| 471 |
$data1 = $login_bg_image; |
| 472 |
if (strpos($data1,'uploads') == true) { |
| 473 |
list($oteher_path1, $image_path1) = explode("uploads", $data1); |
| 474 |
$login_bg_image = $upload_dir['baseurl']. $image_path1; |
| 475 |
}else if (strpos($data1,'plugins') == true){ |
| 476 |
list($oteher_path1, $image_path1) = explode("plugins", $data1); |
| 477 |
$login_bg_image = $plugins_dir. $image_path1; |
| 478 |
} |
| 479 |
|
| 480 |
// Login From Background Image |
| 481 |
$data2 = $logo_image; |
| 482 |
if (strpos($data2,'uploads') == true) { |
| 483 |
list($oteher_path2, $image_path2) = explode("uploads", $data2); |
| 484 |
$logo_image = $upload_dir['baseurl']. $image_path2; |
| 485 |
}else if (strpos($data2,'plugins') == true){ |
| 486 |
list($oteher_path2, $image_path2) = explode("plugins", $data2); |
| 487 |
$logo_image = $plugins_dir. $image_path2; |
| 488 |
} |
| 489 |
|
| 490 |
// Slider Image 1 |
| 491 |
$Slidshow_image_url_1 = $Slidshow_image_1; |
| 492 |
if (strpos($Slidshow_image_url_1,'uploads') == true) { |
| 493 |
list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_1); |
| 494 |
$Slidshow_image_1 = $upload_dir['baseurl']. $image_path; |
| 495 |
}else if (strpos($Slidshow_image_url_1,'plugins') == true){ |
| 496 |
list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_1); |
| 497 |
$Slidshow_image_1 = $plugins_dir. $image_path; |
| 498 |
} |
| 499 |
|
| 500 |
// Slider Image 2 |
| 501 |
$Slidshow_image_url_2 = $Slidshow_image_2; |
| 502 |
if (strpos($Slidshow_image_url_2,'uploads') == true) { |
| 503 |
list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_2); |
| 504 |
$Slidshow_image_2 = $upload_dir['baseurl']. $image_path; |
| 505 |
}else if (strpos($Slidshow_image_url_2,'plugins') == true){ |
| 506 |
list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_2); |
| 507 |
$Slidshow_image_2 = $plugins_dir. $image_path; |
| 508 |
} |
| 509 |
|
| 510 |
// Slider Image 3 |
| 511 |
$Slidshow_image_url_3 = $Slidshow_image_3; |
| 512 |
if (strpos($Slidshow_image_url_3,'uploads') == true) { |
| 513 |
list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_3); |
| 514 |
$Slidshow_image_3 = $upload_dir['baseurl']. $image_path; |
| 515 |
}else if (strpos($Slidshow_image_url_3,'plugins') == true){ |
| 516 |
list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_3); |
| 517 |
$Slidshow_image_3 = $plugins_dir. $image_path; |
| 518 |
} |
| 519 |
|
| 520 |
// Slider Image 4 |
| 521 |
$Slidshow_image_url_4 = $Slidshow_image_4; |
| 522 |
if (strpos($Slidshow_image_url_4,'uploads') == true) { |
| 523 |
list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_4); |
| 524 |
$Slidshow_image_4 = $upload_dir['baseurl']. $image_path; |
| 525 |
}else if (strpos($Slidshow_image_url_4,'plugins') == true){ |
| 526 |
list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_4); |
| 527 |
$Slidshow_image_4 = $plugins_dir. $image_path; |
| 528 |
} |
| 529 |
|
| 530 |
// Slider Image 5 |
| 531 |
$Slidshow_image_url_5 = $Slidshow_image_5; |
| 532 |
if (strpos($Slidshow_image_url_5,'uploads') == true) { |
| 533 |
list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_5); |
| 534 |
$Slidshow_image_5 = $upload_dir['baseurl']. $image_path; |
| 535 |
}else if (strpos($Slidshow_image_url_5,'plugins') == true){ |
| 536 |
list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_5); |
| 537 |
$Slidshow_image_5 = $plugins_dir. $image_path; |
| 538 |
} |
| 539 |
|
| 540 |
// Slider Image 6 |
| 541 |
$Slidshow_image_url_6 = $Slidshow_image_6; |
| 542 |
if (strpos($Slidshow_image_url_6,'uploads') == true) { |
| 543 |
list($oteher_path, $image_path) = explode("uploads", $Slidshow_image_url_6); |
| 544 |
$Slidshow_image_6 = $upload_dir['baseurl']. $image_path; |
| 545 |
}else if (strpos($Slidshow_image_url_6,'plugins') == true){ |
| 546 |
list($oteher_path, $image_path) = explode("plugins", $Slidshow_image_url_6); |
| 547 |
$Slidshow_image_6 = $plugins_dir. $image_path; |
| 548 |
} |
| 549 |
|
| 550 |
|
| 551 |
$dashboard_page= serialize(array( |
| 552 |
'dashboard_status' => $dashboard_status |
| 553 |
)); |
| 554 |
update_option('Admin_custome_login_dashboard', $dashboard_page); |
| 555 |
|
| 556 |
$top_page= serialize(array( |
| 557 |
'top_bg_type' => $top_bg_type , |
| 558 |
'top_color' => $top_color , |
| 559 |
'top_image' => $top_image, |
| 560 |
'top_cover' => $top_cover, |
| 561 |
'top_repeat' => $top_repeat , |
| 562 |
'top_position' => $top_position , |
| 563 |
'top_attachment' => $top_attachment, |
| 564 |
'top_slideshow_no' => $top_slideshow_no, |
| 565 |
'top_bg_slider_animation' => $top_bg_slider_animation |
| 566 |
)); |
| 567 |
update_option('Admin_custome_login_top', $top_page); |
| 568 |
|
| 569 |
$login_page= serialize(array( |
| 570 |
'login_bg_type' => $login_bg_type, |
| 571 |
'login_form_float' => $login_form_float, |
| 572 |
'login_bg_color' => $login_bg_color, |
| 573 |
'login_bg_effect' => $login_bg_effect, |
| 574 |
'login_bg_image' => $login_bg_image, |
| 575 |
'login_form_opacity' => $login_form_opacity, |
| 576 |
'login_form_width' => $login_form_width, |
| 577 |
'login_form_radius' => $login_form_radius, |
| 578 |
'login_border_style' => $login_border_style, |
| 579 |
'login_border_thikness' => $login_border_thikness, |
| 580 |
'login_border_color' => $login_border_color, |
| 581 |
'login_bg_repeat' => $login_bg_repeat, |
| 582 |
'login_bg_position' => $login_bg_position, |
| 583 |
'login_enable_shadow' => $login_enable_shadow, |
| 584 |
'login_shadow_color' => $login_shadow_color |
| 585 |
)); |
| 586 |
update_option('Admin_custome_login_login', $login_page); |
| 587 |
|
| 588 |
$text_and_color_page= serialize(array( |
| 589 |
'heading_font_color' => $heading_font_color, |
| 590 |
'input_font_color' => $input_font_color, |
| 591 |
'link_color' => $link_color, |
| 592 |
'button_color' => $button_color, |
| 593 |
'heading_font_size' => $heading_font_size, |
| 594 |
'input_font_size' => $input_font_size, |
| 595 |
'link_size' => $link_size, |
| 596 |
'button_font_size' => $button_font_size, |
| 597 |
'enable_link_shadow' => $enable_link_shadow, |
| 598 |
'link_shadow_color' => $link_shadow_color, |
| 599 |
'heading_font_style' => $heading_font_style, |
| 600 |
'input_font_style' => $input_font_style, |
| 601 |
'link_font_style' => $link_font_style, |
| 602 |
'button_font_style' => $button_font_style, |
| 603 |
'enable_inputbox_icon' => $enable_inputbox_icon, |
| 604 |
'user_input_icon' => $user_input_icon, |
| 605 |
'password_input_icon' => $password_input_icon |
| 606 |
)); |
| 607 |
update_option('Admin_custome_login_text', $text_and_color_page); |
| 608 |
|
| 609 |
$logo_page= serialize(array( |
| 610 |
'logo_image' => $logo_image, |
| 611 |
'logo_width' => $logo_width, |
| 612 |
'logo_height' => $logo_height, |
| 613 |
'logo_url' => $logo_url, |
| 614 |
'logo_url_title' => $logo_url_title |
| 615 |
)); |
| 616 |
update_option('Admin_custome_login_logo', $logo_page); |
| 617 |
|
| 618 |
$Social_page= serialize(array( |
| 619 |
'enable_social_icon' => $enable_social_icon , |
| 620 |
'social_icon_size' => $social_icon_size , |
| 621 |
'social_icon_layout' => $social_icon_layout , |
| 622 |
'social_icon_color' => $social_icon_color , |
| 623 |
'social_icon_color_onhover'=> $social_icon_color_onhover , |
| 624 |
'social_icon_bg' => $social_icon_bg, |
| 625 |
'social_icon_bg_onhover'=> $social_icon_bg_onhover , |
| 626 |
'social_facebook_link' => $social_facebook_link , |
| 627 |
'social_twitter_link' => $social_twitter_link, |
| 628 |
'social_linkedin_link' => $social_linkedin_link , |
| 629 |
'social_google_plus_link'=> $social_google_plus_link , |
| 630 |
'social_pinterest_link' => $social_pinterest_link |
| 631 |
)); |
| 632 |
update_option('Admin_custome_login_Social', $Social_page); |
| 633 |
|
| 634 |
$Slidshow_image= serialize(array( |
| 635 |
'Slidshow_image_1' => $Slidshow_image_1 , |
| 636 |
'Slidshow_image_2' => $Slidshow_image_2 , |
| 637 |
'Slidshow_image_3' => $Slidshow_image_3 , |
| 638 |
'Slidshow_image_4' => $Slidshow_image_4 , |
| 639 |
'Slidshow_image_5' => $Slidshow_image_5 , |
| 640 |
'Slidshow_image_6' => $Slidshow_image_6 , |
| 641 |
'Slidshow_image_label_1'=> $Slidshow_image_label_1 , |
| 642 |
'Slidshow_image_label_2'=> $Slidshow_image_label_2 , |
| 643 |
'Slidshow_image_label_3'=> $Slidshow_image_label_3 , |
| 644 |
'Slidshow_image_label_4'=> $Slidshow_image_label_4 , |
| 645 |
'Slidshow_image_label_5'=> $Slidshow_image_label_5 , |
| 646 |
'Slidshow_image_label_6'=> $Slidshow_image_label_6 |
| 647 |
)); |
| 648 |
update_option('Admin_custome_login_Slidshow', $Slidshow_image); |
| 649 |
|
| 650 |
//wp_safe_redirect( admin_url( 'options-general.php?page=admin_custom_login' ) ); exit; |
| 651 |
|
| 652 |
} |
| 653 |
add_action( 'admin_init', 'acl_import_settings' ); |
| 654 |
?> |