Make WordPress Core

Ticket #8760: just-checkbox-changes.diff

File just-checkbox-changes.diff, 1.9 KB (added by jeremyclarke, 16 years ago)

checkbox patch 2.8 trunk dec30-08

  • wp-admin/includes/template.php

     
    18051805        if ( strlen( $short_url ) > 35 )
    18061806                $short_url = substr( $short_url, 0, 32 ).'...';
    18071807        $numposts = get_usernumposts( $user_object->ID );
     1808        $checkbox = '';
     1809        // Check if the user for this row is editable
    18081810        if ( current_user_can( 'edit_user', $user_object->ID ) ) {
     1811                // Set up the user editing link
     1812                // TODO: make profile/user-edit determination a seperate function
    18091813                if ($current_user->ID == $user_object->ID) {
    18101814                        $edit_link = 'profile.php';
    18111815                } else {
    18121816                        $edit_link = clean_url( add_query_arg( 'wp_http_referer', urlencode( clean_url( stripslashes( $_SERVER['REQUEST_URI'] ) ) ), "user-edit.php?user_id=$user_object->ID" ) );
    18131817                }
    18141818                $edit = "<strong><a href=\"$edit_link\">$user_object->user_login</a></strong><br />";
     1819               
     1820                // Set up the hover actions for this user
    18151821                $actions = array();
    18161822                $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
    18171823                if ( $current_user->ID != $user_object->ID )
     
    18251831                        $edit .= "<span class='$action'>$link$sep</span>";
    18261832                }
    18271833                $edit .= '</div>';
     1834               
     1835                // Set up the checkbox (because the user is editable, otherwise its empty)
     1836                $checkbox = "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' />";
     1837               
    18281838        } else {
    18291839                $edit = '<strong>' . $user_object->user_login . '</strong>';
    18301840        }
     
    18441854
    18451855                switch ($column_name) {
    18461856                        case 'cb':
    1847                                 $r .= "<th scope='row' class='check-column'><input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' /></th>";
     1857                                $r .= "<th scope='row' class='check-column'>$checkbox</th>";
    18481858                                break;
    18491859                        case 'username':
    18501860                                $r .= "<td $attributes>$avatar $edit</td>";