Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r15458 r17129  
    1010 * Registers dashboard widgets.
    1111 *
    12  * handles POST data, sets up filters.
    13  *
    14  * @since unknown
     12 * Handles POST data, sets up filters.
     13 *
     14 * @since 2.5.0
    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();
    1920
    2021    $update = false;
     
    2627
    2728    // Right Now
    28     wp_add_dashboard_widget( 'dashboard_right_now', __( 'Right Now' ), 'wp_dashboard_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' );
    2934
    3035    // Recent Comments Widget
    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' );
     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    }
    3946
    4047    // Incoming Links Widget
    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' );
     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    }
    5362
    5463    // WP Plugins Widget
    55     if ( current_user_can( 'install_plugins' ) )
     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' ) ) )
    5665        wp_add_dashboard_widget( 'dashboard_plugins', __( 'Plugins' ), 'wp_dashboard_plugins' );
    5766
    5867    // QuickPress Widget
    59     if ( current_user_can('edit_posts') )
     68    if ( is_blog_admin() && current_user_can('edit_posts') )
    6069        wp_add_dashboard_widget( 'dashboard_quick_press', __( 'QuickPress' ), 'wp_dashboard_quick_press' );
    6170
    6271    // Recent Drafts
    63     if ( current_user_can('edit_posts') )
     72    if ( is_blog_admin() && current_user_can('edit_posts') )
    6473        wp_add_dashboard_widget( 'dashboard_recent_drafts', __('Recent Drafts'), 'wp_dashboard_recent_drafts' );
    6574
     
    95104
    96105    // Hook to register new widgets
    97     do_action( 'wp_dashboard_setup' );
    98 
    99106    // Filter widget order
    100     $dashboard_widgets = apply_filters( 'wp_dashboard_widgets', array() );
     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    }
    101117
    102118    foreach ( $dashboard_widgets as $widget_id ) {
     
    116132        update_option( 'dashboard_widget_options', $widget_options );
    117133
    118     do_action('do_meta_boxes', 'dashboard', 'normal', '');
    119     do_action('do_meta_boxes', 'dashboard', 'side', '');
     134    do_action('do_meta_boxes', $screen->id, 'normal', '');
     135    do_action('do_meta_boxes', $screen->id, 'side', '');
    120136}
    121137
    122138function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_callback = null ) {
     139    $screen = get_current_screen();
    123140    global $wp_dashboard_control_callbacks;
     141
    124142    if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) {
    125143        $wp_dashboard_control_callbacks[$widget_id] = $control_callback;
     
    127145            list($url) = explode( '#', add_query_arg( 'edit', false ), 2 );
    128146            $widget_name .= ' <span class="postbox-title-action"><a href="' . esc_url( $url ) . '">' . __( 'Cancel' ) . '</a></span>';
    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');
     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
    136161    $location = 'normal';
    137162    if ( in_array($widget_id, $side_widgets) )
    138163        $location = 'side';
    139     add_meta_box( $widget_id, $widget_name , $callback, 'dashboard', $location, 'core' );
     164    add_meta_box( $widget_id, $widget_name , $callback, $screen->id, $location, 'core' );
    140165}
    141166
     
    143168    echo '<form action="" method="post" class="dashboard-widget-control-form">';
    144169    wp_dashboard_trigger_widget_control( $meta_box['id'] );
    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 
     170    echo '<input type="hidden" name="widget_id" value="' . esc_attr($meta_box['id']) . '" />';
     171    submit_button( __('Submit') );
    147172    echo '</form>';
    148173}
     
    151176 * Displays the dashboard.
    152177 *
    153  * @since unknown
     178 * @since 2.5.0
    154179 */
    155180function wp_dashboard() {
    156181    global $screen_layout_columns;
     182
     183    $screen = get_current_screen();
    157184
    158185    $hide2 = $hide3 = $hide4 = '';
     
    177204<?php
    178205    echo "\t<div class='postbox-container' style='$width'>\n";
    179     do_meta_boxes( 'dashboard', 'normal', '' );
     206    do_meta_boxes( $screen->id, 'normal', '' );
    180207
    181208    echo "\t</div><div class='postbox-container' style='{$hide2}$width'>\n";
    182     do_meta_boxes( 'dashboard', 'side', '' );
     209    do_meta_boxes( $screen->id, 'side', '' );
    183210
    184211    echo "\t</div><div class='postbox-container' style='{$hide3}$width'>\n";
    185     do_meta_boxes( 'dashboard', 'column3', '' );
     212    do_meta_boxes( $screen->id, 'column3', '' );
    186213
    187214    echo "\t</div><div class='postbox-container' style='{$hide4}$width'>\n";
    188     do_meta_boxes( 'dashboard', 'column4', '' );
     215    do_meta_boxes( $screen->id, 'column4', '' );
    189216?>
    190217</div></div>
     
    382409    do_action( 'rightnow_end' );
    383410    do_action( 'activity_box_end' );
     411}
     412
     413function 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' );
    384458}
    385459
     
    446520        <h4 id="content-label"><label for="content"><?php _e('Content') ?></label></h4>
    447521        <div class="textarea-wrap">
    448             <textarea name="content" id="content" class="mceEditor" rows="3" cols="15" tabindex="2"><?php echo $post->post_content; ?></textarea>
     522            <textarea name="content" id="content" class="mceEditor" rows="3" cols="15" tabindex="2"><?php echo esc_textarea( $post->post_content ); ?></textarea>
    449523        </div>
    450524
     
    461535            <input type="hidden" name="post_type" value="post" />
    462536            <?php wp_nonce_field('add-post'); ?>
    463             <input type="submit" name="save" id="save-post" class="button" tabindex="4" value="<?php esc_attr_e('Save Draft'); ?>" />
     537            <?php submit_button( __( 'Save Draft' ), 'button', 'save', false, array( 'id' => 'save-post', 'tabindex'=> 4 ) ); ?>
    464538            <input type="reset" value="<?php esc_attr_e( 'Reset' ); ?>" class="button" />
    465539            <span id="publishing-action">
     
    518592 * Display recent comments dashboard widget content.
    519593 *
    520  * @since unknown
     594 * @since 2.5.0
    521595 */
    522596function wp_dashboard_recent_comments() {
     
    533607
    534608    $widgets = get_option( 'dashboard_widget_options' );
    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;
     609    $total_items = isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] )
     610        ? absint( $widgets['dashboard_recent_comments']['items'] ) : 5;
    539611
    540612    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" ) ) {
     
    587659
    588660    $actions_string = '';
    589     if ( current_user_can('edit_post', $comment->comment_post_ID) ) {
     661    if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) {
    590662        // preorder it: Approve | Reply | Edit | Spam | Trash
    591663        $actions = array(
     
    606678        $delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
    607679
    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>';
     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>';
    613685        if ( !EMPTY_TRASH_DAYS )
    614686            $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>';
    615687        else
    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>';
     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>';
    617689
    618690        $actions = apply_filters( 'comment_row_actions', array_filter($actions), $comment );
     
    684756
    685757    if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-recent-comments']) ) {
    686         $number = (int) stripslashes($_POST['widget-recent-comments']['items']);
    687         if ( $number < 1 || $number > 30 )
    688             $number = 5;
     758        $number = absint( $_POST['widget-recent-comments']['items'] );
    689759        $widget_options['dashboard_recent_comments']['items'] = $number;
    690760        update_option( 'dashboard_widget_options', $widget_options );
     
    694764
    695765    echo '<p><label for="comments-number">' . __('Number of comments to show:') . '</label>';
    696     echo '<input id="comments-number" name="widget-recent-comments[items]" type="text" value="' . $number . '" size="3" /> <small>' . __( '(at most 30)' ) . '</small></p>';
     766    echo '<input id="comments-number" name="widget-recent-comments[items]" type="text" value="' . $number . '" size="3" /></p>';
    697767}
    698768
     
    704774 * Display incoming links dashboard widget content.
    705775 *
    706  * @since unknown
     776 * @since 2.5.0
    707777 */
    708778function wp_dashboard_incoming_links_output() {
     
    764834            $text = __( '%1$s linked here saying, "%3$s"' );
    765835
    766         if ( $show_date ) {
    767             if ( $show_author || $show_summary )
     836        if ( !empty($show_date) ) {
     837            if ( !empty($show_author) || !empty($show_summary) )
    768838                /* translators: incoming links feed, %4$s is the date */
    769839                $text .= ' ' . __( 'on %4$s' );
     
    796866 * {@internal Missing Short Description}}
    797867 *
    798  * @since unknown
    799  *
    800  * @param int $widget_id
     868 * @since 2.5.0
     869 *
     870 * @param string $widget_id
    801871 */
    802872function wp_dashboard_rss_output( $widget_id ) {
     
    818888 * Display secondary dashboard RSS widget feed.
    819889 *
    820  * @since unknown
     890 * @since 2.5.0
    821891 *
    822892 * @return unknown
     
    853923 * Display plugins most popular, newest plugins, and recently updated widget text.
    854924 *
    855  * @since unknown
     925 * @since 2.5.0
    856926 */
    857927function wp_dashboard_plugins_output() {
     
    9391009 * which is later replaced by AJAX call (see top of /wp-admin/index.php)
    9401010 *
    941  * @since unknown
    942  *
    943  * @param int $widget_id
     1011 * @since 2.5.0
     1012 *
     1013 * @param string $widget_id
    9441014 * @param callback $callback
    9451015 * @param array $check_urls RSS feeds
     
    9821052 * Calls widget control callback.
    9831053 *
    984  * @since unknown
     1054 * @since 2.5.0
    9851055 *
    9861056 * @param int $widget_control_id Registered Widget ID.
     
    10001070 * from RSS-type widgets.
    10011071 *
    1002  * @since unknown
    1003  *
    1004  * @param string widget_id
    1005  * @param array form_inputs
     1072 * @since 2.5.0
     1073 *
     1074 * @param string $widget_id
     1075 * @param array $form_inputs
    10061076 */
    10071077function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
     
    10351105}
    10361106
     1107// Display File upload quota on dashboard
     1108function 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}
     1144add_action( 'activity_box_end', 'wp_dashboard_quota' );
     1145
    10371146/**
    10381147 * 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.