/**
  * Handles the displaying of all sites on the network that are
  * dis/connected to Jetpack
  *
  * @since 2.9
  * @see   Jetpack_Network::jetpack_sites_list()
  */
 function network_admin_page()
 {
     global $current_site;
     $this->network_admin_page_header();
     $jp = Jetpack::init();
     // We should be, but ensure we are on the main blog
     switch_to_blog($current_site->blog_id);
     $main_active = $jp->is_active();
     restore_current_blog();
     // If we are in dev mode, just show the notice and bail
     if (Jetpack::is_development_mode()) {
         Jetpack::show_development_mode_notice();
         return;
     }
     /*
      * Ensure the main blog is connected as all other subsite blog
      * connections will feed off this one
      */
     if (!$main_active) {
         $url = $this->get_url(array('name' => 'subsiteregister', 'site_id' => 1));
         $data = array('url' => $jp->build_connect_url());
         Jetpack::init()->load_view('admin/must-connect-main-blog.php', $data);
         return;
     }
     require_once 'class.jetpack-network-sites-list-table.php';
     $myListTable = new Jetpack_Network_Sites_List_Table();
     echo '<div class="wrap"><h2>' . __('Sites', 'jetpack') . '</h2>';
     echo '<form method="post">';
     $myListTable->prepare_items();
     $myListTable->display();
     echo '</form></div>';
     $this->network_admin_page_footer();
 }
 /**
  * Handles the displaying of all sites on the network that are
  * dis/connected to Jetpack
  *
  * @since 2.9
  * @see Jetpack_Network::jetpack_sites_list()
  */
 function network_admin_page()
 {
     $this->network_admin_page_header();
     $jp = Jetpack::init();
     // We should be, but ensure we are on the main blog
     switch_to_blog(1);
     $main_active = $jp->is_active();
     restore_current_blog();
     /*
      * Ensure the main blog is connected as all other subsite blog 
      * connections will feed off this one
      */
     if (!$main_active) {
         $url = $this->get_url(array('name' => 'subsiteregister', 'site_id' => 1));
         $url = $jp->build_connect_url();
         require_once 'views/admin/must-connect-main-blog.php';
         return;
     }
     require_once 'class.jetpack-network-sites-list-table.php';
     $myListTable = new Jetpack_Network_Sites_List_Table();
     echo '<div class="wrap"><h2>' . __('Sites', 'jetpack') . '</h2>';
     echo '<form method="post">';
     $myListTable->prepare_items();
     $myListTable->display();
     echo '</form></div>';
     $this->network_admin_page_footer();
 }