function drawSystemInfo()
{
    require_once THEME_INCLUDES . '/sys-info.php';
    $system_info = new Simple_System_Info();
    echo '<div id="system_info_default_section_group' . '">';
    echo '<div id="redux-system-info">';
    echo $system_info->get(true);
    echo '</div>';
    echo '</div>';
}
 /**
  * HTML OUTPUT.
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function _options_page_html()
 {
     $saved = get_transient("redux-saved-{$this->args['opt_name']}");
     if ($saved) {
         delete_transient("redux-saved-{$this->args['opt_name']}");
     }
     echo '<div class="wrap"><h2></h2></div>';
     // Stupid hack for Wordpress alerts and warnings
     echo '<div class="clear"></div>';
     echo '<div class="wrap">';
     // Do we support JS?
     echo '<noscript><div class="no-js">' . __('Warning- This options panel will not work properly without javascript!', 'redux-framework') . '</div></noscript>';
     // Security is vital!
     echo '<input type="hidden" id="ajaxsecurity" name="security" value="' . wp_create_nonce('of_ajax_nonce') . '" />';
     /**
      * action 'redux-page-before-form-{opt_name}'
      * @deprecated
      */
     do_action("redux-page-before-form-{$this->args['opt_name']}");
     // Remove
     /**
      * action 'redux/page/{opt_name}/form/before'
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/form/before", $this);
     // Main container
     echo '<div class="redux-container">';
     echo '<form method="post" action="' . './options.php" enctype="multipart/form-data" id="redux-form-wrapper">';
     echo '<input type="hidden" id="redux-compiler-hook" name="' . $this->args['opt_name'] . '[compiler]" value="" />';
     echo '<input type="hidden" id="currentSection" name="' . $this->args['opt_name'] . '[redux-section]" value="" />';
     settings_fields("{$this->args['opt_name']}_group");
     // Last tab?
     if (empty($this->options['last_tab'])) {
         $this->options['last_tab'] = '';
     }
     $this->options['last_tab'] = isset($_GET['tab']) && !$saved ? $_GET['tab'] : $this->options['last_tab'];
     echo '<input type="hidden" id="last_tab" name="' . $this->args['opt_name'] . '[last_tab]" value="' . $this->options['last_tab'] . '" />';
     // Header area
     echo '<div id="redux-header">';
     if (!empty($this->args['display_name'])) {
         echo '<div class="display_header">';
         echo '<h2>' . $this->args['display_name'] . '</h2>';
         if (!empty($this->args['display_version'])) {
             echo '<span>' . $this->args['display_version'] . '</span>';
         }
         echo '</div>';
     }
     // Page icon
     // DOVY!
     echo '<div id="' . $this->args['page_icon'] . '" class="icon32"></div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     // Intro text
     if (isset($this->args['intro_text'])) {
         echo '<div id="redux-intro-text">';
         echo $this->args['intro_text'];
         echo '</div>';
     }
     // Stickybar
     echo '<div id="redux-sticky">';
     echo '<div id="info_bar">';
     echo '<a href="javascript:void(0);" class="expand_options">' . __('Expand', 'redux-framework') . '</a>';
     echo '<div class="redux-action_bar">';
     submit_button(__('Save Changes', 'redux-framework'), 'primary', 'redux_save', false);
     echo '&nbsp;';
     submit_button(__('Reset Section', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults-section]', false);
     echo '&nbsp;';
     submit_button(__('Reset All', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults]', false);
     echo '</div>';
     echo '<div class="redux-ajax-loading" alt="' . __('Working...', 'redux-framework') . '">&nbsp;</div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     // Warning bar
     if (isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true' && $saved == '1') {
         if (isset($this->options['REDUX_imported']) && $this->options['REDUX_imported'] === 1) {
             /**
              * filter 'redux-imported-text-{opt_name}'
              * @param string  translated "settings imported" text
              */
             echo '<div id="redux-imported"><strong>' . apply_filters("redux-imported-text-{$this->args['opt_name']}", __('Settings Imported!', 'redux-framework')) . '</strong></div>';
         } else {
             /**
              * filter 'redux-saved-text-{opt_name}'
              * @param string translated "settings saved" text
              */
             echo '<div id="redux-save"><strong>' . apply_filters("redux-saved-text-{$this->args['opt_name']}", __('Settings Saved!', 'redux-framework')) . '</strong></div>';
         }
     }
     /**
      * filter 'redux-changed-text-{opt_name}'
      * @param string translated "settings have changed" text
      */
     echo '<div id="redux-save-warn"><strong>' . apply_filters("redux-changed-text-{$this->args['opt_name']}", __('Settings have changed, you should save them!', 'redux-framework')) . '</strong></div>';
     echo '<div id="redux-field-errors"><strong><span></span> ' . __('error(s) were found!', 'redux-framework') . '</strong></div>';
     echo '<div id="redux-field-warnings"><strong><span></span> ' . __('warning(s) were found!', 'redux-framework') . '</strong></div>';
     echo '</div>';
     echo '<div class="clear"></div>';
     // Sidebar
     echo '<div class="redux-sidebar">';
     echo '<ul class="redux-group-menu">';
     foreach ($this->sections as $k => $section) {
         echo $this->section_menu($k, $section);
     }
     echo '<li class="divide">&nbsp;</li>';
     /**
      * action 'redux-page-after-sections-menu-{opt_name}'
      * @param object $this ReduxFramework
      */
     do_action("redux-page-after-sections-menu-{$this->args['opt_name']}", $this);
     /**
      * action 'redux/page/{opt_name}/menu/after'
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/menu/after", $this);
     if ($this->args['show_import_export'] === true) {
         echo '<li id="import_export_default_section_group_li" class="redux-group-tab-link-li">';
         if (!empty($this->args['icon_type']) && $this->args['icon_type'] == 'image') {
             $icon = !isset($this->args['import_icon']) ? '' : '<img src="' . $this->args['import_icon'] . '" /> ';
         } else {
             $icon_class = !isset($this->args['import_icon_class']) ? '' : ' ' . $this->args['import_icon_class'];
             $icon = !isset($this->args['import_icon']) ? '<i class="el-icon-refresh' . $icon_class . '"></i>' : '<i class="icon-' . $this->args['import_icon'] . $icon_class . '"></i> ';
         }
         echo '<a href="javascript:void(0);" id="import_export_default_section_group_li_a" class="redux-group-tab-link-a" data-rel="import_export_default">' . $icon . ' <span class="group_title">' . __('Import / Export', 'redux-framework') . '</span></a>';
         echo '</li>';
         echo '<li class="divide">&nbsp;</li>';
     }
     if ($this->args['dev_mode'] === true) {
         echo '<li id="dev_mode_default_section_group_li" class="redux-group-tab-link-li">';
         if (!empty($this->args['icon_type']) && $this->args['icon_type'] == 'image') {
             $icon = !isset($this->args['dev_mode_icon']) ? '' : '<img src="' . $this->args['dev_mode_icon'] . '" /> ';
         } else {
             $icon_class = !isset($this->args['dev_mode_icon_class']) ? '' : ' ' . $this->args['dev_mode_icon_class'];
             $icon = !isset($this->args['dev_mode_icon']) ? '<i class="el-icon-info-sign' . $icon_class . '"></i>' : '<i class="icon-' . $this->args['dev_mode_icon'] . $icon_class . '"></i> ';
         }
         echo '<a href="javascript:void(0);" id="dev_mode_default_section_group_li_a" class="redux-group-tab-link-a custom-tab" data-rel="dev_mode_default">' . $icon . ' <span class="group_title">' . __('Options Object', 'redux-framework') . '</span></a>';
         echo '</li>';
     }
     if ($this->args['system_info'] === true) {
         echo '<li id="system_info_default_section_group_li" class="redux-group-tab-link-li">';
         if (!empty($this->args['icon_type']) && $this->args['icon_type'] == 'image') {
             $icon = !isset($this->args['system_info_icon']) ? '' : '<img src="' . $this->args['system_info_icon'] . '" /> ';
         } else {
             $icon_class = !isset($this->args['system_info_icon_class']) ? '' : ' ' . $this->args['system_info_icon_class'];
             $icon = !isset($this->args['system_info_icon']) ? '<i class="el-icon-info-sign' . $icon_class . '"></i>' : '<i class="icon-' . $this->args['system_info_icon'] . $icon_class . '"></i> ';
         }
         echo '<a href="javascript:void(0);" id="system_info_default_section_group_li_a" class="redux-group-tab-link-a custom-tab" data-rel="system_info_default">' . $icon . ' <span class="group_title">' . __('System Info', 'redux-framework') . '</span></a>';
         echo '</li>';
     }
     echo '</ul>';
     echo '</div>';
     echo '<div class="redux-main">';
     foreach ($this->sections as $k => $section) {
         echo '<div id="' . $k . '_section_group' . '" class="redux-group-tab">';
         if (!empty($section['sections'])) {
             //$tabs = "";
             echo '<div id="' . $k . '_section_tabs' . '" class="redux-section-tabs">';
             echo '<ul>';
             foreach ($section['sections'] as $subkey => $subsection) {
                 echo '<li><a href="#' . $k . '_section-tab-' . $subkey . '">' . $subsection['title'] . '</a></li>';
             }
             echo '</ul>';
             foreach ($section['sections'] as $subkey => $subsection) {
                 echo '<div id="' . $k . 'sub-' . $subkey . '_section_group' . '" class="redux-group-tab">';
                 echo '<div id="' . $k . '_section-tab-' . $subkey . '">';
                 echo "hello" . $subkey;
                 do_settings_sections($this->args['opt_name'] . $k . '_tab_' . $subkey . '_section_group');
                 echo "</div>";
             }
             echo "</div>";
         } else {
             do_settings_sections($this->args['opt_name'] . $k . '_section_group');
         }
         echo '</div>';
     }
     if ($this->args['show_import_export'] === true) {
         echo '<div id="import_export_default_section_group' . '" class="redux-group-tab">';
         echo '<h3>' . __('Import / Export Options', 'redux-framework') . '</h3>';
         echo '<h4>' . __('Import Options', 'redux-framework') . '</h4>';
         echo '<p><a href="javascript:void(0);" id="redux-import-code-button" class="button-secondary">' . __('Import from file', 'redux-framework') . '</a> <a href="javascript:void(0);" id="redux-import-link-button" class="button-secondary">' . __('Import from URL', 'redux-framework') . '</a></p>';
         echo '<div id="redux-import-code-wrapper">';
         echo '<div class="redux-section-desc">';
         /**
          * filter 'redux-import-file-description'
          * @param string translated settings import instructions text
          */
         echo '<p class="description" id="import-code-description">' . apply_filters('redux-import-file-description', __('Input your backup file below and hit Import to restore your sites options from a backup.', 'redux-framework')) . '</p>';
         echo '</div>';
         echo '<textarea id="import-code-value" name="' . $this->args['opt_name'] . '[import_code]" class="large-text noUpdate" rows="8"></textarea>';
         echo '</div>';
         echo '<div id="redux-import-link-wrapper">';
         echo '<div class="redux-section-desc">';
         /**
          * filter 'redux-import-link-description'
          * @param string translated settings import instructions text
          */
         echo '<p class="description" id="import-link-description">' . apply_filters('redux-import-link-description', __('Input the URL to another sites options set and hit Import to load the options from that site.', 'redux-framework')) . '</p>';
         echo '</div>';
         echo '<input type="text" id="import-link-value" name="' . $this->args['opt_name'] . '[import_link]" class="large-text noUpdate" value="" />';
         echo '</div>';
         /**
          * filter 'redux-import-warning'
          * @param string translated settings import confirmation/warning text
          */
         echo '<p id="redux-import-action"><input type="submit" id="redux-import" name="' . $this->args['opt_name'] . '[import]" class="button-primary" value="' . __('Import', 'redux-framework') . '">&nbsp;&nbsp;<span>' . apply_filters('redux-import-warning', __('WARNING! This will overwrite all existing option values, please proceed with caution!', 'redux-framework')) . '</span></p>';
         echo '<div class="hr"/><div class="inner"><span>&nbsp;</span></div></div>';
         echo '<h4>' . __('Export Options', 'redux-framework') . '</h4>';
         echo '<div class="redux-section-desc">';
         /**
          * filter 'redux-backup-description'
          * @param string translated settings backup information
          */
         echo '<p class="description">' . apply_filters('redux-backup-description', __('Here you can copy/download your current option settings. Keep this safe as you can use it as a backup should anything go wrong, or you can use it to restore your settings on this site (or any other site).', 'redux-framework')) . '</p>';
         echo '</div>';
         /** @noinspection PhpUndefinedConstantInspection */
         echo '<p><a href="javascript:void(0);" id="redux-export-code-copy" class="button-secondary">' . __('Copy', 'redux-framework') . '</a> <a href="' . add_query_arg(array('feed' => 'redux_options_' . $this->args['opt_name'], 'action' => 'download_options', 'secret' => md5(AUTH_KEY . SECURE_AUTH_KEY)), site_url()) . '" id="redux-export-code-dl" class="button-primary">' . __('Download', 'redux-framework') . '</a> <a href="javascript:void(0);" id="redux-export-link" class="button-secondary">' . __('Copy Link', 'redux-framework') . '</a></p>';
         $backup_options = $this->options;
         $backup_options['redux-backup'] = '1';
         echo '<textarea class="large-text noUpdate" id="redux-export-code" rows="8">';
         if (version_compare(phpversion(), "5.3.0", ">=")) {
             print_r(json_encode($backup_options, true));
         } else {
             print_r(json_encode($backup_options));
         }
         echo '</textarea>';
         /** @noinspection PhpUndefinedConstantInspection */
         echo '<input type="text" class="large-text noUpdate" id="redux-export-link-value" value="' . add_query_arg(array('feed' => 'redux_options_' . $this->args['opt_name'], 'secret' => md5(AUTH_KEY . SECURE_AUTH_KEY)), site_url()) . '" />';
         echo '</div>';
     }
     if ($this->args['dev_mode'] === true) {
         echo '<div id="dev_mode_default_section_group' . '" class="redux-group-tab">';
         echo '<h3>' . __('Options Object', 'redux-framework') . '</h3>';
         echo '<div class="redux-section-desc">';
         echo '<div id="redux-object-browser"></div>';
         echo '</div>';
         if (version_compare(phpversion(), "5.3.0", ">=")) {
             $json = json_encode($this->options, true);
         } else {
             $json = json_encode($this->options);
         }
         echo '<div id="redux-object-json" class="hide">' . $json . '</div>';
         echo '<a href="#" id="consolePrintObject" class="button">' . __('Show Object in Javascript Console Object', 'redux-framework') . '</a>';
         // END Javascript object debug
         echo '</div>';
     }
     if ($this->args['system_info'] === true) {
         require_once 'inc/sysinfo.php';
         $system_info = new Simple_System_Info();
         echo '<div id="system_info_default_section_group' . '" class="redux-group-tab">';
         echo '<h3>' . __('System Info', 'redux-framework') . '</h3>';
         echo '<div id="redux-system-info">';
         echo $system_info->get(true);
         echo '</div>';
         echo '</div>';
     }
     /**
      * action 'redux/page-after-sections-{opt_name}'
      * @deprecated
      * @param object $this ReduxFramework
      */
     do_action("redux/page-after-sections-{$this->args['opt_name']}", $this);
     // REMOVE LATER
     /**
      * action 'redux/page/{opt_name}/sections/after'
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/sections/after", $this);
     echo '<div class="clear"></div>';
     echo '</div>';
     echo '<div class="clear"></div>';
     echo '<div id="redux-sticky-padder" style="display: none;">&nbsp;</div>';
     echo '<div id="redux-footer-sticky"><div id="redux-footer">';
     if (isset($this->args['share_icons'])) {
         echo '<div id="redux-share">';
         foreach ($this->args['share_icons'] as $link) {
             // SHIM, use URL now
             if (isset($link['link']) && !empty($link['link'])) {
                 $link['url'] = $link['link'];
                 unset($link['link']);
             }
             echo '<a href="' . $link['url'] . '" title="' . $link['title'] . '" target="_blank">';
             if (isset($link['icon']) && !empty($link['icon'])) {
                 echo '<i class="' . $link['icon'] . '"></i>';
             } else {
                 echo '<img src="' . $link['img'] . '"/>';
             }
             echo '</a>';
         }
         echo '</div>';
     }
     echo '<div class="redux-action_bar">';
     submit_button(__('Save Changes', 'redux-framework'), 'primary', 'redux_save', false);
     echo '&nbsp;';
     submit_button(__('Reset Section', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults-section]', false);
     echo '&nbsp;';
     submit_button(__('Reset All', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults]', false);
     echo '</div>';
     echo '<div class="redux-ajax-loading" alt="' . __('Working...', 'redux-framework') . '">&nbsp;</div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     echo '</form>';
     echo '</div></div>';
     echo isset($this->args['footer_text']) ? '<div id="redux-sub-footer">' . $this->args['footer_text'] . '</div>' : '';
     /**
      * action 'redux-page-after-form-{opt_name}'
      * @deprecated
      */
     do_action("redux-page-after-form-{$this->args['opt_name']}");
     // REMOVE
     /**
      * action 'redux/page/{opt_name}/form/after'
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/form/after", $this);
     echo '<div class="clear"></div>';
     echo '</div><!--wrap-->';
     if ($this->args['dev_mode'] === true) {
         if (current_user_can('administrator')) {
             global $wpdb;
             echo "<br /><pre>";
             print_r($wpdb->queries);
             echo "</pre>";
         }
         echo '<br /><div class="redux-timer">' . get_num_queries() . ' queries in ' . timer_stop(0) . ' seconds<br/>Redux is currently set to developer mode.</div>';
     }
 }
Beispiel #3
0
 /**
  * HTML OUTPUT.
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function _options_page_html()
 {
     echo '<div class="wrap"><h2></h2></div>';
     // Stupid hack for Wordpress alerts and warnings
     echo '<div class="clear"></div>';
     echo '<div class="wrap">';
     // Do we support JS?
     echo '<noscript><div class="no-js">' . __('Warning- This options panel will not work properly without javascript!', 'redux-framework') . '</div></noscript>';
     // Security is vital!
     echo '<input type="hidden" id="ajaxsecurity" name="security" value="' . wp_create_nonce('redux_ajax_nonce') . '" />';
     /**
      * action 'redux-page-before-form-{opt_name}'
      *
      * @deprecated
      */
     do_action("redux-page-before-form-{$this->args['opt_name']}");
     // Remove
     /**
      * action 'redux/page/{opt_name}/form/before'
      *
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/form/before", $this);
     // Main container
     $expanded = $this->args['open_expanded'] ? ' fully-expanded' : '';
     echo '<div class="redux-container' . $expanded . (!empty($this->args['class']) ? ' ' . $this->args['class'] : '') . '">';
     $url = './options.php';
     if ($this->args['database'] == "network" && $this->args['network_admin']) {
         if (is_network_admin()) {
             $url = './edit.php?action=redux_' . $this->args['opt_name'];
         }
     }
     echo '<form method="post" action="' . $url . '" enctype="multipart/form-data" id="redux-form-wrapper">';
     echo '<input type="hidden" id="redux-compiler-hook" name="' . $this->args['opt_name'] . '[compiler]" value="" />';
     echo '<input type="hidden" id="currentSection" name="' . $this->args['opt_name'] . '[redux-section]" value="" />';
     if (!empty($this->no_panel)) {
         echo '<input type="hidden" name="' . $this->args['opt_name'] . '[redux-no_panel]" value="' . implode('|', $this->no_panel) . '" />';
     }
     settings_fields("{$this->args['opt_name']}_group");
     // Last tab?
     $this->options['last_tab'] = isset($_GET['tab']) && !isset($this->transients['last_save_mode']) ? $_GET['tab'] : '';
     echo '<input type="hidden" id="last_tab" name="' . $this->args['opt_name'] . '[last_tab]" value="' . $this->options['last_tab'] . '" />';
     // Header area
     echo '<div id="redux-header">';
     if (!empty($this->args['display_name'])) {
         echo '<div class="display_header">';
         if (isset($this->args['dev_mode']) && $this->args['dev_mode']) {
             echo '<span class="redux-dev-mode-notice">' . __('Developer Mode Enabled', 'redux-framework') . '</span>';
         }
         echo '<h2>' . $this->args['display_name'] . '</h2>';
         if (!empty($this->args['display_version'])) {
             echo '<span>' . $this->args['display_version'] . '</span>';
         }
         echo '</div>';
     }
     echo '<div class="clear"></div>';
     echo '</div>';
     // Intro text
     if (isset($this->args['intro_text'])) {
         echo '<div id="redux-intro-text">';
         echo $this->args['intro_text'];
         echo '</div>';
     }
     // Stickybar
     echo '<div id="redux-sticky">';
     echo '<div id="info_bar">';
     $expanded = $this->args['open_expanded'] ? ' expanded' : '';
     $hide_expand = $this->args['hide_expand'] ? ' style="display: none;"' : '';
     echo '<a href="javascript:void(0);" class="expand_options' . $expanded . '"' . $hide_expand . '>' . __('Expand', 'redux-framework') . '</a>';
     echo '<div class="redux-action_bar">';
     submit_button(__('Save Changes', 'redux-framework'), 'primary', 'redux_save', false);
     if (false === $this->args['hide_reset']) {
         echo '&nbsp;';
         submit_button(__('Reset Section', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults-section]', false);
         echo '&nbsp;';
         submit_button(__('Reset All', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults]', false);
     }
     echo '</div>';
     echo '<div class="redux-ajax-loading" alt="' . __('Working...', 'redux-framework') . '">&nbsp;</div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     // Warning bar
     if (isset($this->transients['last_save_mode'])) {
         if ($this->transients['last_save_mode'] == "import") {
             /**
              * action 'redux/options/{opt_name}/import'
              *
              * @param object $this ReduxFramework
              */
             do_action("redux/options/{$this->args['opt_name']}/import", $this, $this->transients['changed_values']);
             /**
              * filter 'redux-imported-text-{opt_name}'
              *
              * @param string  translated "settings imported" text
              */
             echo '<div class="admin-notice notice-blue saved_notice"><strong>' . apply_filters("redux-imported-text-{$this->args['opt_name']}", __('Settings Imported!', 'redux-framework')) . '</strong></div>';
             //exit();
         } else {
             if ($this->transients['last_save_mode'] == "defaults") {
                 /**
                  * action 'redux/options/{opt_name}/reset'
                  *
                  * @param object $this ReduxFramework
                  */
                 do_action("redux/options/{$this->args['opt_name']}/reset", $this);
                 /**
                  * filter 'redux-defaults-text-{opt_name}'
                  *
                  * @param string  translated "settings imported" text
                  */
                 echo '<div class="saved_notice admin-notice notice-yellow"><strong>' . apply_filters("redux-defaults-text-{$this->args['opt_name']}", __('All Defaults Restored!', 'redux-framework')) . '</strong></div>';
             } else {
                 if ($this->transients['last_save_mode'] == "defaults_section") {
                     /**
                      * action 'redux/options/{opt_name}/section/reset'
                      *
                      * @param object $this ReduxFramework
                      */
                     do_action("redux/options/{$this->args['opt_name']}/section/reset", $this);
                     /**
                      * filter 'redux-defaults-section-text-{opt_name}'
                      *
                      * @param string  translated "settings imported" text
                      */
                     echo '<div class="saved_notice admin-notice notice-yellow"><strong>' . apply_filters("redux-defaults-section-text-{$this->args['opt_name']}", __('Section Defaults Restored!', 'redux-framework')) . '</strong></div>';
                 } else {
                     if ($this->transients['last_save_mode'] == "normal") {
                         /**
                          * action 'redux/options/{opt_name}/saved'
                          *
                          * @param mixed $value set/saved option value
                          */
                         do_action("redux/options/{$this->args['opt_name']}/saved", $this->options, $this->transients['changed_values']);
                         /**
                          * filter 'redux-saved-text-{opt_name}'
                          *
                          * @param string translated "settings saved" text
                          */
                         echo '<div class="saved_notice admin-notice notice-green"><strong>' . apply_filters("redux-saved-text-{$this->args['opt_name']}", __('Settings Saved!', 'redux-framework')) . '</strong></div>';
                     }
                 }
             }
         }
         unset($this->transients['last_save_mode']);
         //$this->transients['last_save_mode'] = 'remove';
         $this->set_transients();
     }
     /**
      * action 'redux/options/{opt_name}/settings/changes'
      *
      * @param mixed $value set/saved option value
      */
     do_action("redux/options/{$this->args['opt_name']}/settings/change", $this->options, $this->transients['changed_values']);
     /**
      * filter 'redux-changed-text-{opt_name}'
      *
      * @param string translated "settings have changed" text
      */
     echo '<div class="redux-save-warn notice-yellow"><strong>' . apply_filters("redux-changed-text-{$this->args['opt_name']}", __('Settings have changed, you should save them!', 'redux-framework')) . '</strong></div>';
     /**
      * action 'redux/options/{opt_name}/errors'
      *
      * @param array $this ->errors error information
      */
     do_action("redux/options/{$this->args['opt_name']}/errors", $this->errors);
     echo '<div class="redux-field-errors notice-red"><strong><span></span> ' . __('error(s) were found!', 'redux-framework') . '</strong></div>';
     /**
      * action 'redux/options/{opt_name}/warnings'
      *
      * @param array $this ->warnings warning information
      */
     do_action("redux/options/{$this->args['opt_name']}/warnings", $this->warnings);
     echo '<div class="redux-field-warnings notice-yellow"><strong><span></span> ' . __('warning(s) were found!', 'redux-framework') . '</strong></div>';
     echo '</div>';
     echo '<div class="clear"></div>';
     // Sidebar
     echo '<div class="redux-sidebar">';
     echo '<ul class="redux-group-menu">';
     foreach ($this->sections as $k => $section) {
         $title = isset($section['title']) ? $section['title'] : '';
         $skip_sec = false;
         foreach ($this->hidden_perm_sections as $num => $section_title) {
             if ($section_title == $title) {
                 $skip_sec = true;
             }
         }
         if (isset($section['customizer_only']) && $section['customizer_only'] == true) {
             continue;
         }
         if (false == $skip_sec) {
             echo $this->section_menu($k, $section);
             $skip_sec = false;
         }
     }
     /**
      * action 'redux-page-after-sections-menu-{opt_name}'
      *
      * @param object $this ReduxFramework
      */
     do_action("redux-page-after-sections-menu-{$this->args['opt_name']}", $this);
     /**
      * action 'redux/page/{opt_name}/menu/after'
      *
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/menu/after", $this);
     // Import / Export tab
     if (true == $this->args['show_import_export'] && false == $this->import_export->is_field) {
         $this->import_export->render_tab();
     }
     // Debug tab
     if ($this->args['dev_mode'] == true) {
         $this->debug->render_tab();
     }
     if ($this->args['system_info'] === true) {
         echo '<li id="system_info_default_section_group_li" class="redux-group-tab-link-li">';
         if (!empty($this->args['icon_type']) && $this->args['icon_type'] == 'image') {
             $icon = !isset($this->args['system_info_icon']) ? '' : '<img src="' . $this->args['system_info_icon'] . '" /> ';
         } else {
             $icon_class = !isset($this->args['system_info_icon_class']) ? '' : ' ' . $this->args['system_info_icon_class'];
             $icon = !isset($this->args['system_info_icon']) ? '<i class="el-icon-info-sign' . $icon_class . '"></i>' : '<i class="icon-' . $this->args['system_info_icon'] . $icon_class . '"></i> ';
         }
         echo '<a href="javascript:void(0);" id="system_info_default_section_group_li_a" class="redux-group-tab-link-a custom-tab" data-rel="system_info_default">' . $icon . ' <span class="group_title">' . __('System Info', 'redux-framework') . '</span></a>';
         echo '</li>';
     }
     echo '</ul>';
     echo '</div>';
     echo '<div class="redux-main">';
     foreach ($this->sections as $k => $section) {
         if (isset($section['customizer_only']) && $section['customizer_only'] == true) {
             continue;
         }
         //$active = ( ( is_numeric($this->current_tab) && $this->current_tab == $k ) || ( !is_numeric($this->current_tab) && $this->current_tab === $k )  ) ? ' style="display: block;"' : '';
         $section['class'] = isset($section['class']) ? ' ' . $section['class'] : '';
         echo '<div id="' . $k . '_section_group' . '" class="redux-group-tab' . $section['class'] . '" data-rel="' . $k . '">';
         //echo '<div id="' . $k . '_nav-bar' . '"';
         /*
                         if ( !empty( $section['tab'] ) ) {
         
         echo '<div id="' . $k . '_section_tabs' . '" class="redux-section-tabs">';
         
         echo '<ul>';
         
         foreach ($section['tab'] as $subkey => $subsection) {
             //echo '-=' . $subkey . '=-';
             echo '<li style="display:inline;"><a href="#' . $k . '_section-tab-' . $subkey . '">' . $subsection['title'] . '</a></li>';
         }
         
         echo '</ul>';
         foreach ($section['tab'] as $subkey => $subsection) {
             echo '<div id="' . $k .'sub-'.$subkey. '_section_group' . '" class="redux-group-tab" style="display:block;">';
             echo '<div id="' . $k . '_section-tab-' . $subkey . '">';
             echo "hello ".$subkey;
             do_settings_sections( $this->args['opt_name'] . $k . '_tab_' . $subkey . '_section_group' );
             echo "</div>";
             echo "</div>";
         }
         echo "</div>";
                         } else {
         */
         // Don't display in the
         $display = true;
         if (isset($_GET['page']) && $_GET['page'] == $this->args['page_slug']) {
             if (isset($section['panel']) && $section['panel'] == "false") {
                 $display = false;
             }
         }
         if ($display) {
             do_settings_sections($this->args['opt_name'] . $k . '_section_group');
         }
         //}
         echo "</div>";
         //echo '</div>';
     }
     // Import / Export output
     if (true == $this->args['show_import_export'] && false == $this->import_export->is_field) {
         $this->import_export->enqueue();
         echo '<fieldset id="' . $this->args['opt_name'] . '-import_export_core" class="redux-field-container redux-field redux-field-init redux-container-import_export" data-id="import_export_core" data-type="import_export">';
         $this->import_export->render();
         echo '</fieldset>';
     }
     // Debug object output
     if ($this->args['dev_mode'] == true) {
         $this->debug->render();
     }
     if ($this->args['system_info'] === true) {
         require_once 'inc/sysinfo.php';
         $system_info = new Simple_System_Info();
         echo '<div id="system_info_default_section_group' . '" class="redux-group-tab">';
         echo '<h3>' . __('System Info', 'redux-framework') . '</h3>';
         echo '<div id="redux-system-info">';
         echo $system_info->get(true);
         echo '</div>';
         echo '</div>';
     }
     /**
      * action 'redux/page-after-sections-{opt_name}'
      *
      * @deprecated
      *
      * @param object $this ReduxFramework
      */
     do_action("redux/page-after-sections-{$this->args['opt_name']}", $this);
     // REMOVE LATER
     /**
      * action 'redux/page/{opt_name}/sections/after'
      *
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/sections/after", $this);
     echo '<div class="clear"></div>';
     echo '</div>';
     echo '<div class="clear"></div>';
     echo '<div id="redux-sticky-padder" style="display: none;">&nbsp;</div>';
     echo '<div id="redux-footer-sticky"><div id="redux-footer">';
     if (isset($this->args['share_icons'])) {
         echo '<div id="redux-share">';
         foreach ($this->args['share_icons'] as $link) {
             // SHIM, use URL now
             if (isset($link['link']) && !empty($link['link'])) {
                 $link['url'] = $link['link'];
                 unset($link['link']);
             }
             echo '<a href="' . $link['url'] . '" title="' . $link['title'] . '" target="_blank">';
             if (isset($link['icon']) && !empty($link['icon'])) {
                 echo '<i class="' . $link['icon'] . '"></i>';
             } else {
                 echo '<img src="' . $link['img'] . '"/>';
             }
             echo '</a>';
         }
         echo '</div>';
     }
     echo '<div class="redux-action_bar">';
     submit_button(__('Save Changes', 'redux-framework'), 'primary', 'redux_save', false);
     if (false === $this->args['hide_reset']) {
         echo '&nbsp;';
         submit_button(__('Reset Section', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults-section]', false);
         echo '&nbsp;';
         submit_button(__('Reset All', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults]', false);
     }
     echo '</div>';
     echo '<div class="redux-ajax-loading" alt="' . __('Working...', 'redux-framework') . '">&nbsp;</div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     echo '</form>';
     echo '</div></div>';
     echo isset($this->args['footer_text']) ? '<div id="redux-sub-footer">' . $this->args['footer_text'] . '</div>' : '';
     /**
      * action 'redux-page-after-form-{opt_name}'
      *
      * @deprecated
      */
     do_action("redux-page-after-form-{$this->args['opt_name']}");
     // REMOVE
     /**
      * action 'redux/page/{opt_name}/form/after'
      *
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/form/after", $this);
     echo '<div class="clear"></div>';
     echo '</div><!--wrap-->';
     if ($this->args['dev_mode'] == true) {
         if (current_user_can('administrator')) {
             global $wpdb;
             echo "<br /><pre>";
             print_r($wpdb->queries);
             echo "</pre>";
         }
         echo '<br /><div class="redux-timer">' . get_num_queries() . ' queries in ' . timer_stop(0) . ' seconds<br/>Redux is currently set to developer mode.</div>';
     }
     $this->set_transients();
 }
Beispiel #4
0
 function sf_system_info()
 {
     if (isset($_GET['sf_debug']) && $_GET['sf_debug'] == true) {
         require_once 'debug/sysinfo.php';
         $system_info = new Simple_System_Info();
         echo '<div id="sf-debug">';
         echo '<h3>Debug</h3>';
         echo $system_info->get(true);
         echo '</div>';
     }
 }
Beispiel #5
0
 /**
  * HTML OUTPUT.
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function _options_page_html()
 {
     $saved = get_transient('redux-saved-' . $this->args['opt_name']);
     if ($saved) {
         delete_transient('redux-saved-' . $this->args['opt_name']);
     }
     echo '<div class="clear"></div>';
     echo '<div class="wrap">';
     // Do we support JS?
     echo '<noscript><div class="no-js">' . __('Warning- This options panel will not work properly without javascript!', 'redux-framework') . '</div></noscript>';
     // Security is vital!
     echo '<input type="hidden" id="ajaxsecurity" name="security" value="' . wp_create_nonce('of_ajax_nonce') . '" />';
     do_action('redux-page-before-form-' . $this->args['opt_name']);
     // Main container
     echo '<div id="redux-container">';
     echo '<form method="post" action="./options.php" enctype="multipart/form-data" id="redux-form-wrapper">';
     echo '<input type="hidden" id="redux-compiler-hook" name="' . $this->args['opt_name'] . '[compiler]" value="" />';
     settings_fields($this->args['opt_name'] . '_group');
     // Last tab?
     if (empty($this->options['last_tab'])) {
         $this->options['last_tab'] = '';
     }
     $this->options['last_tab'] = isset($_GET['tab']) && !$saved ? $_GET['tab'] : $this->options['last_tab'];
     echo '<input type="hidden" id="last_tab" name="' . $this->args['opt_name'] . '[last_tab]" value="' . $this->options['last_tab'] . '" />';
     // Header area
     echo '<div id="redux-header">';
     if (!empty($this->args['display_name'])) {
         echo '<div class="logo">';
         echo '<h2>' . $this->args['display_name'] . '</h2>';
         if (!empty($this->args['display_version'])) {
             echo '<span>' . $this->args['display_version'] . '</span>';
         }
         echo '</div>';
     }
     // Page icon
     // DOVY!
     echo '<div id="' . $this->args['page_icon'] . '" class="icon32"></div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     // Intro text
     if (isset($this->args['intro_text'])) {
         echo '<div id="redux-intro-text">';
         echo $this->args['intro_text'];
         echo '</div>';
     }
     // Stickybar
     echo '<div id="redux-sticky">';
     echo '<div id="info_bar">';
     echo '<a href="javascript:void(0);" id="expand_options">' . __('Expand', 'redux-framework') . '</a>';
     echo '<div class="redux-action_bar">';
     echo '<a href="http://www.thinkupthemes.com/themes/minamaze/" target="_blank" class="promotion-button">Upgrade Now</a>';
     submit_button('', 'primary', 'redux_save', false);
     echo '&nbsp;';
     submit_button(__('Reset to Defaults', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults]', false);
     echo '</div>';
     echo '<div class="redux-ajax-loading" alt="' . __('Working...', 'redux-framework') . '">&nbsp;</div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     // Warning bar
     if (isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true' && $saved == '1') {
         if (isset($this->options['REDUX_imported']) && $this->options['REDUX_imported'] === 1) {
             echo '<div id="redux-imported">' . apply_filters('redux-imported-text-' . $this->args['opt_name'], '' . __('<strong>Settings Imported!</strong>', 'redux-framework')) . '</div>';
         } else {
             echo '<div id="redux-save">' . apply_filters('redux-saved-text-' . $this->args['opt_name'], __('<strong>Settings Saved!</strong>', 'redux-framework')) . '</div>';
         }
     }
     echo '<div id="redux-save-warn">' . apply_filters('redux-changed-text-' . $this->args['opt_name'], __('<strong>Settings have changed, you should save them!</strong>', 'redux-framework')) . '</div>';
     echo '<div id="redux-field-errors">' . __('<strong><span></span> error(s) were found!</strong>', 'redux-framework') . '</div>';
     echo '<div id="redux-field-warnings">' . __('<strong><span></span> warning(s) were found!</strong>', 'redux-framework') . '</div>';
     echo '</div>';
     echo '<div class="clear"></div>';
     // Sidebar
     echo '<div id="redux-sidebar">';
     echo '<ul id="redux-group-menu">';
     foreach ($this->sections as $k => $section) {
         if (!empty($this->args['icon_type']) && $this->args['icon_type'] == 'image') {
             $icon = !isset($section['icon']) ? '' : '<img src="' . $section['icon'] . '" /> ';
         } else {
             $icon_class = !isset($section['icon_class']) ? '' : ' ' . $section['icon_class'];
             $icon = !isset($section['icon']) ? '<i class="icon-cog' . $icon_class . '"></i> ' : '<i class="icon-' . $section['icon'] . $icon_class . '"></i> ';
         }
         if (isset($section['type']) && $section['type'] == "divide") {
             echo '<li class="divide">&nbsp;</li>';
         } else {
             // DOVY! REPLACE $k with $section['ID'] when used properly.
             echo '<li id="' . $k . '_section_group_li" class="redux-group-tab-link-li">';
             echo '<a href="javascript:void(0);" id="' . $k . '_section_group_li_a" class="redux-group-tab-link-a" data-rel="' . $k . '">' . $icon . '<span class="group_title">' . $section['title'] . '</span></a>';
             if (!empty($section['sections'])) {
                 echo '<ul id="' . $k . '_section_group_li_subsections" class="sub">';
                 foreach ($section['sections'] as $k2 => $subsection) {
                     echo '<li id="' . $k . '_section_group_li" class="redux-group-tab-link-li">';
                     echo '<a href="javascript:void(0);" id="' . $k . '_section_group_subsection_li_a" class="redux-group-tab-link-a" data-rel="' . $k . 'sub-' . $k2 . '"><span class="group_title">' . $subsection['title'] . '</span></a>';
                     echo '</li>';
                 }
                 echo '</ul>';
             }
             echo '</li>';
         }
     }
     echo '<li class="divide">&nbsp;</li>';
     do_action('redux-page-after-sections-menu-' . $this->args['opt_name'], $this);
     if ($this->args['show_import_export'] === true) {
         echo '<li id="import_export_default_section_group_li" class="redux-group-tab-link-li">';
         if (!empty($this->args['icon_type']) && $this->args['icon_type'] == 'image') {
             $icon = !isset($this->args['import_icon']) ? '' : '<img src="' . $this->args['import_icon'] . '" /> ';
         } else {
             $icon_class = !isset($this->args['import_icon_class']) ? '' : ' ' . $this->args['import_icon_class'];
             $icon = !isset($this->args['import_icon']) ? '<i class="icon-refresh' . $icon_class . '"></i>' : '<i class="icon-' . $this->args['import_icon'] . $icon_class . '"></i> ';
         }
         echo '<a href="javascript:void(0);" id="import_export_default_section_group_li_a" class="redux-group-tab-link-a" data-rel="import_export_default">' . $icon . ' <span class="group_title">' . __('Import / Export', 'redux-framework') . '</span></a>';
         echo '</li>';
         echo '<li class="divide">&nbsp;</li>';
     }
     if (is_array($this->extra_tabs)) {
         foreach ($this->extra_tabs as $k => $tab) {
             if (!empty($this->args['icon_type']) && $this->args['icon_type'] == 'image') {
                 $icon = !isset($tab['icon']) ? '' : '<img src="' . $tab['icon'] . '" /> ';
             } else {
                 $icon_class = !isset($tab['icon_class']) ? '' : ' ' . $tab['icon_class'];
                 $icon = !isset($tab['icon']) ? '<i class="icon-cog' . $icon_class . '"></i> ' : '<i class="icon-' . $tab['icon'] . $icon_class . '"></i> ';
             }
             echo '<li id="' . $k . '_section_group_li" class="redux-group-tab-link-li">';
             echo '<a href="javascript:void(0);" id="' . $k . '_section_group_li_a" class="redux-group-tab-link-a custom-tab" data-rel="' . $k . '">' . $icon . '<span class="group_title">' . $tab['title'] . '</span></a>';
             echo '</li>';
         }
     }
     if ($this->args['dev_mode'] === true) {
         echo '<li id="dev_mode_default_section_group_li" class="redux-group-tab-link-li">';
         if (!empty($this->args['icon_type']) && $this->args['icon_type'] == 'image') {
             $icon = !isset($this->args['dev_mode_icon']) ? '' : '<img src="' . $this->args['dev_mode_icon'] . '" /> ';
         } else {
             $icon_class = !isset($this->args['dev_mode_icon_class']) ? '' : ' ' . $this->args['dev_mode_icon_class'];
             $icon = !isset($this->args['dev_mode_icon']) ? '<i class="icon-info-sign' . $icon_class . '"></i>' : '<i class="icon-' . $this->args['dev_mode_icon'] . $icon_class . '"></i> ';
         }
         echo '<a href="javascript:void(0);" id="dev_mode_default_section_group_li_a" class="redux-group-tab-link-a custom-tab" data-rel="dev_mode_default">' . $icon . ' <span class="group_title">' . __('Options Object', 'redux-framework') . '</span></a>';
         echo '</li>';
     }
     if ($this->args['system_info'] === true) {
         echo '<li id="system_info_default_section_group_li" class="redux-group-tab-link-li">';
         if (!empty($this->args['icon_type']) && $this->args['icon_type'] == 'image') {
             $icon = !isset($this->args['system_info_icon']) ? '' : '<img src="' . $this->args['system_info_icon'] . '" /> ';
         } else {
             $icon_class = !isset($this->args['system_info_icon_class']) ? '' : ' ' . $this->args['system_info_icon_class'];
             $icon = !isset($this->args['system_info_icon']) ? '<i class="icon-info-sign' . $icon_class . '"></i>' : '<i class="icon-' . $this->args['system_info_icon'] . $icon_class . '"></i> ';
         }
         echo '<a href="javascript:void(0);" id="system_info_default_section_group_li_a" class="redux-group-tab-link-a custom-tab" data-rel="system_info_default">' . $icon . ' <span class="group_title">' . __('System Info', 'redux-framework') . '</span></a>';
         echo '</li>';
     }
     echo '</ul>';
     echo '</div>';
     echo '<div id="redux-main">';
     foreach ($this->sections as $k => $section) {
         echo '<div id="' . $k . '_section_group' . '" class="redux-group-tab">';
         if (!empty($section['sections'])) {
             //$tabs = "";
             echo '<div id="' . $k . '_section_tabs' . '" class="redux-section-tabs">';
             echo '<ul>';
             foreach ($section['sections'] as $subkey => $subsection) {
                 echo '<li><a href="#' . $k . '_section-tab-' . $subkey . '">' . $subsection['title'] . '</a></li>';
             }
             echo '</ul>';
             foreach ($section['sections'] as $subkey => $subsection) {
                 echo '<div id="' . $k . 'sub-' . $subkey . '_section_group' . '" class="redux-group-tab">';
                 echo '<div id="' . $k . '_section-tab-' . $subkey . '">';
                 echo "hello" . $subkey;
                 do_settings_sections($this->args['opt_name'] . $k . '_tab_' . $subkey . '_section_group');
                 echo "</div>";
             }
             echo "</div>";
         } else {
             do_settings_sections($this->args['opt_name'] . $k . '_section_group');
         }
         echo '</div>';
     }
     if ($this->args['show_import_export'] === true) {
         echo '<div id="import_export_default_section_group' . '" class="redux-group-tab">';
         echo '<h3>' . __('Import / Export Options', 'redux-framework') . '</h3>';
         echo '<h4>' . __('Import Options', 'redux-framework') . '</h4>';
         echo '<p><a href="javascript:void(0);" id="redux-import-code-button" class="button-secondary">' . __('Import from file', 'redux-framework') . '</a> <a href="javascript:void(0);" id="redux-import-link-button" class="button-secondary">' . __('Import from URL', 'redux-framework') . '</a></p>';
         echo '<div id="redux-import-code-wrapper">';
         echo '<div class="redux-section-desc">';
         echo '<p class="description" id="import-code-description">' . apply_filters('redux-import-file-description', __('Input your backup file below and hit Import to restore your sites options from a backup.', 'redux-framework')) . '</p>';
         echo '</div>';
         echo '<textarea id="import-code-value" name="' . $this->args['opt_name'] . '[import_code]" class="large-text noUpdate" rows="8"></textarea>';
         echo '</div>';
         echo '<div id="redux-import-link-wrapper">';
         echo '<div class="redux-section-desc">';
         echo '<p class="description" id="import-link-description">' . apply_filters('redux-import-link-description', __('Input the URL to another sites options set and hit Import to load the options from that site.', 'redux-framework')) . '</p>';
         echo '</div>';
         echo '<input type="text" id="import-link-value" name="' . $this->args['opt_name'] . '[import_link]" class="large-text noUpdate" value="" />';
         echo '</div>';
         echo '<p id="redux-import-action"><input type="submit" id="redux-import" name="' . $this->args['opt_name'] . '[import]" class="button-primary" value="' . __('Import', 'redux-framework') . '">&nbsp;&nbsp;<span>' . apply_filters('redux-import-warning', __('WARNING! This will overwrite all existing option values, please proceed with caution!', 'redux-framework')) . '</span></p>';
         echo '<div class="hr"/><div class="inner"><span>&nbsp;</span></div></div>';
         echo '<h4>' . __('Export Options', 'redux-framework') . '</h4>';
         echo '<div class="redux-section-desc">';
         echo '<p class="description">' . apply_filters('redux-backup-description', __('Here you can copy/download your current option settings. Keep this safe as you can use it as a backup should anything go wrong, or you can use it to restore your settings on this site (or any other site).', 'redux-framework')) . '</p>';
         echo '</div>';
         /** @noinspection PhpUndefinedConstantInspection */
         echo '<p><a href="javascript:void(0);" id="redux-export-code-copy" class="button-secondary">' . __('Copy', 'redux-framework') . '</a> <a href="' . add_query_arg(array('feed' => 'reduxopts-' . $this->args['opt_name'], 'action' => 'download_options', 'secret' => md5(AUTH_KEY . SECURE_AUTH_KEY)), site_url()) . '" id="redux-export-code-dl" class="button-primary">' . __('Download', 'redux-framework') . '</a> <a href="javascript:void(0);" id="redux-export-link" class="button-secondary">' . __('Copy Link', 'redux-framework') . '</a></p>';
         $backup_options = $this->options;
         $backup_options['redux-backup'] = '1';
         echo '<textarea class="large-text noUpdate" id="redux-export-code" rows="8">';
         print_r(json_encode($backup_options));
         echo '</textarea>';
         /** @noinspection PhpUndefinedConstantInspection */
         echo '<input type="text" class="large-text noUpdate" id="redux-export-link-value" value="' . add_query_arg(array('feed' => 'reduxopts-' . $this->args['opt_name'], 'secret' => md5(AUTH_KEY . SECURE_AUTH_KEY)), site_url()) . '" />';
         echo '</div>';
     }
     if (is_array($this->extra_tabs)) {
         foreach ($this->extra_tabs as $k => $tab) {
             echo '<div id="' . $k . '_section_group' . '" class="redux-group-tab">';
             echo '<h3>' . $tab['title'] . '</h3>';
             echo $tab['content'];
             echo '</div>';
         }
     }
     if ($this->args['dev_mode'] === true) {
         echo '<div id="dev_mode_default_section_group' . '" class="redux-group-tab">';
         echo '<h3>' . __('Options Object', 'redux-framework') . '</h3>';
         echo '<div class="redux-section-desc">';
         echo '<div id="redux-object-browser"></div>';
         echo '</div>';
         echo '<div id="redux-object-json" class="hide">' . json_encode($this, true) . '</div>';
         echo '<a href="#" id="consolePrintObject" class="button">' . __('Show Object in Javascript Console Object', 'redux-framework') . '</a>';
         // END Javascript object debug
         echo '</div>';
     }
     if ($this->args['system_info'] === true) {
         require_once 'inc/sysinfo.php';
         $system_info = new Simple_System_Info();
         echo '<div id="system_info_default_section_group' . '" class="redux-group-tab">';
         echo '<h3>' . __('System Info', 'redux-framework') . '</h3>';
         echo '<div id="redux-system-info">';
         echo $system_info->get(true);
         echo '</div>';
         echo '</div>';
     }
     do_action('redux-page-after-sections-' . $this->args['opt_name'], $this);
     echo '<div class="clear"></div>';
     echo '</div>';
     echo '<div class="clear"></div>';
     echo '<div id="redux-sticky-padder" style="display: none;">&nbsp;</div>';
     echo '<div id="redux-footer-sticky"><div id="redux-footer">';
     if (isset($this->args['share_icons'])) {
         echo '<div id="redux-share">';
         foreach ($this->args['share_icons'] as $link) {
             echo '<a href="' . $link['link'] . '" title="' . $link['title'] . '" target="_blank"><img src="' . $link['img'] . '"/></a>';
         }
         echo '</div>';
     }
     echo '<div class="redux-action_bar">';
     echo '<a href="http://www.thinkupthemes.com/themes/minamaze/" target="_blank" class="promotion-button">Upgrade Now</a>';
     submit_button('', 'primary', 'redux_save', false);
     echo '&nbsp;';
     submit_button(__('Reset to Defaults', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults]', false);
     echo '</div>';
     echo '<div class="redux-ajax-loading" alt="' . __('Working...', 'redux-framework') . '">&nbsp;</div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     echo '</form>';
     echo '</div></div>';
     echo isset($this->args['footer_text']) ? '<div id="redux-sub-footer">' . $this->args['footer_text'] . '</div>' : '';
     do_action('redux-page-after-form-' . $this->args['opt_name']);
     echo '<div class="clear"></div>';
     echo '</div><!--wrap-->';
     if ($this->args['dev_mode'] === true) {
         echo '<br /><div class="redux-timer">' . get_num_queries() . ' queries in ' . timer_stop(0) . ' seconds</div>';
         if (defined('SAVEQUERIES') && SAVEQUERIES) {
             global $wpdb;
             echo '<!--\\n';
             print_r($wpdb->queries);
             echo '\\n--!>';
         }
     }
 }
