WordPress.org

Make WordPress Core

Ticket #2793: reorganize_users.php.diff

File reorganize_users.php.diff, 3.2 KB (added by markjaquith, 8 years ago)

reorganize search, put it all into one wrap

  • wp-admin/users.php

     
    204204        if ( $userids ) 
    205205                $total_users_for_this_query = $wpdb->get_var('SELECT COUNT(ID) ' . $from_where); // no limit 
    206206        else 
    207                 $errors = new WP_Error('no_matching_users_found', __('No matching users were found!')); 
     207                $search_errors = new WP_Error('no_matching_users_found', __('No matching users were found!')); 
    208208 
    209209        // Now for the paging 
    210210        if ( $total_users_for_this_query > $users_per_page ) { // have to page the results 
     
    282282<?php endif; ?> 
    283283 
    284284<div class="wrap"> 
    285         <h2><?php _e('Search For Users'); ?></h2> 
     285 
     286        <?php if ( $search_term ) : ?> 
     287                <h2><?php printf(__('Users Matching "%s" by Role'), $search_term); ?></h2> 
     288        <?php else : ?> 
     289                <h2><?php _e('User List by Role'); ?></h2> 
     290        <?php endif; ?> 
     291 
    286292        <form action="" method="get" name="search" id="search"> 
    287                 <p><input type="text" name="usersearch" id="usersearch" value="<?php echo wp_specialchars($search_term); ?>" /> <input type="submit" value="Search &raquo;" /></p> 
     293                <p><input type="text" name="usersearch" id="usersearch" value="<?php echo wp_specialchars($search_term); ?>" /> <input type="submit" value="<?php _e('Search for users &raquo;'); ?>" /></p> 
    288294        </form> 
     295 
     296        <?php if ( is_wp_error( $search_errors ) ) : ?> 
     297                <div class="error"> 
     298                        <ul> 
     299                        <?php 
     300                                foreach ( $search_errors->get_error_messages() as $message ) 
     301                                        echo "<li>$message</li>"; 
     302                        ?> 
     303                        </ul> 
     304                </div> 
     305        <?php endif; ?> 
     306 
     307 
     308<?php if ( $userids ) : ?> 
     309 
    289310        <?php if ( $search_term ) : ?> 
    290311                <p><a href="users.php"><?php _e('&laquo; Back to All Users'); ?></a></p> 
    291312        <?php endif; ?> 
    292 </div> 
    293313 
    294 <?php if ( $userids ) : ?> 
     314        <h3><?php printf(__('Results %1$s - %2$s of %3$s shown below'), $starton + 1, min($starton + $users_per_page, $total_users_for_this_query), $total_users_for_this_query); ?></h3> 
    295315 
     316        <?php if ( $paging_text ) : ?> 
     317                <div class="user-paging-text"><?php echo $paging_text; ?></p></div> 
     318        <?php endif; ?> 
     319 
    296320<form action="" method="post" name="updateusers" id="updateusers"> 
    297321<?php wp_nonce_field('bulk-users') ?> 
    298 <div class="wrap"> 
    299         <?php if ( $search_term ) : ?> 
    300                 <h2><?php printf(__('Users Matching "%s" by Role'), $search_term); ?></h2> 
    301                 <div class="user-paging-text"><?php echo $paging_text; ?></div> 
    302         <?php else : ?> 
    303                 <h2><?php _e('User List by Role'); ?></h2> 
    304                 <?php if ( $paging_text ) : ?> 
    305                         <div class="user-paging-text"><?php echo $paging_text; ?></p></div> 
    306                 <?php endif; ?> 
    307         <?php endif; ?> 
    308         <h3><?php printf(__('Results %1$s - %2$s of %3$s shown below'), $starton + 1, min($starton + $users_per_page, $total_users_for_this_query), $total_users_for_this_query); ?></h3> 
    309322<table class="widefat"> 
    310323<?php 
    311324foreach($roleclasses as $role => $roleclass) { 
     
    356369                <?php echo $referer; ?> 
    357370                <input type="submit" value="<?php _e('Update &raquo;'); ?>" /> 
    358371        </p> 
     372</form> 
     373<?php endif; ?> 
    359374</div> 
    360 </form> 
    361375 
    362 <?php endif; // if users were returned ?> 
    363  
    364376<?php 
    365377        if ( is_wp_error($add_user_errors) ) { 
    366378                foreach ( array('user_login' => 'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) {