Make WordPress Core


Ignore:
Timestamp:
02/05/2008 06:47:27 AM (17 years ago)
Author:
ryan
Message:

Trailing whitespace cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/media.php

    r6659 r6726  
    1616    $image_align = @$values['image-url'];
    1717    $post_id = $_GET['post_id'];
    18    
     18
    1919?>
    2020<div id="media-upload-header">
     
    3434<!--
    3535
    36 jQuery(document).ready(function(){ 
     36jQuery(document).ready(function(){
    3737    var swfu = new SWFUpload({
    3838            upload_url : "<?php echo get_option('siteurl').'/wp-admin/async-upload.php'; ?>",
     
    6060                cancelButtonId : "btnCancel2"
    6161            },
    62            
     62
    6363            debug: false,
    64        
     64
    6565        });
    6666
     
    108108
    109109function image_upload_handler() {
    110    
     110
    111111    if ( !current_user_can('upload_files') ) {
    112112        return new wp_error( 'upload_not_allowed', __('You are not allowed to upload files.') );
     
    120120        // Add Image button was clicked
    121121        check_admin_referer('inlineuploading');
    122    
     122
    123123        // if the async flash uploader was used, the attachment has already been inserted and its ID is passed in post.
    124124        // otherwise this is a regular form post and we still have to handle the upload and create the attachment.
     
    135135            $id = image_upload_post();
    136136        }
    137        
     137
    138138        // if the input was invalid, redisplay the form with its current values
    139139        if ( is_wp_error($id) )
     
    151151    if ( empty($thumb_url) )
    152152        $thumb_url = wp_mime_type_icon($id);
    153        
     153
    154154    if ($thumb_url) {
    155155        $out = '<p><input type="hidden" name="attachment_id" id="attachment_id" value="'.intval($id).'" />'
     
    161161            . basename(wp_get_attachment_url($id)).'</p>';
    162162    }
    163    
     163
    164164    $post = get_post($id);
    165165    $title = addslashes($post->post_title);
    166166    $alt = addslashes($post->post_content);
    167    
     167
    168168    // populate the input fields with post data (which in turn comes from exif/iptc)
    169169    $out .= <<<EOF
     
    175175jQuery('#image-add').attr('disabled', false);
    176176-->
    177 </script>   
     177</script>
    178178EOF;
    179179
     
    185185
    186186function image_send_to_editor($id, $alt, $title, $align, $url='') {
    187    
     187
    188188    $img_src = wp_get_attachment_url($id);
    189189    $meta = wp_get_attachment_metadata($id);
    190    
     190
    191191    $hwstring = '';
    192192    if ( isset($meta['width'], $meta['height']) )
     
    208208top.tb_remove();
    209209-->
    210 </script>   
     210</script>
    211211    <?php
    212212}
     
    218218    if ( empty($_POST['image-alt']) )
    219219        return new wp_error( 'image_alt_required', __('Please enter an &lt;alt&gt; description') );
    220    
     220
    221221    $overrides = array('test_form'=>false);
    222222    $file = wp_handle_upload($_FILES['image-file'], $overrides);
     
    224224    if ( isset($file['error']) )
    225225        return new wp_error( 'upload_error', $file['error'] );
    226        
     226
    227227    $url = $file['url'];
    228228    $type = $file['type'];
    229229    $file = $file['file'];
    230    
     230
    231231    $post_title = trim($_POST['image-title']);
    232232    $post_content = trim($_POST['image-alt']);
    233233    $post_parent = intval($_POST['parent_post_id']);
    234        
     234
    235235    // Construct the attachment array
    236236    $attachment = array(
     
    248248        wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
    249249
    250     return $id;     
     250    return $id;
    251251}
    252252
Note: See TracChangeset for help on using the changeset viewer.