[ XREF Home ] [ Index ]

PHP Cross Reference of WordPress Trunk

Provided by Yoast

title

Body

[close]

/wp-admin/network/ -> sites.php (source)

   1  <?php
   2  /**
   3   * Multisite sites administration panel.
   4   *
   5   * @package WordPress
   6   * @subpackage Multisite
   7   * @since 3.0.0
   8   */
   9  
  10  /** Load WordPress Administration Bootstrap */
  11  require_once ( './admin.php' );
  12  
  13  if ( ! is_multisite() )
  14      wp_die( __( 'Multisite support is not enabled.' ) );
  15  
  16  if ( ! current_user_can( 'manage_sites' ) )
  17      wp_die( __( 'You do not have permission to access this page.' ) );
  18  
  19  $wp_list_table = _get_list_table('WP_MS_Sites_List_Table');
  20  $pagenum = $wp_list_table->get_pagenum();
  21  
  22  $title = __( 'Sites' );
  23  $parent_file = 'sites.php';
  24  
  25  add_screen_option( 'per_page', array('label' => _x( 'Sites', 'sites per page (screen options)' )) );
  26  
  27  add_contextual_help($current_screen,
  28      '<p>' . __('Add New takes you to the Add New Site screen. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.') . '</p>' .
  29      '<p>' . __('This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.') . '</p>' .
  30      '<p>' . __('Hovering over each site reveals seven options (three for the primary site):') . '</p>' .
  31      '<ul><li>' . __('An Edit link to a separate Edit Site screen.') . '</li>' .
  32      '<li>' . __('Dashboard leads to the Dashboard for that site.') . '</li>' .
  33      '<li>' . __('Deactivate, Archive, and Spam which lead to confirmation screens. These actions can be reversed later.') . '</li>' .
  34      '<li>' . __('Delete which is a permanent action after the confirmation screens.') . '</li>' .
  35      '<li>' . __('Visit to go to the frontend site live.') . '</li></ul>' .
  36      '<p>' . __('The site ID is used internally, and is not shown on the front end of the site or to users/viewers.') . '</p>' .
  37      '<p>' . __('Clicking on bold settings can re-sort this table. The upper right icons switch between list and excerpt views.') . '</p>' .
  38      '<p><strong>' . __('For more information:') . '</strong></p>' .
  39      '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Sites_Screens" target="_blank">Documentation on Site Management</a>') . '</p>' .
  40      '<p>' . __('<a href="http://wordpress.org/support/forum/multisite/" target="_blank">Support Forums</a>') . '</p>'
  41  );
  42  
  43  $id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
  44  
  45  $msg = '';
  46  if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( $_REQUEST['action'] ) ) {
  47      switch ( $_REQUEST['action'] ) {
  48          case 'all_notspam':
  49              $msg = __( 'Sites removed from spam.' );
  50          break;
  51          case 'all_spam':
  52              $msg = __( 'Sites marked as spam.' );
  53          break;
  54          case 'all_delete':
  55              $msg = __( 'Sites deleted.' );
  56          break;
  57          case 'delete':
  58              $msg = __( 'Site deleted.' );
  59          break;
  60          case 'not_deleted':
  61              $msg = __( 'You do not have permission to delete that site.' );
  62          break;
  63          case 'archive':
  64              $msg = __( 'Site archived.' );
  65          break;
  66          case 'unarchive':
  67              $msg = __( 'Site unarchived.' );
  68          break;
  69          case 'activate':
  70              $msg = __( 'Site activated.' );
  71          break;
  72          case 'deactivate':
  73              $msg = __( 'Site deactivated.' );
  74          break;
  75          case 'unspam':
  76              $msg = __( 'Site removed from spam.' );
  77          break;
  78          case 'spam':
  79              $msg = __( 'Site marked as spam.' );
  80          break;
  81          default:
  82              $msg = apply_filters( 'network_sites_updated_message_' . $_REQUEST['action'] , __( 'Settings saved.' ) );
  83          break;
  84      }
  85      if ( $msg )
  86          $msg = '<div class="updated" id="message"><p>' . $msg . '</p></div>';
  87  }
  88  
  89  $wp_list_table->prepare_items();
  90  
  91  require_once ( '../admin-header.php' );
  92  ?>
  93  
  94  <div class="wrap">
  95  <?php screen_icon('ms-admin'); ?>
  96  <h2><?php _e('Sites') ?>
  97  <?php echo $msg; ?>
  98  <?php if ( current_user_can( 'create_sites') ) : ?>
  99          <a href="<?php echo network_admin_url('site-new.php'); ?>" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>
 100  <?php endif; ?>
 101  
 102  <?php if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) {
 103      printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );
 104  } ?>
 105  </h2>
 106  
 107  <form action="" method="get" id="ms-search">
 108  <?php $wp_list_table->search_box( __( 'Search Sites' ), 'site' ); ?>
 109  <input type="hidden" name="action" value="blogs" />
 110  </form>
 111  
 112  <form id="form-site-list" action="edit.php?action=allblogs" method="post">
 113      <?php $wp_list_table->display(); ?>
 114  </form>
 115  </div>
 116  <?php
 117  
 118  require_once ( '../admin-footer.php' ); ?>


Generated: Wed Jun 1 08:30:02 2011 Cross-referenced by PHPXref 0.7
Provided by Yoast and awesome WordPress Hosting