check_permissions(); $title = __( 'Sites' ); $parent_file = 'sites.php'; add_screen_option( 'per_page', array('label' => _x( 'Sites', 'sites per page (screen options)' )) ); if ( isset( $_REQUEST['action'] ) && 'editblog' == $_REQUEST['action'] ) { add_contextual_help($current_screen, '

' . __('This extensive list of options has five modules: Site Info, Site Options, allowing Site Themes for this given site, changing user roles and passwords for that site, adding a new user, and Miscellaneous Site Actions (upload size limits).') . '

' . '

' . __('Note that some fields in Site Options are grayed out and say Serialized Data. These are stored values in the database which you cannot change from here.') . '

' . '

' . __('For more information:') . '

' . '

' . __('Documentation on Editing Sites') . '

' . '

' . __('Support Forums') . '

' ); } else { add_contextual_help($current_screen, '

' . __('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.') . '

' . '

' . __('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.') . '

' . '

' . __('Hovering over each site reveals seven options (three for the primary site):') . '

' . '' . '

' . __('The site ID is used internally, and is not shown on the front end of the site or to users/viewers.') . '

' . '

' . __('Clicking on bold settings can re-sort this table. The upper right icons switch between list and excerpt views.') . '

' . '

' . __('If the admin email for the new site does not exist in the database, a new user will also be created.') . '

' . '

' . __('For more information:') . '

' . '

' . __('Documentation on Sites') . '

' . '

' . __('Support Forums') . '

' ); } $id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; $msg = ''; if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( $_REQUEST['action'] ) ) { switch ( $_REQUEST['action'] ) { case 'all_notspam': $msg = __( 'Sites removed from spam.' ); break; case 'all_spam': $msg = __( 'Sites marked as spam.' ); break; case 'all_delete': $msg = __( 'Sites deleted.' ); break; case 'delete': $msg = __( 'Site deleted.' ); break; case 'archive': $msg = __( 'Site archived.' ); break; case 'unarchive': $msg = __( 'Site unarchived.' ); break; case 'activate': $msg = __( 'Site activated.' ); break; case 'deactivate': $msg = __( 'Site deactivated.' ); break; case 'unspam': $msg = __( 'Site removed from spam.' ); break; case 'spam': $msg = __( 'Site marked as spam.' ); break; default: $msg = __( 'Settings saved.' ); break; } if ( $msg ) $msg = '

' . $msg . '

'; } $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'list'; switch ( $action ) { // Edit site case 'editblog': $blog_prefix = $wpdb->get_blog_prefix( $id ); $options = $wpdb->get_results( "SELECT * FROM {$blog_prefix}options WHERE option_name NOT LIKE '\_%' AND option_name NOT LIKE '%user_roles'" ); $details = get_blog_details( $id ); if ( $details->site_id != $wpdb->siteid ) wp_die( __( 'You do not have permission to access this page.' ) ); $editblog_roles = get_blog_option( $id, "{$blog_prefix}user_roles" ); $is_main_site = is_main_site( $id ); require_once( '../admin-header.php' ); ?>

-

__( 'Public' ) ); if ( ! $is_main_site ) { $radio_fields['archived'] = __( 'Archived' ); $radio_fields['spam'] = _x( 'Spam', 'site' ); $radio_fields['deleted'] = __( 'Deleted' ); } $radio_fields['mature'] = __( 'Mature' ); foreach ( $radio_fields as $field_key => $field_label ) { ?>
domain ) ?>
path ) ?>
/> siteurl and home as well.' ); ?>
$field_key, 1 ); ?> /> $field_key, 0 ); ?> />

option_name == 'default_role' ) $editblog_default_role = $option->option_value; $disabled = false; $class = 'all-options'; if ( is_serialized( $option->option_value ) ) { if ( is_serialized_string( $option->option_value ) ) { $option->option_value = esc_html( maybe_unserialize( $option->option_value ), 'single' ); } else { $option->option_value = 'SERIALIZED DATA'; $disabled = true; $class = 'all-options disabled'; } } if ( strpos( $option->option_value, "\n" ) !== false ) { ?> option_name, array( 'siteurl', 'home' ) ) ) { ?>
option_name ) ) ?>
option_name ) ) ); ?> option_value ) ?> />

$theme ) { $theme_key = esc_html( $theme['Stylesheet'] ); if ( ! isset( $allowed_themes[$theme_key] ) ) { $checked = isset( $blog_allowed_themes[ $theme_key ] ) ? 'checked="checked"' : ''; $out .= ' ' . esc_html( $key ) . ' '; } } if ( $out != '' ) { ?>

$id, 'number' => 20 ) ); if ( is_array( $blogusers ) ) { echo '

' . __( 'Site Users' ) . '

'; echo ''; echo ""; $user_count = 0; foreach ( $blogusers as $user_id => $user_object ) { $user_count++; $existing_role = reset( $user_object->roles ); echo ''; if ( $user_id != $current_user->data->ID ) { ?> '; } else { echo ""; } echo ''; } echo "
" . __( 'User' ) . "" . __( 'Role' ) . "" . __( 'Password' ) . "" . __( 'Remove' ) . "
' . $user_object->user_login . ' " . __ ( 'N/A' ) . "" . __ ( 'N/A' ) . "" . __( 'N/A' ) . "
"; echo '

'; if ( 20 == $user_count ) echo '

' . sprintf( __('First 20 users shown. Manage all users.'), get_admin_url($id, 'users.php') ) . '

'; echo "
"; } ?>

prepare_items(); require_once( '../admin-header.php' ); ?>

' . __( 'Search results for “%s”' ) . '', esc_html( $s ) ); } ?>

display(); ?>