function wpm_add_admin() { $wp_maintenanceAdminOptions = array( 'enable' => 0, 'color_bg' => "#f1f1f1", 'color_txt' => '#888888', 'color_bg_bottom' => '#333333', 'color_text_bottom' => '#FFFFFF', 'titre_maintenance' => __('This site is down for maintenance', 'wp-maintenance'), 'text_maintenance' => __('Come back quickly !', 'wp-maintenance'), 'userlimit' => 'administrator', 'image' => WP_PLUGIN_URL.'/wp-maintenance/images/default.png', 'font_title' => 'Acme', 'font_title_size' => 40, 'font_text' => 'Acme', 'font_text_size' => 40, 'font_text_bottom' => 'Acme', 'font_bottom_size' => 12, 'font_cpt' => 'Acme', 'enable_demo' => 0, 'color_text_button' => '#FFFFFF', 'color_button' => '#1e73be', 'image_width' => 250, 'image_height' => 100, 'newletter' => 0, 'active_cpt' => 0, 'newletter_font_text' => '#333333', 'newletter_size' => 18, 'newletter_font_style' => '', 'newletter_font_weigth' => 'normal', 'newletter_font_text' => 20, 'font_title_style' => '', 'font_text_style' => '', 'font_bottom_style' => '', 'title_newletter' => '', 'code_newletter' => '', 'code_analytics' => '', 'domain_analytics' => $_SERVER['SERVER_NAME'], 'text_bt_maintenance' => '', 'add_wplogin' => '', 'newletter' => '', 'active_cpt' => 0, 'newletter_size' => 18, 'newletter_font_weigth' => 'normal', 'font_title_style' => '', 'font_text_style' => '', 'font_bottom_style' => '', 'b_enable_image' => 0, 'disable' => 0, ); $getMaintenanceSettings = get_option('wp_maintenance_settings'); if (!empty($getMaintenanceSettings)) { foreach ($getMaintenanceSettings as $key => $option) { $wp_maintenanceAdminOptions[$key] = $option; } } update_option('wp_maintenance_settings', $wp_maintenanceAdminOptions); if(!get_option('wp_maintenance_active')) { update_option('wp_maintenance_active', 0); } if(!get_option('wp_maintenance_style') or get_option('wp_maintenance_style')=='') { update_option('wp_maintenance_style', wpm_print_style()); } $getMaintenanceSettings = extract(get_option('wp_maintenance_settings')); if( $getMaintenanceSettings['enable_demo']==1 ) { $hook = add_options_page(__( 'Options for the maintenance page', 'wp-maintenance' ), "WP Maintenance", 'read', __FILE__, "wpm_admin_panel"); } else { $hook = add_options_page(__( 'Options for the maintenance page', 'wp-maintenance' ), "WP Maintenance", 'manage_options', __FILE__, "wpm_admin_panel"); } }
// Récupère les Rôles et capabilités if(get_option('wp_maintenance_limit')) { extract(get_option('wp_maintenance_limit')); } $paramLimit = get_option('wp_maintenance_limit'); // Récupère si le status est actif ou non $statusActive = get_option('wp_maintenance_active'); // Récupère les Reseaux Sociaux $paramSocial = get_option('wp_maintenance_social'); if(get_option('wp_maintenance_social_options')) { extract(get_option('wp_maintenance_social_options')); } $paramSocialOption = get_option('wp_maintenance_social_options'); /* Si on réinitialise les feuille de styles */ if( isset($_POST['wpm_initcss']) && $_POST['wpm_initcss']==1) { update_option( 'wp_maintenance_style', wpm_print_style() ); $options_saved = true; echo '<div id="message" class="updated fade"><p><strong>'.__('The Style Sheet has been reset!', 'wp-maintenance').'</strong></p></div>'; } ?> <style> .sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; } .sortable li { padding: 0.4em; padding-left: 1.5em; height: 30px;cursor: pointer; cursor: move; } .sortable li span { font-size: 15px;margin-right: 0.8em;cursor: move; } .sortable li:hover { background-color: #d2d2d2; } #pattern { text-align: left; margin: 5px 0; word-spacing: -1em;list-style-type: none; } #pattern li { display: inline-block; list-style: none;margin-right:15px;text-align:center; } #pattern li.current { background: #66CC00; color: #fff; } </style> <style type="text/css">.postbox h3 { cursor:pointer; }</style>