/**
  * @param WPSEO_Option_Tabs $option_tabs Option Tabs to get tabs from.
  * @param Yoast_Form        $yform       Yoast Form which is being used in the views.
  * @param array             $options     Options which are being used in the views.
  */
 public function run(WPSEO_Option_Tabs $option_tabs, Yoast_Form $yform, $options = array())
 {
     echo '<h2 class="nav-tab-wrapper" id="wpseo-tabs">';
     foreach ($option_tabs->get_tabs() as $tab) {
         printf('<a class="nav-tab" id="%1$s-tab" href="#top#%1$s">%2$s</a>', $tab->get_name(), $tab->get_label());
     }
     echo '</h2>';
     $filter_name = sprintf('yoast_option_tab_help_center_%s', $option_tabs->get_base());
     $base_help_center_items = apply_filters($filter_name, array());
     foreach ($option_tabs->get_tabs() as $tab) {
         $identifier = $tab->get_name();
         printf('<div id="%s" class="wpseotab">', $identifier);
         $filter_name = sprintf('yoast_option_tab_help_center_%s_%s', $option_tabs->get_base(), $tab->get_name());
         $help_center_items = apply_filters($filter_name, $base_help_center_items);
         if (!empty($help_center_items)) {
             $this->create_help_center($option_tabs->get_base(), $tab->get_name(), $help_center_items);
         } else {
             $video = $tab->get_video_url();
             if (!empty($video)) {
                 $tab_video_url = $video;
                 include WPSEO_PATH . 'admin/views/partial-settings-tab-video.php';
             }
         }
         $tab_view = $this->get_tab_view($option_tabs, $tab);
         if (is_file($tab_view)) {
             require_once $tab_view;
         }
         echo '</div>';
     }
 }
 /**
  * @param WPSEO_Option_Tabs $option_tabs Option Tabs to get tabs from.
  * @param Yoast_Form        $yform       Yoast Form which is being used in the views.
  * @param array             $options     Options which are being used in the views.
  */
 public function run(WPSEO_Option_Tabs $option_tabs, Yoast_Form $yform, $options = array())
 {
     echo '<h2 class="nav-tab-wrapper" id="wpseo-tabs">';
     foreach ($option_tabs->get_tabs() as $tab) {
         printf('<a class="nav-tab" id="%1$s-tab" href="#top#%1$s">%2$s</a>', $tab->get_name(), $tab->get_label());
     }
     echo '</h2>';
     foreach ($option_tabs->get_tabs() as $tab) {
         // Prepare the help center for each tab.
         $help_center = new WPSEO_Help_Center($option_tabs->get_base(), $tab);
         $identifier = $tab->get_name();
         printf('<div id="%s" class="wpseotab">', $identifier);
         // Output the help center.
         $help_center->output_help_center();
         // Output the settings view for all tabs.
         $tab_view = $this->get_tab_view($option_tabs, $tab);
         if (is_file($tab_view)) {
             require_once $tab_view;
         }
         echo '</div>';
     }
 }
Example #3
0
<?php

/**
 * @package WPSEO\Admin
 */
if (!defined('WPSEO_VERSION')) {
    header('Status: 403 Forbidden');
    header('HTTP/1.1 403 Forbidden');
    exit;
}
$active_tab = filter_input(INPUT_GET, 'tab');
$tabs = new WPSEO_Option_Tabs('advanced', 'breadcrumbs');
$tabs->add_tab(new WPSEO_Option_Tab('breadcrumbs', __('Breadcrumbs', 'wordpress-seo'), array('video_url' => 'https://yoa.st/screencast-breadcrumbs', 'opt_group' => 'wpseo_internallinks')));
$tabs->add_tab(new WPSEO_Option_Tab('permalinks', __('Permalinks', 'wordpress-seo'), array('video_url' => 'https://yoa.st/screencast-permalinks', 'opt_group' => 'wpseo_permalinks')));
$tabs->add_tab(new WPSEO_Option_Tab('rss', __('RSS', 'wordpress-seo'), array('video_url' => 'https://yoa.st/screencast-rss', 'opt_group' => 'wpseo_rss')));
$active_tab = $tabs->get_active_tab();
Yoast_Form::get_instance()->admin_header(true, $active_tab->get_opt_group());
echo '<h2 class="nav-tab-wrapper">';
foreach ($tabs->get_tabs() as $tab) {
    $active = $tabs->is_active_tab($tab) ? ' nav-tab-active' : '';
    echo '<a class="nav-tab' . $active . '" id="' . $tab->get_name() . '-tab" href="' . admin_url('admin.php?page=wpseo_advanced&tab=' . $tab->get_name()) . '">' . $tab->get_label() . '</a>';
}
echo '</h2>';
echo '<br/>';
require_once WPSEO_PATH . 'admin/views/tabs/advanced/' . $active_tab->get_name() . '.php';
Yoast_Form::get_instance()->admin_footer();