X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/41578db67d72562346e4dbb2a14889b23d522813..f5fcdc7994bb67cce809bc4777944ae8b7fad4a4:/wp-admin/includes/class-wp-ms-users-list-table.php diff --git a/wp-admin/includes/class-wp-ms-users-list-table.php b/wp-admin/includes/class-wp-ms-users-list-table.php index df064068..c70636f6 100644 --- a/wp-admin/includes/class-wp-ms-users-list-table.php +++ b/wp-admin/includes/class-wp-ms-users-list-table.php @@ -9,11 +9,11 @@ */ class WP_MS_Users_List_Table extends WP_List_Table { - function ajax_user_can() { + public function ajax_user_can() { return current_user_can( 'manage_network_users' ); } - function prepare_items() { + public function prepare_items() { global $usersearch, $role, $wpdb, $mode; $usersearch = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST['s'] ) ) : ''; @@ -40,8 +40,11 @@ class WP_MS_Users_List_Table extends WP_List_Table { $args['include'] = $wpdb->get_col( "SELECT ID FROM $wpdb->users WHERE user_login IN ('$logins')" ); } - // If the network is large and a search is not being performed, show only the latest users with no paging in order - // to avoid expensive count queries. + /* + * If the network is large and a search is not being performed, + * show only the latest users with no paging in order to avoid + * expensive count queries. + */ if ( !$usersearch && wp_is_large_network( 'users' ) ) { if ( !isset($_REQUEST['orderby']) ) $_GET['orderby'] = $_REQUEST['orderby'] = 'id'; @@ -69,7 +72,7 @@ class WP_MS_Users_List_Table extends WP_List_Table { ) ); } - function get_bulk_actions() { + protected function get_bulk_actions() { $actions = array(); if ( current_user_can( 'delete_users' ) ) $actions['delete'] = __( 'Delete' ); @@ -79,18 +82,17 @@ class WP_MS_Users_List_Table extends WP_List_Table { return $actions; } - function no_items() { + public function no_items() { _e( 'No users found.' ); } - function get_views() { - global $wp_roles, $role; + protected function get_views() { + global $role; $total_users = get_user_count(); $super_admins = get_super_admins(); $total_admins = count( $super_admins ); - $current_role = false; $class = $role != 'super' ? ' class="current"' : ''; $role_links = array(); $role_links['all'] = "" . sprintf( _nx( 'All (%s)', 'All (%s)', $total_users, 'users' ), number_format_i18n( $total_users ) ) . ''; @@ -100,7 +102,11 @@ class WP_MS_Users_List_Table extends WP_List_Table { return $role_links; } - function pagination( $which ) { + /** + * @global string $mode + * @param string $which + */ + protected function pagination( $which ) { global $mode; parent::pagination ( $which ); @@ -109,7 +115,7 @@ class WP_MS_Users_List_Table extends WP_List_Table { $this->view_switcher( $mode ); } - function get_columns() { + public function get_columns() { $users_columns = array( 'cb' => '', 'username' => __( 'Username' ), @@ -131,7 +137,7 @@ class WP_MS_Users_List_Table extends WP_List_Table { return $users_columns; } - function get_sortable_columns() { + protected function get_sortable_columns() { return array( 'username' => 'login', 'name' => 'name', @@ -140,23 +146,22 @@ class WP_MS_Users_List_Table extends WP_List_Table { ); } - function display_rows() { + public function display_rows() { global $mode; - $alt = ''; $super_admins = get_super_admins(); foreach ( $this->items as $user ) { - $alt = ( 'alternate' == $alt ) ? '' : 'alternate'; + $class = ''; $status_list = array( 'spam' => 'site-spammed', 'deleted' => 'site-deleted' ); foreach ( $status_list as $status => $col ) { if ( $user->$status ) - $alt .= " $col"; + $class .= " $col"; } ?> - + get_column_info(); @@ -219,14 +224,14 @@ class WP_MS_Users_List_Table extends WP_List_Table { break; case 'email': - echo "$user->user_email"; + echo "$user->user_email"; break; case 'registered': if ( 'list' == $mode ) - $date = 'Y/m/d'; + $date = __( 'Y/m/d' ); else - $date = 'Y/m/d \<\b\r \/\> g:i:s a'; + $date = __( 'Y/m/d g:i:s a' ); echo "" . mysql2date( $date, $user->user_registered ) . ""; break;