/**
  *
  * Actually build the option pages
  *
  */
 function build_options_page()
 {
     // tabed browsing
     $default_tab = isset(self::$options['last_open']) ? self::$options['last_open'] : 'main_tab';
     $active = isset($_GET['tab']) ? $_GET['tab'] : $default_tab;
     // this is only necessary if the plugin is activated for network
     if (@$_GET['action'] == 'update') {
         $input = $_POST['clp_options'];
         self::$options = $this->validate($input);
         update_site_option('clp_options', self::$options);
         $this->initialize_settings();
     }
     // the main options page begins here
     $eol = "\n";
     $tab = "\t";
     $dtab = $tab . $tab;
     // navigation
     self::open_page('A5 Custom Login Page', __('http://wasistlos.waldemarstoffel.com/plugins-fur-wordpress/a5-custom-login-page', 'custom-login-page'), 'custom-login-page');
     settings_errors();
     $tabs['main_tab'] = array('class' => $active == 'main_tab' ? ' nav-tab-active' : '', 'text' => __('General Options', 'custom-login-page'));
     $tabs['advanced_tab'] = array('class' => $active == 'advanced_tab' ? ' nav-tab-active' : '', 'text' => __('Advanced Options', 'custom-login-page'));
     $tabs['body_tab'] = array('class' => $active == 'body_tab' ? ' nav-tab-active' : '', 'text' => __('Body & Submit Button', 'custom-login-page'));
     $tabs['logo_tab'] = array('class' => $active == 'logo_tab' ? ' nav-tab-active' : '', 'text' => __('Logo', 'custom-login-page'));
     $tabs['video_tab'] = array('class' => $active == 'video_tab' ? ' nav-tab-active' : '', 'text' => __('Video', 'custom-login-page'));
     $tabs['logindiv_tab'] = array('class' => $active == 'logindiv_tab' ? ' nav-tab-active' : '', 'text' => __('Login Container', 'custom-login-page'));
     $tabs['loginform_tab'] = array('class' => $active == 'loginform_tab' ? ' nav-tab-active' : '', 'text' => __('Login Form', 'custom-login-page'));
     $tabs['message_tab'] = array('class' => $active == 'message_tab' ? ' nav-tab-active' : '', 'text' => __('Messages & Input Fields', 'custom-login-page'));
     $tabs['link_tab'] = array('class' => $active == 'link_tab' ? ' nav-tab-active' : '', 'text' => __('Links', 'custom-login-page'));
     $tabs['css_tab'] = array('class' => $active == 'css_tab' ? ' nav-tab-active' : '', 'text' => __('CSS', 'custom-login-page'));
     $tabs['html_tab'] = array('class' => $active == 'html_tab' ? ' nav-tab-active' : '', 'text' => __('Additional HTML', 'custom-login-page'));
     if (!is_multisite()) {
         $tabs['preview_tab'] = array('id' => 'prev', 'class' => $active == 'preview_tab' ? ' nav-tab-active' : ' thickbox', 'text' => __('Preview'));
     }
     $args = array('page' => 'clp-settings', 'menu_items' => $tabs);
     self::nav_menu($args);
     $action = is_plugin_active_for_network(CLP_BASE) ? '?page=clp-settings&tab=' . $active . '&action=update' : 'options.php';
     self::open_form($action);
     // nonce and stuff which is the same for all tabs
     wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
     wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
     a5_hidden_field('tab', 'clp_options[tab]', $active, true);
     settings_fields('clp_options');
     if (!is_multisite()) {
         add_thickbox();
     }
     // the actual option tabs
     if ($active == 'main_tab') {
         self::open_tab();
         self::sortable('top', self::postbox(__('Logged Out and Error Messages', 'custom-login-page'), 'main-options', 'clp_message'));
         self::sortable('middle', self::postbox(__('Import / Export', 'custom-login-page'), 'impex', array('clp_export', 'clp_import')));
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         submit_button();
         self::close_tab();
     }
     if ($active == 'advanced_tab') {
         self::open_tab();
         self::sortable('top', self::postbox(__('Include Header & Footer from Frontend', 'custom-login-page'), 'include-frontend', 'clp_blog'));
         self::sortable('upper-middle', self::postbox(__('Hide Links', 'custom-login-page'), 'hide-links', 'clp_hide'));
         self::sortable('lower-middle', self::postbox(__('Debug dynamical CSS', 'custom-login-page'), 'debug-css', 'clp_debug'));
         self::sortable('bottom', self::postbox(__('Custom Redirects', 'custom-login-page'), 'redirect', 'clp_redirect'));
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         submit_button();
         self::close_tab();
     }
     if ($active == 'body_tab') {
         self::open_tab();
         self::sortable('top', self::postbox(__('Body', 'custom-login-page'), 'body', 'clp_body'));
         self::sortable('middle', self::postbox(__('Submit Button', 'custom-login-page'), 'submit-button', 'clp_button'));
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         submit_button();
         self::close_tab();
     }
     if ($active == 'logo_tab') {
         self::open_tab();
         self::sortable('top', self::postbox(__('Logo of the Login Screen', 'custom-login-page'), 'logo', 'clp_logo'));
         self::sortable('middle', self::postbox(__('Position and Size of the Logo', 'custom-login-page'), 'logo-pos', 'clp_logo_size'));
         self::sortable('bottom', self::postbox(__('Styling of the Logo', 'custom-login-page'), 'logo-style', 'clp_logo_style'));
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         submit_button();
         self::close_tab();
     }
     if ($active == 'video_tab') {
         self::open_tab();
         a5_hidden_field('ajax_nonce', 'ajax_nonce', wp_create_nonce('zwetschgenbremmel'));
         self::sortable('top', self::postbox(__('Video above the Login Lorm', 'custom-login-page'), 'video', 'clp_video'));
         self::sortable('middle', self::postbox(__('Additional Parameters', 'custom-login-page'), 'video-paameters', 'clp_video_parameters'));
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         submit_button();
         self::close_tab();
     }
     if ($active == 'logindiv_tab') {
         self::open_tab();
         self::sortable('top', self::postbox(__('Login Container', 'custom-login-page'), 'login', 'clp_logindiv'));
         self::sortable('middle', self::postbox(__('Position and Size of the Login Container', 'custom-login-page'), 'login-pos', 'clp_logindiv_pos'));
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         submit_button();
         self::close_tab();
     }
     if ($active == 'loginform_tab') {
         self::open_tab('clp', 'loginform');
         self::sortable('top', self::postbox(__('Login Form', 'custom-login-page'), 'form', 'clp_loginform'));
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         submit_button();
         self::close_tab();
     }
     if ($active == 'message_tab') {
         self::open_tab();
         self::sortable('top', self::postbox(__('Logout Message', 'custom-login-page'), 'message-logout', 'clp_logout_message'));
         self::sortable('middle', self::postbox(__('Error Message', 'custom-login-page'), 'message-error', 'clp_error_message'));
         self::sortable('bottom', self::postbox(__('Input Fields', 'custom-login-page'), 'fields', 'clp_input'));
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         submit_button();
         self::close_tab();
     }
     if ($active == 'link_tab') {
         self::open_tab();
         self::sortable('top', self::postbox(__('Links', 'custom-login-page'), 'link', 'clp_link'));
         self::sortable('middel', self::postbox(__('Links Hover', 'custom-login-page'), 'link-hover', 'clp_hover'));
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         submit_button();
         self::close_tab();
     }
     if ($active == 'css_tab') {
         self::open_tab(2);
         self::sortable('top', self::postbox(__('CSS and SVG', 'custom-login-page'), 'css-svg', array('clp_css', 'clp_svg')));
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         submit_button();
         $elements = array('body.login', 'body.login div#login', 'body.login div#login h1', 'body.login div#login h1 a', 'body.login div#login form#loginform', 'body.login div#login form#loginform p', 'body.login div#login form#loginform p label', 'body.login div#login form#loginform input', 'body.login div#login form#loginform input#user_login', 'body.login div#login form#loginform input#user_pass', 'body.login div#login form#loginform p.forgetmenot', 'body.login div#login form#loginform p.forgetmenot input#rememberme', 'body.login div#login form#loginform p.submit', 'body.login div#login form#loginform p.submit input#wp-submit', 'body.login div#login p#nav', 'body.login div#login p#nav a', 'body.login div#login p#backtoblog', 'body.login div#login p#backtoblog a');
         $content = self::tag_it(__('To be able to use your own css it is important to know, what elements you actually can style on the login page. In the list below you find all neccessary selectors for your style sheet.', 'custom-login-page'), 'p');
         $content .= self::tag_it(self::list_it($elements, false, false, false, false), 'b');
         $content .= self::tag_it(__('In order to override the original styles, your selectors have to be more precise than the original ones. By using the ones in the list exactly how they are there, you should be fine.', 'custom-login-page'), 'p');
         self::column('1');
         self::sortable('side_top', self::help_box($content, __('CSS Help', 'custom-login-page')));
         $donationtext = self::tag_it(__('If you like the plugin and find it useful, you might think of rewarding the dozens of hours of work that were spent creating it.', 'custom-login-page'), 'p');
         self::sortable('side_middle', self::donation_box($donationtext, __('Donations', 'custom-login-page'), '32XGSBKTQNNHA', 'http%3A%2F%2Fwasistlos.waldemarstoffel.com%2Fplugins-fur-wordpress%2Fa5-custom-login-page'));
         self::close_tab();
     }
     if ($active == 'html_tab') {
         self::open_tab();
         self::sortable('top', self::postbox(__('HTML additions', 'custom-login-page'), 'html-additions', 'clp_html'));
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         submit_button();
         self::close_tab();
     }
     if ($active == 'preview_tab') {
         self::open_tab();
         echo self::open_sortable('top');
         echo self::open_postbox(__('Preview'), 'preview-result');
         echo '<iframe src="' . wp_login_url() . '" sandbox="" style="width: 100%; height: 650px;"></iframe>';
         echo self::close_postbox();
         if (WP_DEBUG === true) {
             self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
         }
         echo self::close_sortable();
         self::close_tab();
     }
 }
 /**
  *
  * Actually build the option pages
  *
  */
 function build_options_page()
 {
     // tabed browsing
     $default_tab = isset(self::$options['last_open']) ? self::$options['last_open'] : 'main_tab';
     $active = isset($_GET['tab']) ? $_GET['tab'] : $default_tab;
     // this is only necessary if the plugin is activated for network
     if (@$_GET['action'] == 'update') {
         $input = $_POST['clp_widget_options'];
         self::$options = $this->validate($input);
         update_site_option('clp_widget_options', self::$options);
         $this->initialize_settings();
     }
     // the main options page begins here
     $eol = "\n";
     $tab = "\t";
     $dtab = $tab . $tab;
     // navigation
     self::open_page('A5 Custom Login Widget', __('http://wasistlos.waldemarstoffel.com/plugins-fur-wordpress/a5-custom-login-page', 'custom-login-page'), 'custom-login-page');
     settings_errors();
     $tabs['main_tab'] = array('class' => $active == 'main_tab' ? ' nav-tab-active' : '', 'text' => __('General Options', 'custom-login-page'));
     $tabs['widget_tab'] = array('class' => $active == 'widget_tab' ? ' nav-tab-active' : '', 'text' => __('Widget', 'custom-login-page'));
     $tabs['logo_tab'] = array('class' => $active == 'logo_tab' ? ' nav-tab-active' : '', 'text' => __('Logo', 'custom-login-page'));
     $tabs['loginform_tab'] = array('class' => $active == 'loginform_tab' ? ' nav-tab-active' : '', 'text' => __('Login Form', 'custom-login-page'));
     $tabs['button_tab'] = array('class' => $active == 'button_tab' ? ' nav-tab-active' : '', 'text' => __('Input Fields & Submit Button', 'custom-login-page'));
     $tabs['link_tab'] = array('class' => $active == 'link_tab' ? ' nav-tab-active' : '', 'text' => __('Links', 'custom-login-page'));
     $tabs['css_tab'] = array('class' => $active == 'css_tab' ? ' nav-tab-active' : '', 'text' => __('CSS', 'custom-login-page'));
     $tabs['html_tab'] = array('class' => $active == 'html_tab' ? ' nav-tab-active' : '', 'text' => __('Additional HTML', 'custom-login-page'));
     $args = array('page' => 'clp-widget-settings', 'menu_items' => $tabs);
     self::nav_menu($args);
     $action = is_plugin_active_for_network(CLP_BASE) ? '?page=clp-widget-settings&tab=' . $active . '&action=update' : 'options.php';
     self::open_form($action);
     // nonce and stuff which is the same for all tabs
     wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false);
     wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false);
     a5_hidden_field('tab', 'clp_widget_options[tab]', $active, true);
     settings_fields('clp_widget_options');
     // the actual option tabs
     if ($active == 'main_tab') {
         self::open_tab(2);
         self::sortable('top', self::postbox(__('Basic Options for the Login Form', 'custom-login-page'), 'basic', 'clp_widget_main'));
         self::sortable('middle', self::postbox(__('Advanced Options for the Login Form', 'custom-login-page'), 'advanced', 'clp_widget_advanced'));
         self::sortable('bottom', self::postbox(__('Import / Export', 'custom-login-page'), 'impex', array('clp_widget_export', 'clp_widget_import')));
     }
     if ($active == 'widget_tab') {
         self::open_tab(2);
         self::sortable('top', self::postbox(__('Widget Container', 'custom-login-page'), 'widget-container', 'clp_widget_container'));
         self::sortable('bottom', self::postbox(__('Padding & Margin', 'custom-login-page'), 'widget-container-pos', 'clp_widget_container_pos'));
     }
     if ($active == 'logo_tab') {
         self::open_tab(2);
         self::sortable('top', self::postbox(__('Logo of the Login Screen', 'custom-login-page'), 'logo', 'clp_widget_logo'));
         self::sortable('middle', self::postbox(__('Padding & Margin', 'custom-login-page'), 'logo-pos', 'clp_widget_logo_size'));
         self::sortable('bottom', self::postbox(__('Styling of the Logo', 'custom-login-page'), 'logo-style', 'clp_widget_logo_style'));
     }
     if ($active == 'loginform_tab') {
         self::open_tab(2);
         self::sortable('top', self::postbox(__('Login Form', 'custom-login-page'), 'form', 'clp_widget_loginform'));
     }
     if ($active == 'button_tab') {
         self::open_tab(2);
         self::sortable('top', self::postbox(__('Input Fields', 'custom-login-page'), 'input-fields', 'clp_widget_input'));
         self::sortable('middle', self::postbox(__('Submit Button', 'custom-login-page'), 'submit-button', 'clp_widget_button'));
     }
     if ($active == 'link_tab') {
         self::open_tab(2);
         self::sortable('top', self::postbox(__('Links', 'custom-login-page'), 'link', 'clp_widget_link'));
         self::sortable('middel', self::postbox(__('Links Hover', 'custom-login-page'), 'link-hover', 'clp_widget_hover'));
     }
     if ($active == 'css_tab') {
         self::open_tab(2);
         self::sortable('top', self::postbox(__('CSS', 'custom-login-page'), 'css-additions', 'clp_widget_css'));
         $elements = array('.widget_custom_login_widget[id^="custom_login_widget"]', '.widget_custom_login_widget[id^="custom_login_widget"] h3', '.widget_custom_login_widget[id^="custom_login_widget"] form', '.widget_custom_login_widget[id^="custom_login_widget"] p', '.widget_custom_login_widget[id^="custom_login_widget"] label', '.widget_custom_login_widget[id^="custom_login_widget"] p.login-username', '.widget_custom_login_widget[id^="custom_login_widget"] p.login-password', '.widget_custom_login_widget[id^="custom_login_widget"] p.login-remember', '.widget_custom_login_widget[id^="custom_login_widget"] p.login-submit', '.widget_custom_login_widget[id^="custom_login_widget"] p.login-username label', '.widget_custom_login_widget[id^="custom_login_widget"] p.login-password label', '.widget_custom_login_widget[id^="custom_login_widget"] p.login-remember label', '.widget_custom_login_widget[id^="custom_login_widget"] p.login-submit label', '.widget_custom_login_widget[id^="custom_login_widget"] input', '.widget_custom_login_widget[id^="custom_login_widget"] input.button-primary', '.widget_custom_login_widget[id^="custom_login_widget"] a');
         $content = self::tag_it(__('To be able to use your own css it is important to know, what elements you actually can style in the login widget. In the list below you find all neccessary selectors for your style sheet.', 'custom-login-page'), 'p');
         $content .= self::tag_it(self::list_it($elements, false, false, false, false), 'b');
         self::sortable('middle', self::help_box($content, __('CSS Help', 'custom-login-page')));
     }
     if ($active == 'html_tab') {
         self::open_tab(2);
         self::sortable('top', self::postbox(__('HTML additions', 'custom-login-page'), 'html-additions', 'clp_widget_html_outside'));
         self::sortable('middle', self::postbox(__('HTML additions', 'custom-login-page'), 'html-additions', 'clp_widget_html_inside'));
     }
     if (WP_DEBUG === true) {
         self::sortable('deep-down', self::debug_info(self::$options, __('Debug Info', 'custom-login-page')));
     }
     submit_button();
     echo '</form>';
     self::column('1');
     self::preview_widget();
     $donationtext = self::tag_it(__('If you like the plugin and find it useful, you might think of rewarding the dozens of hours of work that were spent creating it.', 'custom-login-page'), 'p');
     self::sortable('side_middle', self::donation_box($donationtext, __('Donations', 'custom-login-page'), '32XGSBKTQNNHA', 'http%3A%2F%2Fwasistlos.waldemarstoffel.com%2Fplugins-fur-wordpress%2Fa5-custom-login-page'));
     self::close_tab();
     echo '</div>';
 }