Make WordPress Core

Changeset 6570


Ignore:
Timestamp:
01/07/2008 08:38:49 PM (17 years ago)
Author:
ryan
Message:

Mass select for users from cpoteet and mdawaffe. fixes #5592

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r6556 r6570  
    388388        'what' => 'user',
    389389        'id' => $user_id,
    390         'data' => user_row( $user_object ),
     390        'data' => user_row( $user_object, '', $user_object->roles[0] ),
    391391        'supplemental' => array(
    392392            'show-link' => sprintf(__( 'User <a href="#%s">%s</a> added' ), "user-$user_id", $user_object->user_login),
  • trunk/wp-admin/edit-comments.php

    r6430 r6570  
    55$parent_file = 'edit-comments.php';
    66wp_enqueue_script( 'admin-comments' );
     7wp_enqueue_script('admin-forms');
    78
    89require_once('admin-header.php');
     
    1011else $mode = attribute_escape($_GET['mode']);
    1112?>
    12 
    13 <script type="text/javascript">
    14 <!--
    15 function checkAll(form)
    16 {
    17     for (i = 0, n = form.elements.length; i < n; i++) {
    18         if(form.elements[i].type == "checkbox") {
    19             if(form.elements[i].checked == true)
    20                 form.elements[i].checked = false;
    21             else
    22                 form.elements[i].checked = true;
    23         }
    24     }
    25 }
    26 
    27 function getNumChecked(form)
    28 {
    29     var num = 0;
    30     for (i = 0, n = form.elements.length; i < n; i++) {
    31         if(form.elements[i].type == "checkbox") {
    32             if(form.elements[i].checked == true)
    33                 num++;
    34         }
    35     }
    36     return num;
    37 }
    38 //-->
    39 </script>
    4013<div class="wrap">
    4114<h2><?php _e('Comments'); ?></h2>
  • trunk/wp-admin/includes/template.php

    r6552 r6570  
    314314}
    315315
    316 function user_row( $user_object, $style = '' ) {
     316function user_row( $user_object, $style = '', $role = '' ) {
    317317    if ( !( is_object( $user_object) && is_a( $user_object, 'WP_User' ) ) )
    318318        $user_object = new WP_User( (int) $user_object );
     
    327327    $numposts = get_usernumposts( $user_object->ID );
    328328    $r = "<tr id='user-$user_object->ID'$style>
    329         <td><input type='checkbox' name='users[]' id='user_{$user_object->ID}' value='{$user_object->ID}' /> <label for='user_{$user_object->ID}'>{$user_object->ID}</label></td>
     329        <td><input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' /> <label for='user_{$user_object->ID}'>{$user_object->ID}</label></td>
    330330        <td><label for='user_{$user_object->ID}'><strong>$user_object->user_login</strong></label></td>
    331331        <td><label for='user_{$user_object->ID}'>$user_object->first_name $user_object->last_name</label></td>
  • trunk/wp-admin/link-manager.php

    r6555 r6570  
    88
    99wp_enqueue_script( 'wp-lists' );
     10wp_enqueue_script('admin-forms');
    1011
    1112wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]'));
     
    4647}
    4748?>
    48 <script type="text/javascript">
    49 /* <![CDATA[ */
    50 function checkAll(form)
    51 {
    52     for (i = 0, n = form.elements.length; i < n; i++) {
    53         if(form.elements[i].type == "checkbox") {
    54             if(form.elements[i].checked == true)
    55                 form.elements[i].checked = false;
    56             else
    57                 form.elements[i].checked = true;
    58         }
    59     }
    60 }
    61 
    62 jQuery(function($){$('#the-list').wpList();});
    63 
    64 /* ]]> */
    65 </script>
    66 
     49<script type="text/javascript" src="js/edit-comments.js"></script>
    6750<?php
    6851if ( isset($_GET['deleted']) ) {
  • trunk/wp-admin/users.php

    r6303 r6570  
    210210<?php wp_nonce_field('delete-users') ?>
    211211<?php echo $referer; ?>
     212
    212213<div class="wrap">
    213214<h2><?php _e('Delete Users'); ?></h2>
     
    271272default:
    272273    wp_enqueue_script('admin-users');
    273 
     274    wp_enqueue_script('admin-forms');
     275   
    274276    include('admin-header.php');
    275277
     
    386388</tr>
    387389<tr class="thead">
     390    <th><input type="checkbox" onclick="checkAllUsers('<?php echo $role; ?>')"/></th>
    388391    <th><?php _e('ID') ?></th>
    389392    <th><?php _e('Username') ?></th>
     
    398401foreach ( (array) $roleclass as $user_object ) {
    399402    $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
    400     echo "\n\t" . user_row($user_object, $style);
     403    echo "\n\t" . user_row($user_object, $style, $role);
    401404}
    402405?>
  • trunk/wp-includes/script-loader.php

    r6569 r6570  
    120120            $this->add( 'admin-posts', '/wp-admin/js/edit-posts.js', array('wp-lists'), '20071023' );
    121121            $this->add( 'admin-users', '/wp-admin/js/users.js', array('wp-lists'), '20070823' );
     122            $this->add( 'admin-forms', '/wp-admin/js/forms.js', array('wp-lists'), '20080108' );
    122123            $this->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' );
    123124            $this->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' );
Note: See TracChangeset for help on using the changeset viewer.