Beispiel #6
0
 /**
  * HTML OUTPUT.
  *
  * @since       1.0.0
  * @access      public
  * @return      void
  */
 public function _options_page_html()
 {
     $saved = get_transient("redux-saved-{$this->args['opt_name']}");
     if ($saved) {
         delete_transient("redux-saved-{$this->args['opt_name']}");
     }
     echo '<div class="wrap"><h2></h2></div>';
     // Stupid hack for Wordpress alerts and warnings
     echo '<div class="clear"></div>';
     echo '<div class="wrap">';
     // Do we support JS?
     echo '<noscript><div class="no-js">' . __('Warning- This options panel will not work properly without javascript!', 'redux-framework') . '</div></noscript>';
     // Security is vital!
     echo '<input type="hidden" id="ajaxsecurity" name="security" value="' . wp_create_nonce('of_ajax_nonce') . '" />';
     /**
      * action 'redux-page-before-form-{opt_name}'
      * @deprecated
      */
     do_action("redux-page-before-form-{$this->args['opt_name']}");
     // Remove
     /**
      * action 'redux/page/{opt_name}/form/before'
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/form/before", $this);
     // Main container
     echo '<div class="redux-container">';
     echo '<form method="post" action="' . './options.php" enctype="multipart/form-data" id="redux-form-wrapper">';
     echo '<input type="hidden" id="redux-compiler-hook" name="' . $this->args['opt_name'] . '[compiler]" value="" />';
     echo '<input type="hidden" id="currentSection" name="' . $this->args['opt_name'] . '[redux-section]" value="" />';
     settings_fields("{$this->args['opt_name']}_group");
     // Last tab?
     if (empty($this->options['last_tab'])) {
         $this->options['last_tab'] = '';
     }
     $this->options['last_tab'] = isset($_GET['tab']) && !$saved ? $_GET['tab'] : $this->options['last_tab'];
     echo '<input type="hidden" id="last_tab" name="' . $this->args['opt_name'] . '[last_tab]" value="' . $this->options['last_tab'] . '" />';
     // Header area
     echo '<div id="redux-header">';
     if (!empty($this->args['display_name'])) {
         echo '<div class="display_header">';
         echo '<h2>' . $this->args['display_name'] . '</h2>';
         if (!empty($this->args['display_version'])) {
             echo '<span>' . $this->args['display_version'] . '</span>';
         }
         echo '</div>';
     }
     // Page icon
     // DOVY!
     echo '<div id="' . $this->args['page_icon'] . '" class="icon32"></div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     // Intro text
     if (isset($this->args['intro_text'])) {
         echo '<div id="redux-intro-text">';
         echo $this->args['intro_text'];
         echo '</div>';
     }
     // Stickybar
     echo '<div id="redux-sticky">';
     echo '<div id="info_bar">';
     echo '<a href="javascript:void(0);" class="expand_options">' . __('Expand', 'redux-framework') . '</a>';
     echo '<div class="redux-action_bar">';
     submit_button(__('Save Changes', 'redux-framework'), 'primary', 'redux_save', false);
     echo '&nbsp;';
     submit_button(__('Reset Section', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults-section]', false);
     echo '&nbsp;';
     submit_button(__('Reset All', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults]', false);
     echo '</div>';
     echo '<div class="redux-ajax-loading" alt="' . __('Working...', 'redux-framework') . '">&nbsp;</div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     // Warning bar
     if (isset($_GET['settings-updated']) && $_GET['settings-updated'] == 'true' && $saved == '1') {
         if (isset($this->options['REDUX_imported']) && $this->options['REDUX_imported'] === 1) {
             /**
              * filter 'redux-imported-text-{opt_name}'
              * @param string  translated "settings imported" text
              */
             echo '<div id="redux-imported"><strong>' . apply_filters("redux-imported-text-{$this->args['opt_name']}", __('Settings Imported!', 'redux-framework')) . '</strong></div>';
         } else {
             /**
              * filter 'redux-saved-text-{opt_name}'
              * @param string translated "settings saved" text
              */
             echo '<div id="redux-save"><strong>' . apply_filters("redux-saved-text-{$this->args['opt_name']}", __('Settings Saved!', 'redux-framework')) . '</strong></div>';
         }
     }
     /**
      * filter 'redux-changed-text-{opt_name}'
      * @param string translated "settings have changed" text
      */
     echo '<div id="redux-save-warn"><strong>' . apply_filters("redux-changed-text-{$this->args['opt_name']}", __('Settings have changed, you should save them!', 'redux-framework')) . '</strong></div>';
     echo '<div id="redux-field-errors"><strong><span></span> ' . __('error(s) were found!', 'redux-framework') . '</strong></div>';
     echo '<div id="redux-field-warnings"><strong><span></span> ' . __('warning(s) were found!', 'redux-framework') . '</strong></div>';
     echo '</div>';
     echo '<div class="clear"></div>';
     // Sidebar
     echo '<div class="redux-sidebar">';
     echo '<ul class="redux-group-menu">';
     foreach ($this->sections as $k => $section) {
         echo $this->section_menu($k, $section);
     }
     echo '<li class="divide">&nbsp;</li>';
     /**
      * action 'redux-page-after-sections-menu-{opt_name}'
      * @param object $this ReduxFramework
      */
     do_action("redux-page-after-sections-menu-{$this->args['opt_name']}", $this);
     /**
      * action 'redux/page/{opt_name}/menu/after'
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/menu/after", $this);
     // Import / Export tab
     if (true == $this->args['show_import_export'] && false == $this->import_export->is_field) {
         $this->import_export->render_tab();
     }
     // Debug tab
     if ($this->args['dev_mode'] === true) {
         $this->debug->render_tab();
     }
     if ($this->args['system_info'] === true) {
         echo '<li id="system_info_default_section_group_li" class="redux-group-tab-link-li">';
         if (!empty($this->args['icon_type']) && $this->args['icon_type'] == 'image') {
             $icon = !isset($this->args['system_info_icon']) ? '' : '<img src="' . $this->args['system_info_icon'] . '" /> ';
         } else {
             $icon_class = !isset($this->args['system_info_icon_class']) ? '' : ' ' . $this->args['system_info_icon_class'];
             $icon = !isset($this->args['system_info_icon']) ? '<i class="el-icon-info-sign' . $icon_class . '"></i>' : '<i class="icon-' . $this->args['system_info_icon'] . $icon_class . '"></i> ';
         }
         echo '<a href="javascript:void(0);" id="system_info_default_section_group_li_a" class="redux-group-tab-link-a custom-tab" data-rel="system_info_default">' . $icon . ' <span class="group_title">' . __('System Info', 'redux-framework') . '</span></a>';
         echo '</li>';
     }
     echo '</ul>';
     echo '</div>';
     echo '<div class="redux-main">';
     foreach ($this->sections as $k => $section) {
         echo '<div id="' . $k . '_section_group' . '" class="redux-group-tab">';
         //echo '<div id="' . $k . '_nav-bar' . '"';
         if (!empty($section['tab'])) {
             echo '<div id="' . $k . '_section_tabs' . '" class="redux-section-tabs">';
             echo '<ul>';
             foreach ($section['tab'] as $subkey => $subsection) {
                 //echo '-=' . $subkey . '=-';
                 echo '<li style="display:inline;"><a href="#' . $k . '_section-tab-' . $subkey . '">' . $subsection['title'] . '</a></li>';
             }
             echo '</ul>';
             foreach ($section['tab'] as $subkey => $subsection) {
                 echo '<div id="' . $k . 'sub-' . $subkey . '_section_group' . '" class="redux-group-tab" style="display:block;">';
                 echo '<div id="' . $k . '_section-tab-' . $subkey . '">';
                 echo "hello " . $subkey;
                 do_settings_sections($this->args['opt_name'] . $k . '_tab_' . $subkey . '_section_group');
                 echo "</div>";
                 echo "</div>";
             }
             echo "</div>";
         } else {
             do_settings_sections($this->args['opt_name'] . $k . '_section_group');
         }
         echo "</div>";
         //echo '</div>';
     }
     // Import / Export output
     if (true == $this->args['show_import_export'] && false == $this->import_export->is_field) {
         $this->import_export->enqueue();
         $this->import_export->render();
     }
     // Debug object output
     if ($this->args['dev_mode'] === true) {
         $this->debug->render();
     }
     if ($this->args['system_info'] === true) {
         require_once 'inc/sysinfo.php';
         $system_info = new Simple_System_Info();
         echo '<div id="system_info_default_section_group' . '" class="redux-group-tab">';
         echo '<h3>' . __('System Info', 'redux-framework') . '</h3>';
         echo '<div id="redux-system-info">';
         echo $system_info->get(true);
         echo '</div>';
         echo '</div>';
     }
     /**
      * action 'redux/page-after-sections-{opt_name}'
      * @deprecated
      * @param object $this ReduxFramework
      */
     do_action("redux/page-after-sections-{$this->args['opt_name']}", $this);
     // REMOVE LATER
     /**
      * action 'redux/page/{opt_name}/sections/after'
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/sections/after", $this);
     echo '<div class="clear"></div>';
     echo '</div>';
     echo '<div class="clear"></div>';
     echo '<div id="redux-sticky-padder" style="display: none;">&nbsp;</div>';
     echo '<div id="redux-footer-sticky"><div id="redux-footer">';
     if (isset($this->args['share_icons'])) {
         echo '<div id="redux-share">';
         foreach ($this->args['share_icons'] as $link) {
             // SHIM, use URL now
             if (isset($link['link']) && !empty($link['link'])) {
                 $link['url'] = $link['link'];
                 unset($link['link']);
             }
             echo '<a href="' . $link['url'] . '" title="' . $link['title'] . '" target="_blank">';
             if (isset($link['icon']) && !empty($link['icon'])) {
                 echo '<i class="' . $link['icon'] . '"></i>';
             } else {
                 echo '<img src="' . $link['img'] . '"/>';
             }
             echo '</a>';
         }
         echo '</div>';
     }
     echo '<div class="redux-action_bar">';
     submit_button(__('Save Changes', 'redux-framework'), 'primary', 'redux_save', false);
     echo '&nbsp;';
     submit_button(__('Reset Section', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults-section]', false);
     echo '&nbsp;';
     submit_button(__('Reset All', 'redux-framework'), 'secondary', $this->args['opt_name'] . '[defaults]', false);
     echo '</div>';
     echo '<div class="redux-ajax-loading" alt="' . __('Working...', 'redux-framework') . '">&nbsp;</div>';
     echo '<div class="clear"></div>';
     echo '</div>';
     echo '</form>';
     echo '</div></div>';
     echo isset($this->args['footer_text']) ? '<div id="redux-sub-footer">' . $this->args['footer_text'] . '</div>' : '';
     /**
      * action 'redux-page-after-form-{opt_name}'
      * @deprecated
      */
     do_action("redux-page-after-form-{$this->args['opt_name']}");
     // REMOVE
     /**
      * action 'redux/page/{opt_name}/form/after'
      * @param object $this ReduxFramework
      */
     do_action("redux/page/{$this->args['opt_name']}/form/after", $this);
     echo '<div class="clear"></div>';
     echo '</div><!--wrap-->';
     if ($this->args['dev_mode'] === true) {
         if (current_user_can('administrator')) {
             global $wpdb;
             echo "<br /><pre>";
             print_r($wpdb->queries);
             echo "</pre>";
         }
         echo '<br /><div class="redux-timer">' . get_num_queries() . ' queries in ' . timer_stop(0) . ' seconds<br/>Redux is currently set to developer mode.</div>';
     }
 }
// Import / Export output
if (true == $this->parent->args['show_import_export'] && false == $this->parent->import_export->is_field) {
    $this->parent->import_export->enqueue();
    echo '<fieldset id="' . $this->parent->args['opt_name'] . '-import_export_core" class="redux-field-container redux-field redux-field-init redux-container-import_export" data-id="import_export_core" data-type="import_export">';
    $this->parent->import_export->render();
    echo '</fieldset>';
}
// Debug object output
if ($this->parent->args['dev_mode'] == true) {
    $this->parent->debug->render();
}
?>
			<?php 
if ($this->parent->args['system_info'] === true) {
    require_once 'inc/sysinfo.php';
    $system_info = new Simple_System_Info();
    ?>
				<div id="system_info_default_section_group" class="redux-group-tab">
					<h3><?php 
    _e('System Info', 'redux-framework');
    ?>
</h3>

					<div id="redux-system-info">
						<?php 
    echo $system_info->get(true);
    ?>
					</div>

				</div>
			<?php