<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[14776] trunk/wp-admin/includes/media.php: We'
re not as bold as some people make us out to be.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14776">14776</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-05-21 12:57:49 +0000 (Fri, 21 May 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>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 <a href="http://trac.wordpress.org/ticket/12853">#12853</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmediaphp">trunk/wp-admin/includes/media.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesmediaphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/media.php (14775 => 14776)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/media.php        2010-05-21 03:31:35 UTC (rev 14775)
+++ trunk/wp-admin/includes/media.php        2010-05-21 12:57:49 UTC (rev 14776)
</span><span class="lines">@@ -1400,6 +1400,16 @@
</span><span class="cx">         $flash = apply_filters('flash_uploader', $flash);
</span><span class="cx">         $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0;
</span><span class="cx">
</span><ins>+        $upload_size_unit = $max_upload_size = wp_max_upload_size();
+        $sizes = array( 'KB', 'MB', 'GB' );
+        for ( $u = -1; $upload_size_unit > 1024 && $u < count( $sizes ) - 1; $u++ )
+                $upload_size_unit /= 1024;
+        if ( $u < 0 ) {
+                $upload_size_unit = 0;
+                $u = 0;
+        } else {
+                $upload_size_unit = (int) $upload_size_unit;
+        }
</ins><span class="cx"> ?>
</span><span class="cx"> <script type="text/javascript">
</span><span class="cx"> //<![CDATA[
</span><span class="lines">@@ -1421,26 +1431,12 @@
</span><span class="cx">         <?php echo $errors['upload_error']->get_error_message(); ?>
</span><span class="cx"> <?php } ?>
</span><span class="cx"> </div>
</span><del>-<div id="media-upload-size">
-<?php
-        $upload_size_unit = $max_upload_size = wp_max_upload_size();
-        $sizes = array( 'KB', 'MB', 'GB' );
-        for( $u = -1; $upload_size_unit > 1024 && $u < count( $sizes ) - 1; $u++ )
-                $upload_size_unit /= 1024;
-        if ( $u < 0 ) {
-                $upload_size_unit = 0;
-                $u = 0;
-        } else {
-                $upload_size_unit = (int) $upload_size_unit;
-        }
-        printf( '<h3>' . __( 'Maximum upload file size: %d%s' ) . '</h3>', $upload_size_unit, $sizes[$u] );
-?>
-</div>
-
</del><span class="cx"> <?php
</span><span class="cx"> // Check quota for this blog if multisite
</span><del>-if ( is_multisite() && !is_upload_space_available() )
-        wp_die( __('Sorry, you must delete files before you can upload any more.') );
</del><ins>+if ( is_multisite() && !is_upload_space_available() ) {
+        echo '<p>' . __('Sorry, you must delete files before you can upload any more.') . '</p>';
+        return;
+}
</ins><span class="cx">
</span><span class="cx"> do_action('pre-upload-ui');
</span><span class="cx">
</span><span class="lines">@@ -1463,7 +1459,7 @@
</span><span class="cx">                         file_types: "<?php echo apply_filters('upload_file_glob', '*.*'); ?>",
</span><span class="cx">                         post_params : {
</span><span class="cx">                                 "post_id" : "<?php echo $post_id; ?>",
</span><del>-                                "auth_cookie" : "<?php if ( is_ssl() ) echo $_COOKIE[SECURE_AUTH_COOKIE]; else echo $_COOKIE[AUTH_COOKIE]; ?>",
</del><ins>+                                "auth_cookie" : "<?php echo (is_ssl() ? $_COOKIE[SECURE_AUTH_COOKIE] : $_COOKIE[AUTH_COOKIE]); ?>",
</ins><span class="cx">                                 "logged_in_cookie": "<?php echo $_COOKIE[LOGGED_IN_COOKIE]; ?>",
</span><span class="cx">                                 "_wpnonce" : "<?php echo wp_create_nonce('media-form'); ?>",
</span><span class="cx">                                 "type" : "<?php echo $type; ?>",
</span><span class="lines">@@ -1499,8 +1495,9 @@
</span><span class="cx">         <div>
</span><span class="cx">         <?php _e( 'Choose files to upload' ); ?>
</span><span class="cx">         <div id="flash-browse-button"></div>
</span><del>-        <span><input id="cancel-upload" disabled="disabled" onclick="cancelUpload()" type="button" value="<?php esc_attr_e('Cancel Upload'); ?>" class="button" /></span>
</del><ins>+        <span><input id="cancel-upload" disabled="disabled" onClick="cancelUpload()" type="button" value="<?php esc_attr_e('Cancel Upload'); ?>" class="button" /></span>
</ins><span class="cx">         </div>
</span><ins>+        <p class="media-upload-size"><?php printf( __( 'Maximum upload file size: %d%s' ), $upload_size_unit, $sizes[$u] ); ?></p>
</ins><span class="cx"> <?php do_action('post-flash-upload-ui'); ?>
</span><span class="cx">         <p class="howto"><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></p>
</span><span class="cx"> </div>
</span><span class="lines">@@ -1513,6 +1510,7 @@
</span><span class="cx">         <input type="file" name="async-upload" id="async-upload" /> <input type="submit" class="button" name="html-upload" value="<?php esc_attr_e('Upload'); ?>" /> <a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e('Cancel'); ?></a>
</span><span class="cx">         </p>
</span><span class="cx">         <div class="clear"></div>
</span><ins>+        <p class="media-upload-size"><?php printf( __( 'Maximum upload file size: %d%s' ), $upload_size_unit, $sizes[$u] ); ?></p>
</ins><span class="cx">         <?php if ( is_lighttpd_before_150() ): ?>
</span><span class="cx">         <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>
</span><span class="cx">         <?php endif;?>
</span></span></pre>
</div>
</div>
</body>
</html>