Ejemplo n.º 1
0
function get_wds_options()
{
    if (is_multisite() && WDS_SITEWIDE == true) {
        return array_merge((array) get_site_option('wds_settings_options'), (array) get_site_option('wds_autolinks_options'), (array) get_site_option('wds_onpage_options'), (array) get_site_option('wds_sitemap_options'), (array) get_site_option('wds_seomoz_options'));
    } else {
        if (is_multisite() && !WDS_SITEWIDE) {
            $settings = (array) (wds_is_allowed_tab('wds_settings') ? get_option('wds_settings_options') : get_site_option('wds_settings_options'));
            $autolinks = (array) (wds_is_allowed_tab('wds_autolinks') ? get_option('wds_autolinks_options') : get_site_option('wds_autolinks_options'));
            $onpage = (array) (wds_is_allowed_tab('wds_onpage') ? get_option('wds_onpage_options') : get_site_option('wds_onpage_options'));
            $sitemap = (array) (wds_is_allowed_tab('wds_sitemap') ? get_option('wds_sitemap_options') : get_site_option('wds_sitemap_options'));
            $seomoz = (array) (wds_is_allowed_tab('wds_seomoz') ? get_option('wds_seomoz_options') : get_site_option('wds_seomoz_options'));
            return array_merge($settings, $autolinks, $onpage, $sitemap, $seomoz);
        } else {
            return array_merge((array) get_option('wds_settings_options'), (array) get_option('wds_autolinks_options'), (array) get_option('wds_onpage_options'), (array) get_option('wds_sitemap_options'), (array) get_option('wds_seomoz_options'));
        }
    }
}
 function options_page()
 {
     global $wds_options;
     $slug = $this->slug;
     $title = $this->title;
     $description = $this->description;
     $options_name = $this->options_name;
     $msg = '';
     if (isset($_GET['updated']) && $_GET['updated'] == 'true') {
         $msg = __('Settings updated', 'wds');
         if (function_exists('w3tc_pgcache_flush')) {
             w3tc_pgcache_flush();
             $msg .= __(' & W3 Total Cache Page Cache flushed', 'wds');
         } else {
             if (function_exists('wp_cache_clear_cache')) {
                 wp_cache_clear_cache();
                 $msg .= __(' & WP Super Cache flushed', 'wds');
             }
         }
         $msg = '<div id="message" style="width:94%;" class="message updated"><p><strong>' . $msg . '.</strong></p></div>';
     }
     $tabs = '';
     $step_title = array(0, __('Settings', 'wds'), __('Sitemaps', 'wds'), __('Title & Meta', 'wds'), __('Moz', 'wds'), __('Automatic Links', 'wds'));
     $blog_tabs = get_site_option('wds_blog_tabs');
     $blog_tabs = is_array($blog_tabs) ? $blog_tabs : array();
     for ($i = 1; $i <= 5; $i++) {
         $active = wds_is_wizard_step($i) ? ' nav-tab-active' : '';
         $tabs .= "<a href='admin.php?page=wds_wizard&step={$i}' class='wds_tab_item nav-tab{$active}' title='{$step_title[$i]}'>" . sprintf(__('Step %d: %s', 'wds'), $i, $step_title[$i]) . "</a>";
     }
     $action_url = admin_url('options.php');
     echo "<div class='wrap'>{$msg}\r\n\t\t\t<div class='icon32' id='icon-options-general'><br></div>\r\n\t\t\t<h2>" . __('Infinite SEO Wizard', 'wds') . "</h2>\r\n\t\t\t<h3 class='nav-tab-wrapper'>{$tabs}</h3>\r\n\t\t\t<h2>{$title}</h2>";
     if (!wds_is_allowed_tab($slug)) {
         printf(__("Your network admin prevented access to '%s', please move onto next step.", 'wds'), $title);
     } else {
         if ('settings' == $this->name || isset($wds_options[$this->name]) && ($wds_options[$this->name] = 'on')) {
             echo "{$description}\r\n\t\t\t\t<form action='{$action_url}' method='post'>";
             settings_fields($options_name);
             @do_settings_sections($slug);
             if (is_multisite() && WDS_SITEWIDE == true) {
                 $checked_y = in_array($slug, $blog_tabs) ? 'checked="checked"' : '';
                 $checked_n = in_array($slug, $blog_tabs) ? '' : 'checked="checked"';
                 echo '<h3>' . __('Allow Site Admin access', 'wds') . '</h3>';
                 _e('<p>If enabled, this tab will be available to Site Admins once you switch to per-blog mode.</p>', 'wds');
                 echo __('Show this to Site Admins:', 'wds') . "&nbsp;" . "<input type='radio' id='wds_blog_tabs-yes' name='wds_blog_tabs[{$slug}]' value='1' {$checked_y} />" . '<label for="wds_blog_tabs-yes">' . __("Yes", "wds") . '</label>' . "&nbsp;" . "<input type='radio' id='wds_blog_tabs-no' name='wds_blog_tabs[{$slug}]' value='0' {$checked_n} />" . '<label for="wds_blog_tabs-no">' . __("No", "wds") . '</label>';
             }
             echo "<p class='submit'>\r\n\t\t\t\t\t<input name='Submit' type='submit' class='button-primary' value='" . esc_attr(__('Save Settings', 'wds')) . "' />\r\n\t\t\t\t</p>\r\n\t\t\t\t</form>\r\n\t\t\t\t{$this->additional}";
         } else {
             printf(__("You've chosen not to set up '%s', please move onto next step.", 'wds'), $title);
         }
     }
     echo "</div>";
 }