Ticket #5911: 5911-26.diff
| File 5911-26.diff, 4.2 KB (added by , 18 years ago) |
|---|
-
wp-includes/js/swfupload/handlers.js
86 86 jQuery('.type-form .slidetoggle').siblings().addClass('hidden'); 87 87 } 88 88 89 // Only show Save buttons when there is at least one file. 90 if ( jQuery('#media-items>*').not('.media-blank').length > 0 ) 91 jQuery('.savebutton').show(); 92 else 93 jQuery('.savebutton').hide(); 94 89 95 // Only show Gallery button when there are at least two files. 90 96 if ( jQuery('#media-items>*').length > 1 ) 91 97 jQuery('.insert-gallery').show(); -
wp-admin/includes/media.php
823 823 <h3><?php _e('From Computer'); ?></h3> 824 824 <?php media_upload_form( $errors ); ?> 825 825 826 <?php if ( $id && !is_wp_error($id) ) : ?>827 826 <script type="text/javascript"> 828 827 <!-- 829 828 jQuery(function($){ 830 829 var preloaded = $(".media-item.preloaded"); 831 830 if ( preloaded.length > 0 ) { 832 831 preloaded.each(function(){prepareMediaItem({id:this.id.replace(/[^0-9]/g, '')},'');}); 833 updateMediaForm();834 832 } 833 updateMediaForm(); 835 834 }); 836 835 --> 837 836 </script> 837 <?php if ( $id && !is_wp_error($id) ) : ?> 838 838 <div id="media-items"> 839 <input type="submit" class="button savebutton" name="save" value="<?php _e('Save'); ?>" />840 839 <?php echo get_media_items( $id, $errors ); ?> 841 <input type="submit" class="button savebutton" name="save" value="<?php _e('Save'); ?>" />842 840 </div> 841 <input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes'); ?>" /> 843 842 844 843 <?php elseif ( is_callable($callback) ) : ?> 845 844 … … 853 852 <?php echo call_user_func($callback); ?> 854 853 </div> 855 854 </div> 855 <input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes'); ?>" /> 856 856 <?php 857 857 endif; 858 858 } … … 862 862 863 863 $post_id = intval($_REQUEST['post_id']); 864 864 865 $form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type= media&tab=gallery&post_id=$post_id";865 $form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type={$GLOBALS['type']}&tab=gallery&post_id=$post_id"; 866 866 867 867 ?> 868 868 … … 885 885 <div id="media-items"> 886 886 <?php echo get_media_items($post_id, $errors); ?> 887 887 </div> 888 <p class="submit"> 889 <input type="submit" class="submit insert-gallery" name="insert-gallery" value="<?php _e('Insert gallery into post'); ?>" /> 890 </p> 888 <input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes'); ?>" /> 889 <input type="submit" class="button insert-gallery" name="insert-gallery" value="<?php _e('Insert gallery into post'); ?>" /> 891 890 <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" /> 891 <input type="hidden" name="type" value="<?php echo $GLOBALS['type']; ?>" /> 892 <input type="hidden" name="tab" value="<?php echo $GLOBALS['tab']; ?>" /> 892 893 </form> 893 894 <?php 894 895 } … … 900 901 901 902 $post_id = intval($_REQUEST['post_id']); 902 903 903 $form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php ";904 $form_action_url = get_option('siteurl') . "/wp-admin/media-upload.php?type={$GLOBALS['type']}&tab=library&post_id=$post_id"; 904 905 905 906 $_GET['paged'] = intval($_GET['paged']); 906 907 if ( $_GET['paged'] < 1 ) … … 931 932 $type_links = array(); 932 933 $_num_posts = (array) wp_count_attachments(); 933 934 $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts)); 934 foreach ( $matches as $ type => $reals )935 foreach ( $matches as $_type => $reals ) 935 936 foreach ( $reals as $real ) 936 $num_posts[$ type] += $_num_posts[$real];937 $num_posts[$_type] += $_num_posts[$real]; 937 938 $class = empty($_GET['post_mime_type']) ? ' class="current"' : ''; 938 939 $type_links[] = "<li><a href='" . remove_query_arg(array('post_mime_type', 'paged', 'm')) . "'$class>".__('All Types')."</a>"; 939 940 foreach ( $post_mime_types as $mime_type => $label ) { … … 1026 1027 <div id="media-items"> 1027 1028 <?php echo get_media_items(null, $errors); ?> 1028 1029 </div> 1030 <input type="submit" class="button savebutton" name="save" value="<?php _e('Save all changes'); ?>" /> 1029 1031 <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" /> 1030 1032 </form> 1031 1033 <?php