Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r17129 r15458  
    1010 * Registers dashboard widgets.
    1111 *
    12  * Handles POST data, sets up filters.
    13  *
    14  * @since 2.5.0
     12 * handles POST data, sets up filters.
     13 *
     14 * @since unknown
    1515 */
    1616function wp_dashboard_setup() {
    1717    global $wp_registered_widgets, $wp_registered_widget_controls, $wp_dashboard_control_callbacks;
    1818    $wp_dashboard_control_callbacks = array();
    19     $screen = get_current_screen();
    2019
    2120    $update = false;
     
    2726
    2827    // Right Now
    29     if ( is_blog_admin() && current_user_can('edit_posts') )
    30         wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' );
    31 
    32     if ( is_network_admin() )
    33         wp_add_dashboard_widget( 'network_dashboard_right_now', __( 'Right Now' ), 'wp_network_dashboard_right_now' );
     28    wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_right_now' );
    3429
    3530    // Recent Comments Widget
    36     if ( is_blog_admin() && current_user_can('moderate_comments') ) {
    37         if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) {
    38             $update = true;
    39             $widget_options['dashboard_recent_comments'] = array(
    40                 'items' => 5,
    41             );
    42         }
    43         $recent_comments_title = __( 'Recent Comments' );
    44         wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' );
    45     }
     31    if ( !isset( $widget_options['dashboard_recent_comments'] ) || !isset( $widget_options['dashboard_recent_comments']['items'] ) ) {
     32        $update = true;
     33        $widget_options['dashboard_recent_comments'] = array(
     34            'items' => 5,
     35        );
     36    }
     37    $recent_comments_title = __( 'Recent Comments' );
     38    wp_add_dashboard_widget( 'dashboard_recent_comments', $recent_comments_title, 'wp_dashboard_recent_comments', 'wp_dashboard_recent_comments_control' );
    4639
    4740    // Incoming Links Widget
    48     if ( is_blog_admin() && current_user_can('publish_posts') ) {
    49         if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
    50             $update = true;
    51             $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;
    52             $widget_options['dashboard_incoming_links'] = array(
    53                 'home' => get_option('home'),
    54                 'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
    55                 'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
    56                 'items' => $num_items,
    57                 'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
    58             );
    59         }
    60         wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );
    61     }
     41    if ( !isset( $widget_options['dashboard_incoming_links'] ) || !isset( $widget_options['dashboard_incoming_links']['home'] ) || $widget_options['dashboard_incoming_links']['home'] != get_option('home') ) {
     42        $update = true;
     43        $num_items = isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10;
     44        $widget_options['dashboard_incoming_links'] = array(
     45            'home' => get_option('home'),
     46            'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
     47            'url' => isset($widget_options['dashboard_incoming_links']['url']) ? apply_filters( 'dashboard_incoming_links_feed', $widget_options['dashboard_incoming_links']['url'] ) : apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?scoring=d&ie=utf-8&num=' . $num_items . '&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
     48            'items' => $num_items,
     49            'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
     50        );
     51    }
     52    wp_add_dashboard_widget( 'dashboard_incoming_links', __( 'Incoming Links' ), 'wp_dashboard_incoming_links', 'wp_dashboard_incoming_links_control' );
    6253
    6354    // WP Plugins Widget
    64     if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) )
     55    if ( current_user_can( 'install_plugins' ) )
    6556        wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );
    6657
    6758    // QuickPress Widget
    68     if ( is_blog_admin() && current_user_can('edit_posts') )
     59    if ( current_user_can('edit_posts') )
    6960        wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
    7061
    7162    // Recent Drafts
    72     if ( is_blog_admin() && current_user_can('edit_posts') )
     63    if ( current_user_can('edit_posts') )
    7364        wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' );
    7465
     
    10495
    10596    // Hook to register new widgets
     97    do_action( 'wp_dashboard_setup' );
     98
    10699    // Filter widget order
    107     if ( is_network_admin() ) {
    108         do_action( 'wp_network_dashboard_setup' );
    109         $dashboard_widgets = apply_filters( 'wp_network_dashboard_widgets', array() );
    110     } elseif ( is_user_admin() ) {
    111         do_action( 'wp_user_dashboard_setup' );
    112         $dashboard_widgets = apply_filters( 'wp_user_dashboard_widgets', array() );
    113     } else {
    114         do_action( 'wp_dashboard_setup' );
    115         $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );
    116     }
     100    $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );
    117101
    118102    foreach ( $dashboard_widgets as $widget_id ) {
     
    132116        update_option( 'dashboard_widget_options', $widget_options );
    133117
    134     do_action('do_meta_boxes', $screen->id, 'normal', '');
    135     do_action('do_meta_boxes', $screen->id, 'side', '');
     118    do_action('do_meta_boxes', 'dashboard', 'normal', '');
     119    do_action('do_meta_boxes', 'dashboard', 'side', '');
    136120}
    137121
    138122function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null ) {
    139     $screen = get_current_screen();
    140123    global $wp_dashboard_control_callbacks;
    141 
    142124    if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) {
    143125        $wp_dashboard_control_callbacks[$widget_id] = $control_callback;
     
    145127            list($url) = explode( '#', add_query_arg( 'edit', false ), 2 );
    146128            $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( $url ) . '">' . __( 'Cancel' ) . '</a></span>';
    147             $callback = '_wp_dashboard_control_callback';
    148         } else {
    149             list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
    150             $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
    151         }
    152     }
    153 
    154     if ( is_blog_admin () )
    155         $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');
    156     else if (is_network_admin() )
    157         $side_widgets = array('dashboard_primary', 'dashboard_secondary');
    158     else
    159         $side_widgets = array();
    160 
     129            add_meta_box( $widget_id, $widget_name, '_wp_dashboard_control_callback', 'dashboard', 'normal', 'core' );
     130            return;
     131        }
     132        list($url) = explode( '#', add_query_arg( 'edit', $widget_id ), 2 );
     133        $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( "$url#$widget_id" ) . '" class="edit-box open-box">' . __( 'Configure' ) . '</a></span>';
     134    }
     135    $side_widgets = array('dashboard_quick_press', 'dashboard_recent_drafts', 'dashboard_primary', 'dashboard_secondary');
    161136    $location = 'normal';
    162137    if ( in_array($widget_id, $side_widgets) )
    163138        $location = 'side';
    164     add_meta_box( $widget_id, $widget_name , $callback, $screen->id, $location, 'core' );
     139    add_meta_box( $widget_id, $widget_name , $callback, 'dashboard', $location, 'core' );
    165140}
    166141
     
    168143    echo '<form action="" method="post" class="dashboard-widget-control-form">';
    169144    wp_dashboard_trigger_widget_control( $meta_box['id'] );
    170     echo '<input type="hidden" name="widget_id" value="' . esc_attr($meta_box['id']) . '" />';
    171     submit_button( __('Submit') );
     145    echo '<p class="submit"><input type="hidden" name="widget_id" value="' . esc_attr($meta_box['id']) . '" /><input type="submit" value="' . esc_attr__( 'Submit' ) . '" /></p>';
     146
    172147    echo '</form>';
    173148}
     
    176151 * Displays the dashboard.
    177152 *
    178  * @since 2.5.0
     153 * @since unknown
    179154 */
    180155function wp_dashboard() {
    181156    global $screen_layout_columns;
    182 
    183     $screen = get_current_screen();
    184157
    185158    $hide2 = $hide3 = $hide4 = '';
     
    204177<?php
    205178    echo "\t<div class='postbox-container' style='$width'>\n";
    206     do_meta_boxes( $screen->id, 'normal', '' );
     179    do_meta_boxes( 'dashboard', 'normal', '' );
    207180
    208181    echo "\t</div><div class='postbox-container' style='{$hide2}$width'>\n";
    209     do_meta_boxes( $screen->id, 'side', '' );
     182    do_meta_boxes( 'dashboard', 'side', '' );
    210183
    211184    echo "\t</div><div class='postbox-container' style='{$hide3}$width'>\n";
    212     do_meta_boxes( $screen->id, 'column3', '' );
     185    do_meta_boxes( 'dashboard', 'column3', '' );
    213186
    214187    echo "\t</div><div class='postbox-container' style='{$hide4}$width'>\n";
    215     do_meta_boxes( $screen->id, 'column4', '' );
     188    do_meta_boxes( 'dashboard', 'column4', '' );
    216189?>
    217190</div></div>
     
    409382    do_action( 'rightnow_end' );
    410383    do_action( 'activity_box_end' );
    411 }
    412 
    413 function wp_network_dashboard_right_now() {
    414     $actions = array();
    415     if ( current_user_can('create_sites') )
    416         $actions['create-site'] = '<a href="' . network_admin_url('site-new.php') . '">' . __( 'Create a New Site' ) . '</a>';
    417     if ( current_user_can('create_users') )
    418         $actions['create-user'] = '<a href="' . network_admin_url('user-new.php') . '">' . __( 'Create a New User' ) . '</a>';
    419 
    420     $c_users = get_user_count();
    421     $c_blogs = get_blog_count();
    422 
    423     $user_text = sprintf( _n( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) );
    424     $blog_text = sprintf( _n( '%s site', '%s sites', $c_blogs ), number_format_i18n( $c_blogs ) );
    425 
    426     $sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );
    427 
    428     if ( $actions ) {
    429         echo '<ul class="subsubsub">';
    430         foreach ( $actions as $class => $action ) {
    431              $actions[ $class ] = "\t<li class='$class'>$action";
    432         }
    433         echo implode( " |</li>\n", $actions ) . "</li>\n";
    434         echo '</ul>';
    435     }
    436 ?>
    437     <br class="clear" />
    438 
    439     <p class="youhave"><?php echo $sentence; ?></p>
    440     <?php do_action( 'wpmuadminresult', '' ); ?>
    441 
    442     <form name="searchform" action="<?php echo network_admin_url('users.php'); ?>" method="get">
    443         <p>
    444             <input type="text" name="s" value="" size="17" />
    445             <?php submit_button( __( 'Search Users' ), 'button', 'submit', false, array( 'id' => 'submit_users' ) ); ?>
    446         </p>
    447     </form>
    448 
    449     <form name="searchform" action="<?php echo network_admin_url('sites.php'); ?>" method="get">
    450         <p>
    451             <input type="text" name="s" value="" size="17" />
    452             <?php submit_button( __( 'Search Sites' ), 'button', 'submit', false, array( 'id' => 'submit_sites' ) ); ?>
    453         </p>
    454     </form>
    455 <?php
    456     do_action( 'mu_rightnow_end' );
    457     do_action( 'mu_activity_box_end' );
    458384}
    459385
     
    520446        <h4 id="content-label"><label for="content"><?php _e('Content') ?></label></h4>
    521447        <div class="textarea-wrap">
    522             <textarea name="content" id="content" class="mceEditor" rows="3" cols="15" tabindex="2"><?php echo esc_textarea( $post->post_content ); ?></textarea>
     448            <textarea name="content" id="content" class="mceEditor" rows="3" cols="15" tabindex="2"><?php echo $post->post_content; ?></textarea>
    523449        </div>
    524450
     
    535461            <input type="hidden" name="post_type" value="post" />
    536462            <?php wp_nonce_field('add-post'); ?>
    537             <?php submit_button( __( 'Save Draft' ), 'button', 'save', false, array( 'id' => 'save-post', 'tabindex'=> 4 ) ); ?>
     463            <input type="submit" name="save" id="save-post" class="button" tabindex="4" value="<?php esc_attr_e('Save Draft'); ?>" />
    538464            <input type="reset" value="<?php esc_attr_e( 'Reset' ); ?>" class="button" />
    539465            <span id="publishing-action">
     
    592518 * Display recent comments dashboard widget content.
    593519 *
    594  * @since 2.5.0
     520 * @since unknown
    595521 */
    596522function wp_dashboard_recent_comments() {
     
    607533
    608534    $widgets = get_option( 'dashboard_widget_options' );
    609     $total_items = isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] )
    610         ? absint( $widgets['dashboard_recent_comments']['items'] ) : 5;
     535    if ( isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] ) )
     536        $total_items = (int) $widgets['dashboard_recent_comments']['items'];
     537    else
     538        $total_items = 5;
    611539
    612540    while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) {
     
    659587
    660588    $actions_string = '';
    661     if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) {
     589    if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
    662590        // preorder it: Approve | Reply | Edit | Spam | Trash
    663591        $actions = array(
     
    678606        $delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
    679607
    680         $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
    681         $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
    682         $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . esc_attr__('Edit comment') . "'>". __('Edit') . '</a>';
    683         $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.esc_attr__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
    684         $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . esc_attr__( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */  _x( 'Spam', 'verb' ) . '</a>';
     608        $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
     609        $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
     610        $actions['edit'] = "<a href='comment.php?action=editcomment&amp;c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
     611        $actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$comment->comment_post_ID.'\');return false;" class="vim-r hide-if-no-js" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
     612        $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . /* translators: mark as spam link */  _x( 'Spam', 'verb' ) . '</a>';
    685613        if ( !EMPTY_TRASH_DAYS )
    686614            $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive'>" . __('Delete Permanently') . '</a>';
    687615        else
    688             $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . esc_attr__( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
     616            $actions['trash'] = "<a href='$trash_url' class='delete:the-comment-list:comment-$comment->comment_ID::trash=1 delete vim-d vim-destructive' title='" . __( 'Move this comment to the trash' ) . "'>" . _x('Trash', 'verb') . '</a>';
    689617
    690618        $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
     
    756684
    757685    if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-recent-comments']) ) {
    758         $number = absint( $_POST['widget-recent-comments']['items'] );
     686        $number = (int) stripslashes($_POST['widget-recent-comments']['items']);
     687        if ( $number < 1 || $number > 30 )
     688            $number = 5;
    759689        $widget_options['dashboard_recent_comments']['items'] = $number;
    760690        update_option( 'dashboard_widget_options', $widget_options );
     
    764694
    765695    echo '<p><label for="comments-number">' . __('Number of comments to show:') . '</label>';
    766     echo '<input id="comments-number" name="widget-recent-comments[items]" type="text" value="' . $number . '" size="3" /></p>';
     696    echo '<input id="comments-number" name="widget-recent-comments[items]" type="text" value="' . $number . '" size="3" /> <small>' . __( '(at most 30)' ) . '</small></p>';
    767697}
    768698
     
    774704 * Display incoming links dashboard widget content.
    775705 *
    776  * @since 2.5.0
     706 * @since unknown
    777707 */
    778708function wp_dashboard_incoming_links_output() {
     
    834764            $text = __( '%1$s linked here saying, "%3$s"' );
    835765
    836         if ( !empty($show_date) ) {
    837             if ( !empty($show_author) || !empty($show_summary) )
     766        if ( $show_date ) {
     767            if ( $show_author || $show_summary )
    838768                /* translators: incoming links feed, %4$s is the date */
    839769                $text .= ' ' . __( 'on %4$s' );
     
    866796 * {@internal Missing Short Description}}
    867797 *
    868  * @since 2.5.0
    869  *
    870  * @param string $widget_id
     798 * @since unknown
     799 *
     800 * @param int $widget_id
    871801 */
    872802function wp_dashboard_rss_output( $widget_id ) {
     
    888818 * Display secondary dashboard RSS widget feed.
    889819 *
    890  * @since 2.5.0
     820 * @since unknown
    891821 *
    892822 * @return unknown
     
    923853 * Display plugins most popular, newest plugins, and recently updated widget text.
    924854 *
    925  * @since 2.5.0
     855 * @since unknown
    926856 */
    927857function wp_dashboard_plugins_output() {
     
    1009939 * which is later replaced by AJAX call (see top of /wp-admin/index.php)
    1010940 *
    1011  * @since 2.5.0
    1012  *
    1013  * @param string $widget_id
     941 * @since unknown
     942 *
     943 * @param int $widget_id
    1014944 * @param callback $callback
    1015945 * @param array $check_urls RSS feeds
     
    1052982 * Calls widget control callback.
    1053983 *
    1054  * @since 2.5.0
     984 * @since unknown
    1055985 *
    1056986 * @param int $widget_control_id Registered Widget ID.
     
    10701000 * from RSS-type widgets.
    10711001 *
    1072  * @since 2.5.0
    1073  *
    1074  * @param string $widget_id
    1075  * @param array $form_inputs
     1002 * @since unknown
     1003 *
     1004 * @param string widget_id
     1005 * @param array form_inputs
    10761006 */
    10771007function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
     
    11051035}
    11061036
    1107 // Display File upload quota on dashboard
    1108 function wp_dashboard_quota() {
    1109     if ( !is_multisite() || !current_user_can('edit_posts') || get_site_option( 'upload_space_check_disabled' ) )
    1110         return true;
    1111 
    1112     $quota = get_space_allowed();
    1113     $used = get_dirsize( BLOGUPLOADDIR ) / 1024 / 1024;
    1114 
    1115     if ( $used > $quota )
    1116         $percentused = '100';
    1117     else
    1118         $percentused = ( $used / $quota ) * 100;
    1119     $used_color = ( $percentused < 70 ) ? ( ( $percentused >= 40 ) ? 'waiting' : 'approved' ) : 'spam';
    1120     $used = round( $used, 2 );
    1121     $percentused = number_format( $percentused );
    1122 
    1123     ?>
    1124     <p class="sub musub"><?php _e( 'Storage Space' ); ?></p>
    1125     <div class="table table_content musubtable">
    1126     <table>
    1127         <tr class="first">
    1128             <td class="first b b-posts"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB</a>' ), esc_url( admin_url( 'upload.php' ) ), $quota ); ?></td>
    1129             <td class="t posts"><?php _e( 'Space Allowed' ); ?></td>
    1130         </tr>
    1131     </table>
    1132     </div>
    1133     <div class="table table_discussion musubtable">
    1134     <table>
    1135         <tr class="first">
    1136             <td class="b b-comments"><?php printf( __( '<a href="%1$s" title="Manage Uploads" class="musublink">%2$sMB (%3$s%%)</a>' ), esc_url( admin_url( 'upload.php' ) ), $used, $percentused ); ?></td>
    1137             <td class="last t comments <?php echo $used_color;?>"><?php _e( 'Space Used' );?></td>
    1138         </tr>
    1139     </table>
    1140     </div>
    1141     <br class="clear" />
    1142     <?php
    1143 }
    1144 add_action( 'activity_box_end', 'wp_dashboard_quota' );
    1145 
    11461037/**
    11471038 * Empty function usable by plugins to output empty dashboard widget (to be populated later by JS).
Note: See TracChangeset for help on using the changeset viewer.