Changeset 10150 for trunk/wp-admin/includes/media.php
- Timestamp:
- 12/09/2008 06:03:31 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r10124 r10150 103 103 104 104 $htmlalt = ( empty($alt) ) ? $title : $alt; 105 105 106 106 $html = get_image_tag($id, $htmlalt, $title, $align, $size); 107 107 … … 474 474 return media_upload_gallery(); 475 475 } 476 476 477 477 if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' ) 478 478 return wp_iframe( 'media_upload_type_url_form', 'image', $errors, $id ); … … 502 502 $file_array['tmp_name'] = ''; 503 503 } 504 504 505 505 $id = media_handle_sideload($file_array, $post_id, $desc); 506 506 $src = $id; 507 507 508 508 if ( is_wp_error($id) ) { 509 509 @unlink($file_array['tmp_name']); … … 568 568 if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' ) 569 569 return wp_iframe( 'media_upload_type_url_form', 'audio', $errors, $id ); 570 570 571 571 return wp_iframe( 'media_upload_type_form', 'audio', $errors, $id ); 572 572 } … … 621 621 if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' ) 622 622 return wp_iframe( 'media_upload_type_url_form', 'video', $errors, $id ); 623 623 624 624 return wp_iframe( 'media_upload_type_form', 'video', $errors, $id ); 625 625 } … … 674 674 if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' ) 675 675 return wp_iframe( 'media_upload_type_url_form', 'file', $errors, $id ); 676 676 677 677 return wp_iframe( 'media_upload_type_form', 'file', $errors, $id ); 678 678 } … … 732 732 */ 733 733 function image_align_input_fields($post, $checked='') { 734 734 735 735 $alignments = array('none' => 'None', 'left' => 'Left', 'center' => 'Center', 'right' => 'Right'); 736 736 if ( !array_key_exists($checked, $alignments) ) 737 737 $checked = 'none'; 738 738 739 739 $out = array(); 740 740 foreach ($alignments as $name => $label) { 741 741 742 742 $out[] = "<input type='radio' name='attachments[{$post->ID}][align]' id='image-align-{$name}-{$post->ID}' value='$name'". 743 ( $checked == $name ? " checked='checked'" : "" ) . 743 ( $checked == $name ? " checked='checked'" : "" ) . 744 744 " /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>" . __($label) . "</label>"; 745 745 } … … 757 757 */ 758 758 function image_size_input_fields($post, $checked='') { 759 759 760 760 // get a list of the actual pixel dimensions of each possible intermediate version of this image 761 $size_names = array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full size')); 761 $size_names = array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full size')); 762 762 763 763 foreach ( $size_names as $size => $name) { … … 773 773 if ( !$checked && $enabled && 'thumbnail' != $size ) 774 774 $checked = $size; 775 775 776 776 $html = "<div class='image-size-item'><input type='radio' ".( $enabled ? '' : "disabled='disabled'")."name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'".( $checked == $size ? " checked='checked'" : '') ." />"; 777 777 778 778 $html .= "<label for='{$css_id}'>" . __($name). "</label>"; 779 779 // only show the dimensions if that choice is available 780 780 if ( $enabled ) 781 781 $html .= " <label for='{$css_id}' class='help'>" . sprintf( __("(%d × %d)"), $downsize[1], $downsize[2] ). "</label>"; 782 782 783 783 $html .= '</div>'; 784 784 785 785 $out[] = $html; 786 786 } 787 787 788 788 return array( 789 789 'label' => __('Size'), … … 812 812 elseif ( $url_type == 'post' ) 813 813 $url = $link; 814 814 815 815 return "<input type='text' class='urlfield' name='attachments[$post->ID][url]' value='" . attribute_escape($url) . "' /><br /> 816 816 <button type='button' class='button urlnone' title=''>" . __('None') . "</button> … … 843 843 'html' => image_align_input_fields($post, get_option('image_default_align')), 844 844 ); 845 845 846 846 $form_fields['image-size'] = image_size_input_fields($post, get_option('image_default_size')); 847 847 } … … 1288 1288 swfupload_pre_load_handler: swfuploadPreLoad, 1289 1289 swfupload_load_failed_handler: swfuploadLoadFailed, 1290 custom_settings : { 1290 custom_settings : { 1291 1291 degraded_element_id : "html-upload-ui", // id of the element displayed when swfupload is unavailable 1292 1292 swfupload_element_id : "flash-upload-ui" // id of the element displayed when swfupload is available … … 1300 1300 <div id="flash-upload-ui"> 1301 1301 <?php do_action('pre-flash-upload-ui'); ?> 1302 1302 1303 1303 <div><?php _e( 'Choose files to upload' ); ?> <div id="flash-browse-button"></div></div> 1304 1304 <?php do_action('post-flash-upload-ui'); ?> … … 1362 1362 </script> 1363 1363 <div id="media-items"> 1364 <?php 1364 <?php 1365 1365 if ( $id ) { 1366 1366 if ( !is_wp_error($id) ) { … … 1794 1794 if ( empty($default_align) ) 1795 1795 $default_align = 'none'; 1796 1796 1797 1797 return ' 1798 1798 <table class="describe"><tbody>
Note: See TracChangeset
for help on using the changeset viewer.