Make WordPress Core


Ignore:
Timestamp:
09/24/2009 01:54:07 AM (15 years ago)
Author:
azaozz
Message:

Image Editor improvements, see #10528

File:
1 edited

Legend:

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

    r11944 r11965  
    250250function media_handle_sideload($file_array, $post_id, $desc = null, $post_data = array()) {
    251251    $overrides = array('test_form'=>false);
    252    
     252
    253253    $file = wp_handle_sideload($file_array, $overrides);
    254254    if ( isset($file['error']) )
     
    523523        // Download file to temp location
    524524        $tmp = download_url($file);
    525        
     525
    526526        // Set variables for storage
    527527        // fix file filename for query strings
     
    535535            $file_array['tmp_name'] = '';
    536536        }
    537        
     537
    538538        // do the validation and storage stuff
    539539        $id = media_handle_sideload($file_array, $post_id, @$desc);
    540540        $src = $id;
    541        
     541
    542542        // If error storing permanently, unlink
    543543        if ( is_wp_error($id) ) {
     
    546546        }
    547547    }
    548    
     548
    549549    // Finally check to make sure the file has been saved, then return the html
    550550    if ( !empty($src) ) {
     
    11681168    if ( gd_edit_image_support($post->post_mime_type) ) {
    11691169        $nonce = wp_create_nonce("image_editor-$post->ID");
    1170         $image_edit_button = "<tr><td class='A1B1'><input type='button' id='imgedit-open-btn-{$post->ID}' onclick='imageEdit.open($post->ID, \"$nonce\")' class='button' value='" . esc_attr__( 'Edit image' ) . "' /> <img src='images/wpspin_light.gif' class='imgedit-wait-spin' alt='' /></td></tr>";
     1170        $image_edit_button = "<input type='button' id='imgedit-open-btn-{$post->ID}' onclick='imageEdit.open($post->ID, \"$nonce\")' class='button' value='" . esc_attr__( 'Edit image' ) . "' /> <img src='images/wpspin_light.gif' class='imgedit-wait-spin' alt='' />";
    11711171    }
    11721172
     
    11791179        <thead class='media-item-info' id='media-head-$post->ID'>
    11801180        <tr>
    1181             <td class='A1B1' rowspan='5'><img class='thumbnail' src='$thumb_url' alt='' /></td>
     1181            <td class='A1B1' id='thumbnail-head-$post->ID' rowspan='5'><img class='thumbnail' src='$thumb_url' alt='' /></td>
    11821182            <td>$filename</td>
    11831183        </tr>
     
    11851185        <tr><td>" . mysql2date($post->post_date, get_option('time_format')) . "</td></tr>
    11861186        <tr><td>" . apply_filters('media_meta', $media_dims, $post) . "</td></tr>
    1187         $image_edit_button
     1187        <tr><td class='A1B1'>$image_edit_button</td></tr>
    11881188        </thead>
    11891189        <tbody>
    1190         <tr><td style='display:none' colspan='2' id='image-editor-$post->ID'></td></tr>\n";
     1190        <tr><td colspan='2' class='imgedit-response' id='imgedit-response-$post->ID'></td></tr>
     1191        <tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-$post->ID'></td></tr>\n";
    11911192
    11921193    $defaults = array(
Note: See TracChangeset for help on using the changeset viewer.