Make WordPress Core

Changeset 14776


Ignore:
Timestamp:
05/21/2010 12:57:49 PM (15 years ago)
Author:
dd32
Message:

We're not as bold as some people make us out to be. Move the maximum upload size from a Heading to a paragraph text. Fix screen formatting on Multisite when over quota. see #12853

File:
1 edited

Legend:

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

    r14730 r14776  
    14011401    $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
    14021402
     1403    $upload_size_unit = $max_upload_size =  wp_max_upload_size();
     1404    $sizes = array( 'KB', 'MB', 'GB' );
     1405    for ( $u = -1; $upload_size_unit > 1024 && $u < count( $sizes ) - 1; $u++ )
     1406        $upload_size_unit /= 1024;
     1407    if ( $u < 0 ) {
     1408        $upload_size_unit = 0;
     1409        $u = 0;
     1410    } else {
     1411        $upload_size_unit = (int) $upload_size_unit;
     1412    }
    14031413?>
    14041414<script type="text/javascript">
     
    14221432<?php } ?>
    14231433</div>
    1424 <div id="media-upload-size">
    1425 <?php
    1426     $upload_size_unit = $max_upload_size =  wp_max_upload_size();
    1427     $sizes = array( 'KB', 'MB', 'GB' );
    1428     for( $u = -1; $upload_size_unit > 1024 && $u < count( $sizes ) - 1; $u++ )
    1429         $upload_size_unit /= 1024;
    1430     if ( $u < 0 ) {
    1431         $upload_size_unit = 0;
    1432         $u = 0;
    1433     } else {
    1434         $upload_size_unit = (int) $upload_size_unit;
    1435     }
    1436     printf( '<h3>' . __( 'Maximum upload file size: %d%s' ) . '</h3>', $upload_size_unit, $sizes[$u] );
    1437 ?>
    1438 </div>
    1439 
    14401434<?php
    14411435// Check quota for this blog if multisite
    1442 if ( is_multisite() && !is_upload_space_available() )
    1443     wp_die( __('Sorry, you must delete files before you can upload any more.') );
     1436if ( is_multisite() && !is_upload_space_available() ) {
     1437    echo '<p>' . __('Sorry, you must delete files before you can upload any more.') . '</p>';
     1438    return;
     1439}
    14441440
    14451441do_action('pre-upload-ui');
     
    14641460            post_params : {
    14651461                "post_id" : "<?php echo $post_id; ?>",
    1466                 "auth_cookie" : "<?php if ( is_ssl() ) echo $_COOKIE[SECURE_AUTH_COOKIE]; else echo $_COOKIE[AUTH_COOKIE]; ?>",
     1462                "auth_cookie" : "<?php echo (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]); ?>",
    14671463                "logged_in_cookie": "<?php echo $_COOKIE[LOGGED_IN_COOKIE]; ?>",
    14681464                "_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>",
     
    15001496    <?php _e( 'Choose files to upload' ); ?>
    15011497    <div id="flash-browse-button"></div>
    1502     <span><input id="cancel-upload" disabled="disabled" onclick="cancelUpload()" type="button" value="<?php esc_attr_e('Cancel Upload'); ?>" class="button" /></span>
     1498    <span><input id="cancel-upload" disabled="disabled" onClick="cancelUpload()" type="button" value="<?php esc_attr_e('Cancel Upload'); ?>" class="button" /></span>
    15031499    </div>
     1500    <p class="media-upload-size"><?php printf( __( 'Maximum upload file size: %d%s' ), $upload_size_unit, $sizes[$u] ); ?></p>
    15041501<?php do_action('post-flash-upload-ui'); ?>
    15051502    <p class="howto"><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
     
    15141511    </p>
    15151512    <div class="clear"></div>
     1513    <p class="media-upload-size"><?php printf( __( 'Maximum upload file size: %d%s' ), $upload_size_unit, $sizes[$u] ); ?></p>
    15161514    <?php if ( is_lighttpd_before_150() ): ?>
    15171515    <p><?php _e('If you want to use all capabilities of the uploader, like uploading multiple files at once, please upgrade to lighttpd 1.5.'); ?></p>
Note: See TracChangeset for help on using the changeset viewer.