User management improvements from Mark Jaquith and David House. #2793

git-svn-id: https://develop.svn.wordpress.org/trunk@3857 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-06-08 18:36:05 +00:00
parent eae22f445e
commit a4c408af37
7 changed files with 310 additions and 141 deletions

View File

@@ -729,17 +729,21 @@ function user_row( $user_object, $style = '' ) {
if (strlen($short_url) > 35)
$short_url = substr($short_url, 0, 32).'...';
$numposts = get_usernumposts($user_object->ID);
if (0 < $numposts) $numposts = "<a href='edit.php?author=$user_object->ID' title='" . __('View posts') . "'>$numposts</a>";
$r = "<tr id='user-$user_object->ID'$style>
<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>
<td><label for='user_{$user_object->ID}'><strong>$user_object->user_login</strong></label></td>
<td><label for='user_{$user_object->ID}'>$user_object->first_name $user_object->last_name</label></td>
<td><a href='mailto:$email' title='" . sprintf(__('e-mail: %s'), $email) . "'>$email</a></td>
<td><a href='$url' title='website: $url'>$short_url</a></td>";
$r .= "\n\t\t<td align='center'>$numposts</td>";
$r .= "\n\t\t<td>";
$r .= "\n\t\t<td align='center'>";
if ($numposts > 0) {
$r .= "<a href='edit.php?author=$user_object->ID' title='" . __('View posts by this author') . "' class='edit'>";
$r .= sprintf(__('View %1$s %2$s'), $numposts, __ngettext('post', 'posts', $numposts));
}
$r .= "</td>\n\t\t<td>";
$edit_link = add_query_arg('wp_http_referer', wp_specialchars(urlencode(stripslashes($_SERVER['REQUEST_URI']))), "user-edit.php?user_id=$user_object->ID");
if ( current_user_can('edit_user', $user_object->ID) )
$r .= "<a href='user-edit.php?user_id=$user_object->ID' class='edit'>".__('Edit')."</a>";
$r .= "<a href='$edit_link' class='edit'>".__('Edit')."</a>";
$r .= "</td>\n\t</tr>";
return $r;
}