Make WordPress Core


Ignore:
Timestamp:
03/01/2010 12:32:00 PM (16 years ago)
Author:
dd32
Message:

Split Right Now widget into Content | Discussion. Props matveb. Fixes #12202

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r13519 r13531  
    213213    $num_comm = wp_count_comments( );
    214214
    215     echo "\n\t".'<p class="sub">' . __('At a Glance') . '</p>';
    216     echo "\n\t".'<div class="table">'."\n\t".'<table>';
     215    echo "\n\t".'<div class="table table_content">'."\n\t".'<table>';
     216    echo "\n\t".'<p class="sub">' . __('Content') . '</p>';
    217217    echo "\n\t".'<tr class="first">';
    218218
     
    226226    echo '<td class="first b b-posts">' . $num . '</td>';
    227227    echo '<td class="t posts">' . $text . '</td>';
     228
     229    echo '</tr><tr>';
    228230    /* TODO: Show status breakdown on hover
    229231    if ( $can_edit_pages && !empty($num_pages->publish) ) { // how many pages is not exposed in feeds.  Don't show if !current_user_can
     
    242244    }
    243245    */
    244 
    245     // Total Comments
    246     $num = '<span class="total-count">' . number_format_i18n($num_comm->total_comments) . '</span>';
    247     $text = _n( 'Comment', 'Comments', $num_comm->total_comments );
    248     if ( current_user_can( 'moderate_comments' ) ) {
    249         $num = "<a href='edit-comments.php'>$num</a>";
    250         $text = "<a href='edit-comments.php'>$text</a>";
    251     }
    252     echo '<td class="b b-comments">' . $num . '</td>';
    253     echo '<td class="last t comments">' . $text . '</td>';
    254 
    255     echo '</tr><tr>';
    256246
    257247    // Pages
     
    265255    echo '<td class="t pages">' . $text . '</td>';
    266256
     257    echo '</tr><tr>';
     258
     259    // Categories
     260    $num = number_format_i18n( $num_cats );
     261    $text = _n( 'Category', 'Categories', $num_cats );
     262    if ( current_user_can( 'manage_categories' ) ) {
     263        $num = "<a href='edit-tags.php?taxonomy=category'>$num</a>";
     264        $text = "<a href='edit-tags.php?taxonomy=category'>$text</a>";
     265    }
     266    echo '<td class="first b b-cats">' . $num . '</td>';
     267    echo '<td class="t cats">' . $text . '</td>';
     268
     269    echo '</tr><tr>';
     270
     271    // Tags
     272    $num = number_format_i18n( $num_tags );
     273    $text = _n( 'Tag', 'Tags', $num_tags );
     274    if ( current_user_can( 'manage_categories' ) ) {
     275        $num = "<a href='edit-tags.php'>$num</a>";
     276        $text = "<a href='edit-tags.php'>$text</a>";
     277    }
     278    echo '<td class="first b b-tags">' . $num . '</td>';
     279    echo '<td class="t tags">' . $text . '</td>';
     280
     281    echo "</tr>";
     282    echo "\n\t</table>\n\t</div>";
     283
     284
     285    echo "\n\t".'<div class="table table_discussion">'."\n\t".'<table>';
     286    echo "\n\t".'<p class="sub">' . __('Discussion') . '</p>';
     287    echo "\n\t".'<tr class="first">';
     288
     289    // Total Comments
     290    $num = '<span class="total-count">' . number_format_i18n($num_comm->total_comments) . '</span>';
     291    $text = _n( 'Comment', 'Comments', $num_comm->total_comments );
     292    echo '<td class="b b-comments"><a href="edit-comments.php">' . $num . '</a></td>';
     293    echo '<td class="last t comments"><a href="edit-comments.php">' . $text . '</a></td>';
     294
     295    echo '</tr><tr>';
     296
    267297    // Approved Comments
    268298    $num = '<span class="approved-count">' . number_format_i18n($num_comm->approved) . '</span>';
     
    277307    echo "</tr>\n\t<tr>";
    278308
    279     // Categories
    280     $num = number_format_i18n( $num_cats );
    281     $text = _n( 'Category', 'Categories', $num_cats );
    282     if ( current_user_can( 'manage_categories' ) ) {
    283         $num = "<a href='edit-tags.php?taxonomy=category'>$num</a>";
    284         $text = "<a href='edit-tags.php?taxonomy=category'>$text</a>";
    285     }
    286     echo '<td class="first b b-cats">' . $num . '</td>';
    287     echo '<td class="t cats">' . $text . '</td>';
    288 
    289309    // Pending Comments
    290310    $num = '<span class="pending-count">' . number_format_i18n($num_comm->moderated) . '</span>';
     
    298318
    299319    echo "</tr>\n\t<tr>";
    300 
    301     // Tags
    302     $num = number_format_i18n( $num_tags );
    303     $text = _n( 'Tag', 'Tags', $num_tags );
    304     if ( current_user_can( 'manage_categories' ) ) {
    305         $num = "<a href='edit-tags.php'>$num</a>";
    306         $text = "<a href='edit-tags.php'>$text</a>";
    307     }
    308     echo '<td class="first b b-tags">' . $num . '</td>';
    309     echo '<td class="t tags">' . $text . '</td>';
    310320
    311321    // Spam Comments
Note: See TracChangeset for help on using the changeset viewer.