Ticket #3191: 3191d.diff
File 3191d.diff, 6.2 KB (added by , 18 years ago) |
---|
-
wp-admin/upload-js.php
29 29 return; 30 30 $$('a.file-link').each( function(i) { 31 31 var id = i.id.split('-').pop(); 32 i.onclick = function(e) { theFileList .imageView(id, e); }32 i.onclick = function(e) { theFileList[ 'inline' == theFileList.style ? 'imageView' : 'editView' ](id, e); } 33 33 } ); 34 34 }, 35 35 … … 117 117 this.prepView(id); 118 118 var h = ''; 119 119 120 h += "<form id='upload-file' method='post' action='upload.php?style=inline&tab=upload&post_id=" + this.postID + "'>"; 120 var action = 'upload.php?style=' + this.style + '&tab=upload'; 121 if ( this.postID ) 122 action += '&post_id=' + this.postID; 123 h += "<form id='upload-file' method='post' action='" + action + "'>"; 121 124 h += "<div id='file-title'>" 122 125 if ( !this.currentImage.thumb ) 123 126 h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>"; -
wp-admin/upload-rtl.css
18 18 table { float: right; } 19 19 20 20 #the-attachment-links { float: left; } 21 22 #th { text-align: left; } -
wp-admin/upload.php
14 14 15 15 do_action( "upload_files_$tab" ); 16 16 17 add_action( 'admin_head', 'wp_upload_admin_head' );18 19 17 $pid = 0; 20 18 if ( $post_id < 0 ) 21 19 $pid = $post_id; … … 51 49 } 52 50 } 53 51 54 include_once('admin-header.php'); 52 if ( 'inline' == $style ) : ?> 53 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 54 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> 55 <head> 56 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" /> 57 <title><?php bloginfo('name') ?> › <?php _e('Uploads'); ?> — WordPress</title> 58 <link rel="stylesheet" href="<?php echo get_option('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" /> 59 <?php if ( ('rtl' == $wp_locale->text_direction) ) : ?> 60 <link rel="stylesheet" href="<?php echo get_option('siteurl') ?>/wp-admin/rtl.css?version=<?php bloginfo('version'); ?>" type="text/css" /> 61 <?php endif; ?> 62 <script type="text/javascript"> 63 //<![CDATA[ 64 function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}} 65 //]]> 66 </script> 67 <?php do_action('admin_print_scripts'); wp_upload_admin_head(); ?> 68 </head> 69 <body> 70 <?php 71 else : 72 add_action( 'admin_head', 'wp_upload_admin_head' ); 73 include_once('admin-header.php'); 74 endif; 55 75 56 76 echo "<ul id='upload-menu'>\n"; 57 77 foreach ( $wp_upload_tabs as $t => $tab_array ) { // We've already done the current_user_can check … … 95 115 96 116 echo "</div>\n"; 97 117 98 include_once('admin-footer.php'); 99 ?> 118 if ( 'inline' != $style ) : 119 include_once('admin-footer.php'); 120 else : ?> 121 <script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script> 122 123 </body> 124 </html> 125 <?php endif; ?> -
wp-admin/upload-functions.php
101 101 echo '[ '; 102 102 echo '<a href="' . get_permalink() . '">' . __('view') . '</a>'; 103 103 echo ' | '; 104 echo '<a href="' . wp_specialchars( add_query_arg( 'action', 'view' ), 1 ) . '">' . __(' options') . '</a>';104 echo '<a href="' . wp_specialchars( add_query_arg( 'action', 'view' ), 1 ) . '">' . __('links') . '</a>'; 105 105 echo ' | '; 106 106 echo '<a href="' . wp_specialchars( remove_query_arg( array('action','ID') ), 1 ) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>'; 107 107 echo ' ]'; ?></span> … … 297 297 endwhile; endif; 298 298 break; 299 299 default : 300 global $tab, $post_id ;300 global $tab, $post_id, $style; 301 301 add_action( 'pre_get_posts', 'wp_upload_grab_attachments' ); 302 302 if ( 'browse' == $tab && $post_id ) 303 303 add_filter( 'posts_where', 'wp_upload_posts_where' ); … … 309 309 310 310 echo "<ul id='upload-files'>\n"; 311 311 if ( have_posts() ) : while ( have_posts() ) : the_post(); 312 $href = wp_specialchars( add_query_arg( array('action' => 'view', 'ID' => get_the_ID()) ), 1 ); 312 $href = wp_specialchars( add_query_arg( array( 313 'action' => 'inline' == $style ? 'view' : 'edit', 314 'ID' => get_the_ID()) 315 ), 1 ); 313 316 314 317 echo "\t<li id='file-"; 315 318 the_ID(); … … 331 334 332 335 333 336 function wp_upload_tab_browse_action() { 334 wp_enqueue_script('upload'); 337 global $style; 338 if ( 'inline' == $style ) 339 wp_enqueue_script('upload'); 335 340 } 336 341 337 342 add_action( 'upload_files_browse', 'wp_upload_tab_browse_action' ); … … 344 349 echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload-rtl.css?version=' . get_bloginfo('version') . "' type='text/css' />\n"; 345 350 if ( 'inline' == @$_GET['style'] ) { 346 351 echo "<style type='text/css'>\n"; 347 echo "\t#wphead, #user_info, #adminmenu, #submenu, #footer { display: none; }\n";348 352 echo "\tbody { height: 14em; overflow: hidden; }\n"; 349 353 echo "\t#upload-content { overflow-y: auto; }\n"; 350 354 echo "\t#upload-file { position: absolute; }\n"; -
wp-admin/upload.css
90 90 91 91 #upload-files li { margin: 0 0 15px 15px; } 92 92 93 #upload-files a, a.file-link {93 #upload-files a, #upload-file-view a, a.file-link { 94 94 border: none; 95 95 text-decoration: none; 96 96 } 97 97 98 #upload-file-view a img { padding-bottom: .2em; border-bottom: 1px solid #6699CC; } 99 98 100 #upload-files a.file-link { 99 101 display: block; 100 102 width: 130px; … … 127 129 padding: 0; 128 130 } 129 131 130 th { vertical-align: text-top; }132 th { text-align: right; vertical-align: text-top; } 131 133 132 134 tr, td, th { 133 135 margin-top: 0;