Changeset 10300
- Timestamp:
- 01/05/2009 10:08:31 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/dashboard.php
r10279 r10300 182 182 // Posts 183 183 $num = number_format_i18n( $num_posts->publish ); 184 if ( current_user_can( 'edit_posts' ) ) 185 $text = "<a href='edit.php'>$num</a>"; 186 else 187 $text = $num; 188 echo '<td class="first b b-posts">' . $text . '</td>'; 189 echo '<td class="t posts">' . __ngettext( 'Post', 'Posts', intval($num_posts->publish) ) . '</td>'; 184 $text = __ngettext( 'Post', 'Posts', intval($num_posts->publish) ); 185 if ( current_user_can( 'edit_posts' ) ) { 186 $num = "<a href='edit.php'>$num</a>"; 187 $text = "<a href='edit.php'>$text</a>"; 188 } 189 echo '<td class="first b b-posts">' . $num . '</td>'; 190 echo '<td class="t posts">' . $text . '</td>'; 190 191 /* TODO: Show status breakdown on hover 191 192 if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds. Don't show if !current_user_can … … 207 208 // Total Comments 208 209 $num = number_format_i18n($num_comm->total_comments); 209 if ( current_user_can( 'moderate_comments' ) ) 210 $text = __ngettext( 'Comment', 'Comments', $num_comm->total_comments ); 211 if ( current_user_can( 'moderate_comments' ) ) { 210 212 $num = "<a href='edit-comments.php'>$num</a>"; 211 echo '<td class="b b-comments">'.$num.'</td>'; 212 echo '<td class="last t comments">' . __ngettext( 'Comment', 'Comments', $num_comm->total_comments ) . '</td>'; 213 $text = "<a href='edit-comments.php'>$text</a>"; 214 } 215 echo '<td class="b b-comments">' . $num . '</td>'; 216 echo '<td class="last t comments">' . $text . '</td>'; 213 217 214 218 echo '</tr><tr>'; … … 216 220 // Pages 217 221 $num = number_format_i18n( $num_pages->publish ); 218 if ( current_user_can( 'edit_pages' ) ) 222 $text = __ngettext( 'Page', 'Pages', $num_pages->publish ); 223 if ( current_user_can( 'edit_pages' ) ) { 219 224 $num = "<a href='edit-pages.php'>$num</a>"; 220 echo '<td class="first b b_pages">'.$num.'</td>'; 221 echo '<td class="t pages">' . __ngettext( 'Page', 'Pages', $num_pages->publish ) . '</td>'; 225 $text = "<a href='edit-pages.php'>$text</a>"; 226 } 227 echo '<td class="first b b_pages">' . $num . '</td>'; 228 echo '<td class="t pages">' . $text . '</td>'; 222 229 223 230 // Approved Comments 224 231 $num = number_format_i18n($num_comm->approved); 225 if ( current_user_can( 'moderate_comments' ) ) 232 $text = __ngettext( 'Approved', 'Approved', $num_comm->approved ); 233 if ( current_user_can( 'moderate_comments' ) ) { 226 234 $num = "<a href='edit-comments.php?comment_status=approved'>$num</a>"; 227 echo '<td class="b b_approved">'.$num.'</td>'; 228 echo '<td class="last t approved">' . __ngettext( 'Approved', 'Approved', $num_comm->approved ) . '</td>'; 235 $text = "<a class='approved' href='edit-comments.php?comment_status=approved'>$text</a>"; 236 } 237 echo '<td class="b b_approved">' . $num . '</td>'; 238 echo '<td class="last t">' . $text . '</td>'; 229 239 230 240 echo "</tr>\n\t<tr>"; … … 232 242 // Categories 233 243 $num = number_format_i18n( $num_cats ); 234 if ( current_user_can( 'manage_categories' ) ) 244 $text = __ngettext( 'Category', 'Categories', $num_cats ); 245 if ( current_user_can( 'manage_categories' ) ) { 235 246 $num = "<a href='categories.php'>$num</a>"; 236 echo '<td class="first b b-cats">'.$num.'</td>'; 237 echo '<td class="t cats">' . __ngettext( 'Category', 'Categories', $num_cats ) . '</td>'; 247 $text = "<a href='categories.php'>$text</a>"; 248 } 249 echo '<td class="first b b-cats">' . $num . '</td>'; 250 echo '<td class="t cats">' . $text . '</td>'; 238 251 239 252 // Pending Comments 240 253 $num = number_format_i18n($num_comm->moderated); 241 if ( current_user_can( 'moderate_comments' ) ) 254 $text = __ngettext( 'Pending', 'Pending', $num_comm->moderated ); 255 if ( current_user_can( 'moderate_comments' ) ) { 242 256 $num = "<a href='edit-comments.php?comment_status=moderated'><span class='pending-count'>$num</span></a>"; 243 echo '<td class="b b-waiting">'.$num.'</td>'; 244 echo '<td class="last t waiting">' . __ngettext( 'Pending', 'Pending', $num_comm->moderated ) . '</td>'; 257 $text = "<a class='waiting' href='edit-comments.php?comment_status=moderated'>$text</a>"; 258 } 259 echo '<td class="b b-waiting">' . $num . '</td>'; 260 echo '<td class="last t">' . $text . '</td>'; 245 261 246 262 echo "</tr>\n\t<tr>"; … … 248 264 // Tags 249 265 $num = number_format_i18n( $num_tags ); 250 if ( current_user_can( 'manage_categories' ) ) 266 $text = __ngettext( 'Tag', 'Tags', $num_tags ); 267 if ( current_user_can( 'manage_categories' ) ) { 251 268 $num = "<a href='edit-tags.php'>$num</a>"; 252 echo '<td class="first b b-tags">'.$num.'</td>'; 253 echo '<td class="t tags">' . __ngettext( 'Tag', 'Tags', $num_tags ) . '</td>'; 269 $text = "<a href='edit-tags.php'>$text</a>"; 270 } 271 echo '<td class="first b b-tags">' . $num . '</td>'; 272 echo '<td class="t tags">' . $text . '</td>'; 254 273 255 274 // Spam Comments 256 275 $num = number_format_i18n($num_comm->spam); 257 if ( current_user_can( 'moderate_comments' ) ) 276 $text = __ngettext( 'Spam', 'Spam', $num_comm->spam ); 277 if ( current_user_can( 'moderate_comments' ) ) { 258 278 $num = "<a href='edit-comments.php?comment_status=spam'><span class='spam-count'>$num</span></a>"; 259 echo '<td class="b b-spam">'.$num.'</td>'; 260 echo '<td class="last t spam">' . __ngettext( 'Spam', 'Spam', $num_comm->spam ) . '</td>'; 279 $text = "<a class='spam' href='edit-comments.php?comment_status=spam'>$text</a>"; 280 } 281 echo '<td class="b b-spam">' . $num . '</td>'; 282 echo '<td class="last t">' . $text . '</td>'; 261 283 262 284 echo "</tr>";
Note: See TracChangeset
for help on using the changeset viewer.