Changeset 8998
- Timestamp:
- 09/27/2008 08:17:55 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/async-upload.php
r8618 r8998 27 27 // just fetch the detail form for that attachment 28 28 if ( ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) { 29 echo get_media_item($id); 29 if ( 2 == $_REQUEST['fetch'] ) { 30 add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2); 31 echo get_media_item($id, array( 'send' => false, 'delete' => false )); 32 } else { 33 echo get_media_item($id); 34 } 30 35 exit; 31 36 } -
trunk/wp-admin/css/colors-classic.css
r8988 r8998 63 63 li.widget-list-control-item, div.nav, .tablenav, #dashboard-widgets p.dashboard-widget-links, 64 64 ul.view-switch li.current, .form-table tr, #poststuff h3, #replyhandle, 65 .login form, h3.info-box-title, #post-status-info, #edit-settings-wrap { 65 .login form, h3.info-box-title, #post-status-info, #edit-settings-wrap, 66 #wpbody-content .describe tr { 66 67 background-color: #cfebf7; 67 68 } … … 147 148 } 148 149 149 .form-table td, .form-table th { 150 .form-table td, 151 .form-table th, 152 #wpbody-content .describe td, 153 #wpbody-content .describe th { 150 154 border-bottom-color: #fff; 151 155 } -
trunk/wp-admin/css/colors-fresh.css
r8988 r8998 63 63 li.widget-list-control-item, div.nav, .tablenav, #dashboard-widgets p.dashboard-widget-links, 64 64 ul.view-switch li.current, .form-table tr, #poststuff h3, #replyhandle, 65 .login form, h3.info-box-title, #post-status-info, #edit-settings-wrap { 65 .login form, h3.info-box-title, #post-status-info, #edit-settings-wrap, 66 #wpbody-content .describe tr { 66 67 background-color: #eaf3fa; 67 68 } … … 147 148 } 148 149 149 .form-table td, .form-table th { 150 .form-table td, 151 .form-table th, 152 #wpbody-content .describe td, 153 #wpbody-content .describe th { 150 154 border-bottom-color: #fff; 151 155 } -
trunk/wp-admin/includes/media.php
r8959 r8998 759 759 global $redir_tab; 760 760 761 $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true );761 $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true, 'show_title' => true ); 762 762 $args = wp_parse_args( $args, $default_args ); 763 763 extract( $args, EXTR_SKIP ); … … 806 806 807 807 $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case 808 $display_title = wp_html_excerpt($display_title, 60);808 $display_title = $show_title ? "<div class='filename new'>" . wp_html_excerpt($display_title, 60) . "</div>" : ''; 809 809 810 810 $gallery = ( (isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) && 'gallery' == $redir_tab) ) ? true : false; … … 827 827 $toggle_links 828 828 $order 829 <div class='filename new'>$display_title</div>829 $display_title 830 830 <table class='slidetoggle describe $class'> 831 831 <thead class='media-item-info'> -
trunk/wp-admin/media-upload.php
r8645 r8998 12 12 /** Load WordPress Administration Bootstrap */ 13 13 require_once('admin.php'); 14 15 if (!current_user_can('upload_files')) 16 wp_die(__('You do not have permission to upload files.')); 17 14 18 wp_enqueue_script('swfupload'); 15 19 wp_enqueue_script('swfupload-degrade'); … … 18 22 19 23 @header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 20 21 if (!current_user_can('upload_files'))22 wp_die(__('You do not have permission to upload files.'));23 24 24 25 // IDs should be integers … … 30 31 wp_die(__("You are not allowed to be here")); 31 32 32 // upload type: image, video, file, ..? 33 if ( isset($_GET['type']) ) 34 $type = strval($_GET['type']); 35 else 36 $type = apply_filters('media_upload_default_type', 'file'); 33 if ( isset($_GET['inline']) ) { 34 35 if ( isset($_GET['upload-page-form']) ) { 36 $errors = media_upload_form_handler(); 37 37 38 // tab: gallery, library, or type-specific 39 if ( isset($_GET['tab']) ) 40 $tab = strval($_GET['tab']); 41 else 42 $tab = apply_filters('media_upload_default_tab', 'type'); 38 $location = 'upload.php'; 39 if ( $errors ) 40 $location .= '?message=3'; 43 41 44 $body_id = 'media-upload'; 42 wp_redirect( admin_url($location) ); 43 } 44 45 if ( isset($_POST['html-upload']) && !empty($_FILES) ) { 46 // Upload File button was clicked 47 $id = media_handle_upload('async-upload', $_REQUEST['post_id']); 48 unset($_FILES); 49 if ( is_wp_error($id) ) { 50 $errors['upload_error'] = $id; 51 $id = false; 52 } 53 } 45 54 46 // let the action code decide how to handle the request 47 if ( $tab == 'type' ) 48 do_action("media_upload_$type");49 else 50 do_action("media_upload_$tab");55 $title = __('Upload Media'); 56 $parent_file = 'edit.php'; 57 require_once('admin-header.php'); ?> 58 <div class="wrap"> 59 <h2><?php _e('Upload Media') ?></h2> 51 60 61 <form enctype="multipart/form-data" method="post" action="media-upload.php?inline=&upload-page-form=" class="media-upload-form type-form validate" id="file-form"> 62 63 <?php media_upload_form(); ?> 64 65 <script type="text/javascript"> 66 jQuery(function($){ 67 var preloaded = $(".media-item.preloaded"); 68 if ( preloaded.length > 0 ) { 69 preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');}); 70 } 71 updateMediaForm(); 72 post_id = 0; 73 shortform = 1; 74 $('body:last div:has(embed), body:last div:has(object)').css({'visibility':'hidden','marginTop':'-1px'}); 75 }); 76 </script> 77 <input type="hidden" name="post_id" id="post_id" value="0" /> 78 <?php wp_nonce_field('media-form'); ?> 79 <div id="media-items"> </div> 80 <p> 81 <input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" /> 82 </p> 83 </form> 84 </div> 85 86 <?php 87 include('admin-footer.php'); 88 89 } else { 90 91 // upload type: image, video, file, ..? 92 if ( isset($_GET['type']) ) 93 $type = strval($_GET['type']); 94 else 95 $type = apply_filters('media_upload_default_type', 'file'); 96 97 // tab: gallery, library, or type-specific 98 if ( isset($_GET['tab']) ) 99 $tab = strval($_GET['tab']); 100 else 101 $tab = apply_filters('media_upload_default_tab', 'type'); 102 103 $body_id = 'media-upload'; 104 105 // let the action code decide how to handle the request 106 if ( $tab == 'type' ) 107 do_action("media_upload_$type"); 108 else 109 do_action("media_upload_$tab"); 110 } 52 111 ?> -
trunk/wp-admin/media.php
r8901 r8998 24 24 25 25 $errors = media_upload_form_handler(); 26 27 28 check_admin_referer('media-form');29 30 if ( !current_user_can('edit_post', $attachment_id) )31 wp_die ( __('You are not allowed to edit this attachment.') );32 26 33 27 if ( empty($errors) ) { … … 93 87 94 88 <form method="post" action="<?php echo clean_url( remove_query_arg( 'message' ) ); ?>" class="media-upload-form" id="media-single-form"> 95 <div id="media-items"class="media-single">89 <div class="media-single"> 96 90 <div id='media-item-<?php echo $att_id; ?>' class='media-item'> 97 <?php echo get_media_item( $att_id, array( 'toggle' => false, 'send' => false, 'delete' => false, ' errors' => $errors ) ); ?>91 <?php echo get_media_item( $att_id, array( 'toggle' => false, 'send' => false, 'delete' => false, 'show_title' => false, 'errors' => $errors ) ); ?> 98 92 </div> 99 93 </div> -
trunk/wp-admin/menu.php
r8992 r8998 50 50 51 51 $menu[10] = array( __('Media'), 'upload_files', 'upload.php' ); 52 $submenu['upload.php'][5] = array( __('Upload New'), 'upload_files', 'media-upload.php ');52 $submenu['upload.php'][5] = array( __('Upload New'), 'upload_files', 'media-upload.php?inline'); 53 53 $submenu['upload.php'][10] = array( __('View All'), 'upload_files', 'upload.php'); 54 54 -
trunk/wp-admin/upload.php
r8984 r8998 9 9 /** WordPress Administration Bootstrap */ 10 10 require_once('admin.php'); 11 add_thickbox();11 //add_thickbox(); 12 12 wp_enqueue_script( 'media-upload' ); 13 13 wp_enqueue_script( 'wp-ajax-response' ); … … 183 183 $h2_tag = isset($_GET['tag']) && $_GET['tag'] ? ' ' . sprintf( __('tagged with “%s”'), single_tag_title('', false) ) : ''; 184 184 $h2_month = isset($_GET['m']) && $_GET['m'] ? ' ' . sprintf( __('during %s'), single_month_title(' ', false) ) : ''; 185 printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s (<a href="%7$s" class="thickbox">Add New</a>)|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month, 'media-upload.php?library=false&TB_iframe=true' );185 printf( _c( '%1$s%2$s%3$s%4$s%5$s%6$s (<a href="%7$s">Add New</a>)|You can reorder these: 1: Posts, 2: by {s}, 3: matching {s}, 4: in {s}, 5: tagged with {s}, 6: during {s}' ), $h2_noun, $h2_author, $h2_search, $h2_cat, $h2_tag, $h2_month, 'media-upload.php?inline' ); 186 186 } 187 187 ?></h2> … … 225 225 endif; 226 226 227 $messages[1] = __('Media updated.');227 $messages[1] = __('Media attachment updated.'); 228 228 $messages[2] = __('Media deleted.'); 229 $messages[3] = __('Error saving media attachment.'); 229 230 230 231 if ( isset($_GET['message']) && (int) $_GET['message'] ) -
trunk/wp-admin/wp-admin.css
r8993 r8998 965 965 } 966 966 967 .form-table td { 967 .form-table td, 968 #wpbody-content .describe td { 968 969 margin-bottom: 9px; 969 970 padding: 10px; … … 974 975 } 975 976 976 .form-table th { 977 .form-table th, 978 #wpbody-content .describe th { 977 979 vertical-align: top; 978 980 text-align: left; … … 987 989 } 988 990 989 .form-table input, .form-table textarea { 991 .form-table input, 992 .form-table textarea, 993 #wpbody-content .describe input, 994 #wpbody-content .describe textarea { 990 995 border-width: 1px; 991 996 border-style: solid; … … 2345 2350 2346 2351 /* Media library */ 2347 #wpbody-content .media-item-info tr { 2352 #wpbody-content #media-items .describe { 2353 border-collapse: collapse; 2354 width: 100%; 2355 border-top-style: solid; 2356 border-top-width: 1px; 2357 clear: both; 2358 cursor: default; 2359 padding: 5px; 2360 width: 100%; 2361 } 2362 2363 #wpbody-content .describe .media-item-info tr { 2348 2364 background-color: transparent; 2349 2365 } … … 2370 2386 } 2371 2387 2372 #wpbody-content . media-single input[type="text"],2373 #wpbody-content . media-single textarea {2388 #wpbody-content .describe input[type="text"], 2389 #wpbody-content .describe textarea { 2374 2390 width: 460px; 2375 2391 } 2376 2392 2377 #wpbody-content .media-upload-form p.help { 2378 margin: 0; 2379 padding: 0; 2393 #wpbody-content .describe p.help { 2394 margin: 0; 2395 padding: 0; 2396 } 2397 2398 .describe-toggle-on, .describe-toggle-off { 2399 display: block; 2400 line-height: 36px; 2401 float: right; 2402 margin-right: 20px; 2403 } 2404 2405 .describe-toggle-off { 2406 display: none; 2407 } 2408 2409 #wpbody-content .media-item { 2410 border-bottom-style: solid; 2411 border-bottom-width: 1px; 2412 min-height: 36px; 2413 position: relative; 2414 width: 100%; 2415 } 2416 2417 #wpbody-content #media-items { 2418 border-style: solid solid none; 2419 border-width: 1px; 2420 width: 670px; 2421 } 2422 2423 #wpbody-content #media-items .filename { 2424 float: left; 2425 line-height: 36px; 2426 margin-left: 10px; 2427 max-width: 430px; 2428 overflow: hidden; 2429 } 2430 2431 .media-item .pinkynail { 2432 float: left; 2433 height: 32px; 2434 margin: 2px; 2435 max-width: 40px; 2436 max-height: 40px; 2437 } 2438 2439 .media-item .startopen, 2440 .media-item .startclosed { 2441 display: none; 2380 2442 } 2381 2443 -
trunk/wp-includes/js/swfupload/handlers.js
r7862 r8998 36 36 jQuery('#media-item-' + fileObj.id + ' .progress').hide(); 37 37 38 var f = ( typeof shortform == 'undefined' ) ? 1 : 2; 38 39 // Old style: Append the HTML returned by the server -- thumbnail and form inputs 39 40 if ( isNaN(serverData) || !serverData ) { … … 43 44 // New style: server data is just the attachment ID, fetch the thumbnail and form html from the server 44 45 else { 45 jQuery('#media-item-' + fileObj.id).load('async-upload.php', {attachment_id:serverData, fetch: 1}, function(){prepareMediaItemInit(fileObj);updateMediaForm()});46 jQuery('#media-item-' + fileObj.id).load('async-upload.php', {attachment_id:serverData, fetch:f}, function(){prepareMediaItemInit(fileObj);updateMediaForm()}); 46 47 } 47 48 }
Note: See TracChangeset
for help on using the changeset viewer.