<!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" />
<title>[22764] trunk/wp-admin: media-new.php: Remove unused scripts, strings, error handling, save handling, and save button.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/22764">22764</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-11-21 15:10:17 +0000 (Wed, 21 Nov 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>media-new.php: Remove unused scripts, strings, error handling, save handling, and save button. fixes <a href="http://core.trac.wordpress.org/ticket/22083">#22083</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmediaphp">trunk/wp-admin/includes/media.php</a></li>
<li><a href="#trunkwpadminmedianewphp">trunk/wp-admin/media-new.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 (22763 => 22764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/media.php        2012-11-21 14:58:31 UTC (rev 22763)
+++ trunk/wp-admin/includes/media.php        2012-11-21 15:10:17 UTC (rev 22764)
</span><span class="lines">@@ -2185,16 +2185,11 @@
</span><span class="cx"> add_action('post-html-upload-ui', 'media_upload_html_bypass');
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Displays the "After a file has been uploaded..." message.
</del><ins>+ * Used to display a "After a file has been uploaded..." help message.
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.3.0
</span><span class="cx"> */
</span><del>-function media_upload_text_after() {
-        ?>
-        <span class="after-file-upload"><?php _e('After a file has been uploaded, you can add titles and descriptions.'); ?></span>
-        <?php
-}
-add_action('post-upload-ui', 'media_upload_text_after', 5);
</del><ins>+function media_upload_text_after() {}
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Displays the checkbox to scale images.
</span></span></pre></div>
<a id="trunkwpadminmedianewphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/media-new.php (22763 => 22764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/media-new.php        2012-11-21 14:58:31 UTC (rev 22763)
+++ trunk/wp-admin/media-new.php        2012-11-21 15:10:17 UTC (rev 22764)
</span><span class="lines">@@ -16,65 +16,50 @@
</span><span class="cx">         wp_die(__('You do not have permission to upload files.'));
</span><span class="cx">
</span><span class="cx"> wp_enqueue_script('plupload-handlers');
</span><del>-wp_enqueue_script('image-edit');
-wp_enqueue_script('set-post-thumbnail' );
-wp_enqueue_style('imgareaselect');
-wp_enqueue_script( 'media-gallery' );
</del><span class="cx">
</span><del>-$errors = array();
-
</del><span class="cx"> unset( $_REQUEST['post_id'] );
</span><span class="cx">
</span><span class="cx"> if ( $_POST ) {
</span><ins>+        $location = 'upload.php';
</ins><span class="cx">         if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
</span><span class="cx">                 check_admin_referer('media-form');
</span><span class="cx">                 // Upload File button was clicked
</span><span class="cx">                 $id = media_handle_upload('async-upload', $_REQUEST['post_id']);
</span><del>-                unset($_FILES);
-                if ( is_wp_error($id) ) {
-                        $errors['upload_error'] = $id;
-                        $id = false;
-                }
</del><ins>+                if ( is_wp_error( $id ) )
+                        $location .= '?message=3';
</ins><span class="cx">         }
</span><del>-
-        $errors = array_merge($errors, (array) media_upload_form_handler());
-
-        $location = 'upload.php';
-        if ( $errors )
-                $location .= '?message=3';
-
-        wp_redirect( admin_url($location) );
</del><ins>+        wp_redirect( admin_url( $location ) );
</ins><span class="cx">         exit;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-        $title = __('Upload New Media');
-        $parent_file = 'upload.php';
-        get_current_screen()->add_help_tab( array(
-        'id'                => 'overview',
-        'title'                => __('Overview'),
-        'content'        =>
-                '<p>' . __('You can upload media files here without creating a post first. This allows you to upload files to use with posts and pages later and/or to get a web link for a particular file that you can share. There are three options for uploading files:') . '</p>' .
-                '<ul>' .
-                        '<li>' . __('<strong>Drag and drop</strong> your files into the area below. Multiple files are allowed.') . '</li>' .
-                        '<li>' . __('Clicking <strong>Select Files</strong> opens a navigation window showing you files in your operating system. Selecting <strong>Open</strong> after clicking on the file you want activates a progress bar on the uploader screen.') . '</li>' .
-                        '<li>' . __('Revert to the <strong>Browser Uploader</strong> by clicking the link below the drag and drop box.') . '</li>' .
-                '</ul>' .
-                '<p>' . __('Basic image editing is available after upload is complete. Make sure you click Save before leaving this screen.') . '</p>'
-        ) );
-        get_current_screen()->set_help_sidebar(
-                '<p><strong>' . __('For more information:') . '</strong></p>' .
-                '<p>' . __('<a href="http://codex.wordpress.org/Media_Add_New_Screen" target="_blank">Documentation on Uploading Media Files</a>') . '</p>' .
-                '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
-        );
</del><ins>+$title = __('Upload New Media');
+$parent_file = 'upload.php';
</ins><span class="cx">
</span><del>-        require_once('./admin-header.php');
</del><ins>+get_current_screen()->add_help_tab( array(
+'id'                => 'overview',
+'title'                => __('Overview'),
+'content'        =>
+        '<p>' . __('You can upload media files here without creating a post first. This allows you to upload files to use with posts and pages later and/or to get a web link for a particular file that you can share. There are three options for uploading files:') . '</p>' .
+        '<ul>' .
+                '<li>' . __('<strong>Drag and drop</strong> your files into the area below. Multiple files are allowed.') . '</li>' .
+                '<li>' . __('Clicking <strong>Select Files</strong> opens a navigation window showing you files in your operating system. Selecting <strong>Open</strong> after clicking on the file you want activates a progress bar on the uploader screen.') . '</li>' .
+                '<li>' . __('Revert to the <strong>Browser Uploader</strong> by clicking the link below the drag and drop box.') . '</li>' .
+        '</ul>'
+) );
+get_current_screen()->set_help_sidebar(
+        '<p><strong>' . __('For more information:') . '</strong></p>' .
+        '<p>' . __('<a href="http://codex.wordpress.org/Media_Add_New_Screen" target="_blank">Documentation on Uploading Media Files</a>') . '</p>' .
+        '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
+);
</ins><span class="cx">
</span><del>-        $form_class = 'media-upload-form wp-upload-form type-form validate';
</del><ins>+require_once( ABSPATH . 'wp-admin/admin-header.php' );
</ins><span class="cx">
</span><del>-        if ( get_user_setting('uploader') )
-                $form_class .= ' html-uploader';
-        ?>
-        <div class="wrap">
</del><ins>+$form_class = 'media-upload-form wp-upload-form type-form validate';
+
+if ( get_user_setting('uploader') || isset( $_GET['browser-uploader'] ) )
+        $form_class .= ' html-uploader';
+?>
+<div class="wrap">
</ins><span class="cx">         <?php screen_icon(); ?>
</span><span class="cx">         <h2><?php echo esc_html( $title ); ?></h2>
</span><span class="cx">
</span><span class="lines">@@ -83,22 +68,13 @@
</span><span class="cx">         <?php media_upload_form(); ?>
</span><span class="cx">
</span><span class="cx">         <script type="text/javascript">
</span><del>-        jQuery(function($){
-                var preloaded = $(".media-item.preloaded");
-                if ( preloaded.length > 0 ) {
-                        preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');});
-                }
-                updateMediaForm();
-                post_id = 0;
-                shortform = 3;
-        });
</del><ins>+        var post_id = 0, shortform = 3;
</ins><span class="cx">         </script>
</span><span class="cx">         <input type="hidden" name="post_id" id="post_id" value="0" />
</span><span class="cx">         <?php wp_nonce_field('media-form'); ?>
</span><span class="cx">         <div id="media-items" class="hide-if-no-js"></div>
</span><del>-        <?php submit_button( __( 'Save all changes' ), 'button savebutton hidden', 'save' ); ?>
</del><span class="cx">         </form>
</span><del>-        </div>
</del><ins>+</div>
</ins><span class="cx">
</span><span class="cx"> <?php
</span><del>-        include('./admin-footer.php');
</del><span class="cx">\ No newline at end of file
</span><ins>+include( ABSPATH . 'wp-admin/admin-footer.php' );
</ins></span></pre>
</div>
</div>
</body>
</html>