Make WordPress Core


Ignore:
Timestamp:
04/01/2010 09:21:27 PM (16 years ago)
Author:
markjaquith
Message:

Huge MS refactoring and code cleanup. see #12460. props ocean90.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/ms-users.php

    r13733 r13918  
    11<?php
    2 require_once('admin.php');
     2require_once( './admin.php' );
    33
    44if ( !is_multisite() )
    5         wp_die( __('Multisite support is not enabled.') );
    6 
    7 $title = __('Users');
     5        wp_die( __( 'Multisite support is not enabled.' ) );
     6
     7$title = __( 'Users' );
    88$parent_file = 'ms-admin.php';
    99
    1010wp_enqueue_script( 'admin-forms' );
    1111
    12 require_once('admin-header.php');
     12require_once( './admin-header.php' );
    1313
    1414if ( ! current_user_can( 'manage_network_users' ) )
    15         wp_die( __('You do not have permission to access this page.') );
    16 
    17 if ( isset($_GET['updated']) && $_GET['updated'] == 'true' ) {
     15        wp_die( __( 'You do not have permission to access this page.' ) );
     16
     17if ( isset( $_GET['updated'] ) && $_GET['updated'] == 'true' && ! empty( $_GET['action'] ) ) {
    1818        ?>
    1919        <div id="message" class="updated fade"><p>
    2020                <?php
    21                 switch ($_GET['action']) {
     21                switch ( $_GET['action'] ) {
    2222                        case 'delete':
    23                                 _e('User deleted !');
     23                                _e( 'User deleted.' );
    2424                        break;
    2525                        case 'all_spam':
    26                                 _e('Users marked as spam !');
     26                                _e( 'Users marked as spam.' );
    2727                        break;
    2828                        case 'all_notspam':
    29                                 _e('Users marked as not spam !');
     29                                _e( 'Users marked as not spam.' );
    3030                        break;
    3131                        case 'all_delete':
    32                                 _e('Users deleted !');
     32                                _e( 'Users deleted.' );
    3333                        break;
    3434                        case 'add':
    35                                 _e('User added !');
     35                                _e( 'User added.' );
    3636                        break;
    3737                        case 'add_superadmin':
    38                                 _e('Network admin added !');
     38                                _e( 'Network admin added.' );
    3939                        break;
    4040                        case 'remove_superadmin':
    41                                 _e('Network admin removed !');
     41                                _e( 'Network admin removed.' );
    4242                        break;
    4343                }
     
    4646        <?php
    4747}
    48 ?>
    49 
    50 <div class="wrap" style="position:relative;">
    51         <?php
    52         $apage = isset( $_GET['apage'] ) ? intval( $_GET['apage'] ) : 1;
    53         $num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 15;
    54         $s = isset($_GET[ 's' ]) ? esc_attr( trim( $_GET[ 's' ] ) ) : '';
     48
     49        $pagenum = isset( $_GET['paged'] ) ? absint( $_GET['paged'] ) : 0;
     50        if ( empty( $pagenum ) )
     51                $pagenum = 1;
     52
     53        $per_page = (int) get_user_option( 'ms_users_per_page' );
     54        if ( empty( $per_page ) || $per_page < 1 )
     55                $per_page = 15;
     56
     57        $per_page = apply_filters( 'ms_users_per_page', $per_page );
     58
     59        $s = isset( $_GET['s'] ) ? stripslashes( trim( $_GET[ 's' ] ) ) : '';
     60        $like_s = esc_sql( like_escape( $s ) );
    5561
    5662        $query = "SELECT * FROM {$wpdb->users}";
    5763
    58         if ( !empty( $s ) ) {
    59                 $search = '%' . trim( $s ) . '%';
    60                 $query .= " WHERE user_login LIKE '$search' OR user_email LIKE '$search'";
     64        if ( !empty( $like_s ) ) {
     65                $query .= " WHERE user_login LIKE '%$like_s%' OR user_email LIKE '%$like_s%'";
    6166        }
    6267
    6368        $order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
    64 
    6569        if ( $order_by == 'email' ) {
    6670                $query .= ' ORDER BY user_email ';
     
    7680        }
    7781
    78         $order = isset($_GET['order']) ? $_GET['order'] : 'ASC';
    79         $order = ( 'DESC' == $order ) ? 'DESC' : 'ASC';
     82        $order = ( isset( $_GET['order'] ) && 'DESC' == $_GET['order'] ) ? 'DESC' : 'ASC';
    8083        $query .= $order;
    8184
    82         if ( !empty( $s ) )
    83                 $total = $wpdb->get_var( str_replace('SELECT *', 'SELECT COUNT(ID)', $query) );
     85        $total = $wpdb->get_var( str_replace( 'SELECT *', 'SELECT COUNT(ID)', $query ) );
     86
     87        $query .= " LIMIT " . intval( ( $pagenum - 1 ) * $per_page) . ", " . intval( $per_page );
     88
     89        $user_list = $wpdb->get_results( $query, ARRAY_A );
     90
     91        $num_pages = ceil( $total / $per_page );
     92        $page_links = paginate_links( array(
     93                'base' => add_query_arg( 'paged', '%#%' ),
     94                'format' => '',
     95                'prev_text' => __( '&laquo;' ),
     96                'next_text' => __( '&raquo;' ),
     97                'total' => $num_pages,
     98                'current' => $pagenum
     99        ));
     100
     101        if ( empty( $_GET['mode'] ) )
     102                $mode = 'list';
    84103        else
    85                 $total = $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->users}");
    86 
    87         $query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num );
    88 
    89         $user_list = $wpdb->get_results( $query, ARRAY_A );
    90 
    91         // Pagination
    92         $user_navigation = paginate_links( array(
    93                 'total' => ceil($total / $num),
    94                 'current' => $apage,
    95                 'base' => add_query_arg( 'apage', '%#%' ),
    96                 'format' => ''
    97         ));
    98 
    99         if ( $user_navigation ) {
    100                 $user_navigation = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
    101                         number_format_i18n( ( $apage - 1 ) * $num + 1 ),
    102                         number_format_i18n( min( $apage * $num, $total ) ),
    103                         number_format_i18n( $total ),
    104                         $user_navigation
    105                 );
    106         }
     104                $mode = esc_attr( $_GET['mode'] );
    107105
    108106        ?>
    109107        <div class="wrap">
    110108        <?php screen_icon(); ?>
    111         <h2><?php esc_html_e("Users"); ?></h2>
     109        <h2><?php esc_html_e( 'Users' ); ?>
     110        <a href="#form-add-user" class="button add-new-h2"><?php echo esc_html_x( 'Add New' , 'users'); ?></a>
     111        <?php
     112        if ( isset( $_GET['s'] ) && $_GET['s'] )
     113        printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );
     114        ?>
     115        </h2>
     116
    112117        <form action="ms-users.php" method="get" class="search-form">
    113118                <p class="search-box">
    114                 <input type="text" name="s" value="<?php if ( isset($_GET['s']) ) esc_attr( stripslashes( $s ) ); ?>" class="search-input" id="user-search-input" />
    115                 <input type="submit" id="post-query-submit" value="<?php esc_attr_e('Search Users') ?>" class="button" />
     119                <input type="text" name="s" value="<?php echo esc_attr( $s ); ?>" class="search-input" id="user-search-input" />
     120                <input type="submit" id="post-query-submit" value="<?php esc_attr_e( 'Search Users' ) ?>" class="button" />
    116121                </p>
    117122        </form>
    118         </div>
    119123
    120124        <form id="form-user-list" action='ms-edit.php?action=allusers' method='post'>
     125                <input type="hidden" name="mode" value="<?php echo esc_attr( $mode ); ?>" />
    121126                <div class="tablenav">
    122                         <?php if ( $user_navigation ) echo "<div class='tablenav-pages'>$user_navigation</div>"; ?>
    123 
    124127                        <div class="alignleft actions">
    125                                 <input type="submit" value="<?php esc_attr_e('Delete') ?>" name="alluser_delete" class="button-secondary delete" />
    126                                 <input type="submit" value="<?php esc_attr_e('Mark as Spammers') ?>" name="alluser_spam" class="button-secondary" />
    127                                 <input type="submit" value="<?php esc_attr_e('Not Spam') ?>" name="alluser_notspam" class="button-secondary" />
    128                                 <input type="submit" value="<?php esc_attr_e('Add Network Admins') ?>" name="add_superadmin" class="button-secondary" />
    129                                 <input type="submit" value="<?php esc_attr_e('Remove Network Admins') ?>" name="remove_superadmin" class="button-secondary" />
    130                                 <?php wp_nonce_field( 'allusers' ); ?>
    131                                 <br class="clear" />
     128                                <select name="action">
     129                                        <option value="-1" selected="selected"><?php _e( 'Bulk Actions' ); ?></option>
     130                                        <option value="delete"><?php _e( 'Delete' ); ?></option>
     131                                        <option value="spam"><?php _e( 'Mark as Spammers' ); ?></option>
     132                                        <option value="notspam"><?php _e( 'Not Spam' ); ?></option>
     133                                        <option value="superadmin"><?php _e( 'Add Super Admins' ); ?></option>
     134                                        <option value="notsuperadmin"><?php _e( 'Remove Super Admins' ); ?></option>
     135                                </select>
     136                                <input type="submit" value="<?php esc_attr_e( 'Apply' ); ?>" name="doaction" id="doaction" class="button-secondary action" />
     137                                <?php wp_nonce_field( 'bulk-ms-users' ); ?>
     138                        </div>
     139
     140                        <?php if ( $page_links ) { ?>
     141                        <div class="tablenav-pages">
     142                        <?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
     143                        number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
     144                        number_format_i18n( min( $pagenum * $per_page, $num_pages ) ),
     145                        number_format_i18n( $num_pages ),
     146                        $page_links
     147                        ); echo $page_links_text; ?>
     148                        </div>
     149                        <?php } ?>
     150
     151                        <div class="view-switch">
     152                                <a href="<?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e( 'List View' ) ?>" alt="<?php _e( 'List View' ) ?>" /></a>
     153                                <a href="<?php echo esc_url( add_query_arg( 'mode', 'excerpt', $_SERVER['REQUEST_URI'] ) ) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e( 'Excerpt View' ) ?>" alt="<?php _e( 'Excerpt View' ) ?>" /></a>
    132154                        </div>
    133155                </div>
    134 
    135                 <?php if ( isset($_GET['s']) && $_GET['s'] != '' ) : ?>
    136                         <p><a href="ms-sites.php?action=blogs&amp;s=<?php echo urlencode( stripslashes( $s ) ); ?>&blog_name=Search+blogs+by+name"><?php _e('Search Sites for') ?> <strong><?php echo stripslashes( $s ) ?></strong></a></p>
    137                 <?php endif; ?>
     156                <div class="clear"></div>
    138157
    139158                <?php
    140159                // define the columns to display, the syntax is 'internal name' => 'display name'
    141                 $posts_columns = array(
    142                         'checkbox'       => '',
    143                         'login'      => __('Username'),
    144                         'name'       => __('Name'),
    145                         'email'      => __('E-mail'),
    146                         'registered' => __('Registered'),
    147                         'blogs'      => ''
     160                $users_columns = array(
     161                        'id'           => __( 'ID' ),
     162                        'login'      => __( 'Username' ),
     163                        'name'       => __( 'Name' ),
     164                        'email'      => __( 'E-mail' ),
     165                        'registered' => __( 'Registered' ),
     166                        'blogs'      => __( 'Sites' )
    148167                );
    149                 $posts_columns = apply_filters('wpmu_users_columns', $posts_columns);
     168                $users_columns = apply_filters( 'wpmu_users_columns', $users_columns );
    150169                ?>
    151                 <table class="widefat" cellspacing="0">
     170                <table class="widefat">
    152171                        <thead>
    153172                        <tr>
    154                                 <?php foreach( (array) $posts_columns as $column_id => $column_display_name) {
    155                                         if ( $column_id == 'blogs' ) {
    156                                                 echo '<th scope="col">'.__('Sites').'</th>';
    157                                         } elseif ( $column_id == 'checkbox') {
    158                                                 echo '<th scope="col" class="check-column"><input type="checkbox" /></th>';
    159                                         } else { ?>
    160                                                 <th scope="col"><a href="ms-users.php?sortby=<?php echo $column_id ?>&amp;<?php if ( $order_by == $column_id ) { if ( $order == 'DESC' ) { echo "order=ASC&amp;" ; } else { echo "order=DESC&amp;"; } } ?>apage=<?php echo $apage ?>"><?php echo $column_display_name; ?></a></th>
    161                                         <?php } ?>
    162                                 <?php } ?>
     173                                <th class="manage-column column-cb check-column" id="cb" scope="col">
     174                                        <input type="checkbox" />
     175                                </th>
     176                                <?php
     177                                $col_url = '';
     178                                foreach($users_columns as $column_id => $column_display_name) {
     179                                        $column_link = "<a href='";
     180                                        $order2 = '';
     181                                        if ( $order_by == $column_id )
     182                                                $order2 = ( $order == 'DESC' ) ? 'ASC' : 'DESC';
     183
     184                                        $column_link .= esc_url( add_query_arg( array( 'order' => $order2, 'paged' => $pagenum, 'sortby' => $column_id ), remove_query_arg( array( 'action', 'updated' ), $_SERVER['REQUEST_URI'] ) ) );
     185                                        $column_link .= "'>{$column_display_name}</a>";
     186                                        $col_url .= '<th scope="col">' . ( $column_id == 'blogs' ? $column_display_name : $column_link ) . '</th>';
     187                                }
     188                                echo $col_url; ?>
    163189                        </tr>
    164190                        </thead>
    165                         <tbody id="users" class="list:user user-list">
    166                         <?php if ($user_list) {
     191                        <tfoot>
     192                        <tr>
     193                                <th class="manage-column column-cb check-column" id="cb" scope="col">
     194                                        <input type="checkbox" />
     195                                </th>
     196                                <?php echo $col_url; ?>
     197                        </tr>
     198                        </tfoot>
     199                        <tbody id="the-user-list" class="list:user">
     200                        <?php if ( $user_list ) {
    167201                                $class = '';
    168202                                $super_admins = get_site_option( 'site_admins' );
    169                                 foreach ( (array) $user_list as $user) {
    170                                         $class = ('alternate' == $class) ? '' : 'alternate';
    171 
    172                                         $status_list = array( "spam" => "site-spammed", "deleted" => "site-deleted" );
     203                                foreach ( (array) $user_list as $user ) {
     204                                        $class = ( 'alternate' == $class ) ? '' : 'alternate';
     205
     206                                        $status_list = array( 'spam' => 'site-spammed', 'deleted' => 'site-deleted' );
    173207
    174208                                        foreach ( $status_list as $status => $col ) {
     
    178212
    179213                                        ?>
    180 
    181214                                        <tr class="<?php echo $class; ?>">
    182215                                        <?php
    183                                         foreach( (array) $posts_columns as $column_name=>$column_display_name) :
    184                                                 switch($column_name) {
    185                                                         case 'checkbox': ?>
    186                                                                 <th scope="row" class="check-column"><input type='checkbox' id='user_<?php echo $user['ID'] ?>' name='allusers[]' value='<?php echo esc_attr($user['ID']) ?>' /></th>
     216                                        foreach( (array) $users_columns as $column_name=>$column_display_name ) :
     217                                                switch( $column_name ) {
     218                                                        case 'id': ?>
     219                                                                <th scope="row" class="check-column">
     220                                                                        <input type="checkbox" id="blog_<?php echo $user['ID'] ?>" name="allusers[]" value="<?php echo esc_attr( $user['ID'] ) ?>" />
     221                                                                </th>
     222                                                                <th valign="top" scope="row">
     223                                                                        <?php echo $user['ID'] ?>
     224                                                                </th>
    187225                                                        <?php
    188226                                                        break;
     
    190228                                                        case 'login':
    191229                                                                $avatar = get_avatar( $user['user_email'], 32 );
    192                                                                 $edit   = esc_url( add_query_arg( 'wp_http_referer', urlencode( esc_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=".$user['ID'] ) );
    193                                                                 // @todo Make delete link work like delete button with transfering users (in ms-edit.php)
    194                                                                 //$delete       = esc_url( add_query_arg( 'wp_http_referer', urlencode( esc_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), wp_nonce_url( 'ms-edit.php', 'deleteuser' ) . '&amp;action=deleteuser&amp;id=' . $user['ID'] ) );
    195230                                                                ?>
    196231                                                                <td class="username column-username">
    197                                                                         <?php echo $avatar; ?><strong><a href="<?php echo $edit; ?>" class="edit"><?php echo stripslashes($user['user_login']); ?></a><?php
    198                                                                 if ( in_array( $user[ 'user_login' ], $super_admins ) )
    199                                                                         echo ' - ' . __( 'Super admin' );
    200 ?></strong>
     232                                                                        <?php echo $avatar; ?><strong><a href="<?php echo esc_url( admin_url( 'user-edit.php?user_id=' . $user['ID'] ) ); ?>" class="edit"><?php echo stripslashes( $user['user_login'] ); ?></a><?php
     233                                                                        if ( in_array( $user['user_login'], $super_admins ) )
     234                                                                                echo ' - ' . __( 'Super admin' );
     235                                                                        ?></strong>
    201236                                                                        <br/>
    202237                                                                        <div class="row-actions">
    203                                                                                 <span class="edit"><a href="<?php echo $edit; ?>">Edit</a></span>
    204                                                                                 <?php /*<span class="delete"><a href="<?php echo $delete; ?>" class="delete">Delete</a></span> */ ?>
     238                                                                                <span class="edit"><a href="<?php echo esc_url( admin_url( 'user-edit.php?user_id=' . $user['ID'] ) ); ?>"><?php _e( 'Edit'); ?></a></span>
     239                                                                                <?php if ( ! in_array( $user['user_login'], $super_admins ) ) { ?>
     240                                                                                | <span class="delete"><a href="<?php echo $delete      = esc_url( admin_url( add_query_arg( '_wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'ms-edit.php', 'deleteuser' ) . '&amp;action=deleteuser&amp;id=' . $user['ID'] ) ) ); ?>" class="delete"><?php _e( 'Delete' ); ?></a></span>
     241                                                                                <?php } ?>
    205242                                                                        </div>
    206243                                                                </td>
     
    218255                                                        break;
    219256
    220                                                         case 'registered': ?>
    221                                                                 <td><?php echo mysql2date(__('Y-m-d \<\b\r \/\> g:i a'), $user['user_registered']); ?></td>
     257                                                        case 'registered':
     258                                                                if ( 'list' == $mode )
     259                                                                        $date = 'Y/m/d';
     260                                                                else
     261                                                                        $date = 'Y/m/d \<\b\r \/\> g:i:s a';
     262                                                        ?>
     263                                                                <td><?php echo mysql2date( __( $date ), $user['user_registered'] ); ?></td>
    222264                                                        <?php
    223265                                                        break;
     
    230272                                                                        if ( is_array( $blogs ) ) {
    231273                                                                                foreach ( (array) $blogs as $key => $val ) {
    232                                                                                         $path   = ($val->path == '/') ? '' : $val->path;
    233                                                                                         echo '<a href="ms-sites.php?action=editblog&amp;id=' . $val->userblog_id . '">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>';
     274                                                                                        $path   = ( $val->path == '/' ) ? '' : $val->path;
     275                                                                                        echo '<a href="'. esc_url( admin_url( 'ms-sites.php?action=editblog&amp;id=' . $val->userblog_id  ) ) .'">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>';
    234276                                                                                        echo ' <small class="row-actions">';
    235277
    236278                                                                                        // Edit
    237                                                                                         echo '<a href="ms-sites.php?action=editblog&amp;id=' . $val->userblog_id . '">' . __('Edit') . '</a> | ';
     279                                                                                        echo '<a href="'. esc_url( admin_url( 'ms-sites.php?action=editblog&amp;id=' . $val->userblog_id  ) ) .'">' . __( 'Edit' ) . '</a> | ';
    238280
    239281                                                                                        // View
    240282                                                                                        echo '<a ';
    241283                                                                                        if ( get_blog_status( $val->userblog_id, 'spam' ) == 1 )
    242                                                                                                 echo 'style="background-color: #f66" ';
    243                                                                                         echo 'target="_new" href="http://'.$val->domain . $val->path.'">' . __('View') . '</a>';
    244 
     284                                                                                                echo 'style="background-color: #faa" ';
     285                                                                                        echo 'href="' .  esc_url( get_home_url( $val->userblog_id ) )  . '">' . __( 'View' ) . '</a>';
     286                                                                                       
    245287                                                                                        echo '</small><br />';
    246288                                                                                }
     
    252294
    253295                                                        default: ?>
    254                                                                 <td><?php do_action('manage_users_custom_column', $column_name, $user['ID']); ?></td>
     296                                                                <td><?php do_action( 'manage_users_custom_column', $column_name, $user['ID'] ); ?></td>
    255297                                                        <?php
    256298                                                        break;
     
    263305                        } else {
    264306                        ?>
    265                                 <tr style='background-color: <?php echo $bgcolor; ?>'>
    266                                         <td colspan="<?php echo (int) count($posts_columns); ?>"><?php _e('No users found.') ?></td>
     307                                <tr>
     308                                        <td colspan="<?php echo (int) count($users_columns); ?>"><?php _e( 'No users found.' ) ?></td>
    267309                                </tr>
    268310                                <?php
     
    273315
    274316                <div class="tablenav">
    275                         <?php if ( $user_navigation ) echo "<div class='tablenav-pages'>$user_navigation</div>"; ?>
    276 
    277                         <div class="alignleft">
    278                                 <input type="submit" value="<?php esc_attr_e('Delete') ?>" name="alluser_delete" class="button-secondary delete" />
    279                                 <input type="submit" value="<?php esc_attr_e('Mark as Spammers') ?>" name="alluser_spam" class="button-secondary" />
    280                                 <input type="submit" value="<?php esc_attr_e('Not Spam') ?>" name="alluser_notspam" class="button-secondary" />
    281                                 <input type="submit" value="<?php esc_attr_e('Add Network Admins') ?>" name="add_superadmin" class="button-secondary" />
    282                                 <input type="submit" value="<?php esc_attr_e('Remove Network Admins') ?>" name="remove_superadmin" class="button-secondary" />
    283                                 <?php wp_nonce_field( 'allusers' ); ?>
    284                                 <br class="clear" />
     317                        <?php
     318                        if ( $page_links )
     319                                echo "<div class='tablenav-pages'>$page_links_text</div>";
     320                        ?>
     321
     322                        <div class="alignleft actions">
     323                                <select name="action2">
     324                                        <option value="-1" selected="selected"><?php _e( 'Bulk Actions' ); ?></option>
     325                                        <option value="delete"><?php _e( 'Delete' ); ?></option>
     326                                        <option value="spam"><?php _e( 'Mark as Spammers' ); ?></option>
     327                                        <option value="notspam"><?php _e( 'Not Spam' ); ?></option>
     328                                        <option value="superadmin"><?php _e( 'Add Super Admins' ); ?></option>
     329                                        <option value="notsuperadmin"><?php _e( 'Remove Super Admins' ); ?></option>
     330                                </select>
     331                                <input type="submit" value="<?php esc_attr_e( 'Apply' ); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
    285332                        </div>
     333                        <br class="clear" />
    286334                </div>
    287         </form>
    288 </div>
     335
     336                </form>
     337                </div>
    289338
    290339<?php
    291 if ( apply_filters('show_adduser_fields', true) ) :
     340if ( apply_filters( 'show_adduser_fields', true ) ) :
    292341?>
    293342<div class="wrap">
    294         <h2><?php _e('Add user') ?></h2>
    295         <form action="ms-edit.php?action=adduser" method="post">
     343        <h2><?php _e( 'Add user' ) ?></h2>
     344        <form action="ms-edit.php?action=adduser" method="post" id="form-add-user">
    296345        <table class="form-table">
    297346                <tr class="form-field form-required">
    298                         <th scope='row'><?php _e('Username') ?></th>
    299                         <td><input type="text" name="user[username]" /></td>
     347                        <th scope="row"><?php _e( 'Username' ) ?></th>
     348                        <td><input type="text" class="regular-text" name="user[username]" /></td>
    300349                </tr>
    301350                <tr class="form-field form-required">
    302                         <th scope='row'><?php _e('Email') ?></th>
    303                         <td><input type="text" name="user[email]" /></td>
     351                        <th scope="row"><?php _e( 'Email' ) ?></th>
     352                        <td><input type="text" class="regular-text" name="user[email]" /></td>
    304353                </tr>
    305354                <tr class="form-field">
    306                         <td colspan='2'><?php _e('Username and password will be mailed to the above email address.') ?></td>
     355                        <td colspan="2"><?php _e( 'Username and password will be mailed to the above email address.' ) ?></td>
    307356                </tr>
    308357        </table>
    309358        <p class="submit">
    310                 <?php wp_nonce_field('add-user') ?>
    311                 <input class="button" type="submit" name="Add user" value="<?php esc_attr_e('Add user') ?>" /></p>
     359                <?php wp_nonce_field( 'add-user' ) ?>
     360                <input class="button" type="submit" value="<?php esc_attr_e( 'Add user' ) ?>" /></p>
    312361        </form>
    313362</div>
    314363<?php endif; ?>
    315364
    316 <?php include('admin-footer.php'); ?>
     365<?php include( './admin-footer.php' ); ?>
Note: See TracChangeset for help on using the changeset viewer.