Changeset 3305

Show
Ignore:
Timestamp:
12/14/05 04:24:05 (3 years ago)
Author:
ryan
Message:

More inline uploading tweaks. fixes #2076

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/inline-uploading.php

    r3303 r3305  
    3030 
    3131if ( !current_user_can('edit_post', (int) $attachment) )     
    32 die(__('You are not allowed to delete this attachment.').' <a href="'.basename(__FILE__)."?post=$post&amp;all=$all&amp;action=upload\">".__('Go back').'</a>'); 
     32   die(__('You are not allowed to delete this attachment.').' <a href="'.basename(__FILE__)."?post=$post&amp;all=$all&amp;action=upload\">".__('Go back').'</a>'); 
    3333 
    3434wp_delete_attachment($attachment); 
     
    4444 
    4545if ( isset($file['error']) ) 
    46     die($file['error'] . '<a href="' . basename(__FILE__) . '?action=upload&post="' . $post . '">'.__('Back to Image Uploading').'</a>'); 
     46    die($file['error'] . '<br /><a href="' . basename(__FILE__) . '?action=upload&post=' . $post . '">'.__('Back to Image Uploading').'</a>'); 
    4747 
    4848$url = $file['url']; 
     
    9393} 
    9494 
    95 header("Location: ".basename(__FILE__)."?post=$post&all=$all&action=view&last=true"); 
     95header("Location: ".basename(__FILE__)."?post=$post&all=$all&action=view&start=0"); 
    9696die(); 
    9797 
     
    108108$double = $num * 2; 
    109109 
    110 if ( $post && empty($all) ) { 
     110if ( $post && (empty($all) || $all == 'false') ) { 
    111111    $and_post = "AND post_parent = '$post'"; 
    112112    $current_2 = ' class="current"'; 
     
    202202        $attachment = array_merge($attachment, $meta); 
    203203        $send_delete_cancel = "<a onclick=\"sendToEditor({$ID});return false;\" href=\"javascript:void()\">$__send_to_editor</a> 
    204 <!--<a onclick=\"return confirm('$__confirmdelete')\" href=\"".basename(__FILE__)."?action=delete&amp;attachment={$ID}&amp;all=$all&amp;start=$start&amp;post=$post\">$__delete</a>--
     204<a onclick=\"return confirm('$__confirmdelete')\" href=\"".basename(__FILE__)."?action=delete&amp;attachment={$ID}&amp;all=$all&amp;start=$start&amp;post=$post\">$__delete</a
    205205        <a onclick=\"popup.style.display='none';return false;\" href=\"javascript:void()\">$__close</a> 
    206206"; 
     
    245245            $title = $attachment['post_title']; 
    246246            $filename = basename($attachment['guid']); 
    247             if ( $icon = get_attachment_icon($ID) ) 
    248                $toggle_icon = "<a id=\"I{$ID}\" onclick=\"toggleOtherIcon({$ID});return false;\" href=\"javascript:void()\">$__using_title</a>"; 
     247            $icon = get_attachment_icon($ID); 
     248            $toggle_icon = "<a id=\"I{$ID}\" onclick=\"toggleOtherIcon({$ID});return false;\" href=\"javascript:void()\">$__using_title</a>"; 
    249249            $script .= "aa[{$ID}] = '<a id=\"{$ID}\" rel=\"attachment\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$attachment['post_title']}</a>'; 
    250250ab[{$ID}] = '<a id=\"{$ID}\" href=\"{$filename}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">{$attachment['post_title']}</a>'; 
     
    367367        o.innerHTML = filename[n]; 
    368368        oi.innerHTML = usingfilename; 
    369     } else if ( oi.innerHTML == usingfilename ) { 
     369    } else if ( oi.innerHTML == usingfilename && icon[n] != '' ) { 
    370370        o.innerHTML = icon[n]; 
    371371        oi.innerHTML = usingicon; 
     
    377377        od.className = 'otherwrap usingicon'; 
    378378    else 
    379         od.classname = 'otherwrap usingtext'; 
     379        od.className = 'otherwrap usingtext'; 
    380380} 
    381381 
     
    441441.otherwrap { 
    442442    margin-right: 5px; 
    443     overflow: hidden; 
     443/*  overflow: hidden;*/ 
    444444    background-color: #f9fcfe; 
    445445    float: left; 
     
    530530} 
    531531#title, #descr { 
    532     width: 100%; 
     532    width: 99%; 
    533533    margin-top: 1px; 
     534} 
     535th { 
     536    width: 4.5em; 
    534537} 
    535538#descr { 
     
    542545.popup { 
    543546    margin: 4px 4px; 
    544     padding: 3px; 
     547    padding: 1px; 
    545548    position: absolute; 
    546549    width: 114px; 
    547     height: 82px; 
     550/*  height: 92px;*/ 
    548551    display: none; 
    549     background-color: rgb(223, 232, 241); 
     552    background-color: rgb(240, 240, 238); 
     553    border-top: 2px solid #fff; 
     554    border-right: 2px solid #ddd; 
     555    border-bottom: 2px solid #ddd; 
     556    border-left: 2px solid #fff; 
    550557    text-align: center; 
    551558} 
     
    568575    color: #000; 
    569576} 
     577#submit { 
     578    margin: 1px; 
     579    width: 99%; 
     580} 
     581#submit input, #submit input:focus { 
     582    background: url( images/fade-butt.png ); 
     583    border: 3px double #999; 
     584    border-left-color: #ccc; 
     585    border-top-color: #ccc; 
     586    color: #333; 
     587    padding: 0.25em; 
     588} 
     589 
     590#submit input:active { 
     591    background: #f4f4f4; 
     592    border: 3px double #ccc; 
     593    border-left-color: #999; 
     594    border-top-color: #999; 
     595} 
    570596</style> 
    571597</head> 
    572598<body> 
    573599<ul id="upload-menu"> 
    574 <li<?php echo $current_1; ?>><a href="<?php echo basename(__FILE__); ?>?action=upload&amp;post=<?php echo $post; ?>&amp;all=<?php echo $all; ?>"><?php _e('Upload'); ?></a></li> 
     600<li<?php echo $current_1; ?>><a href="<?php echo basename(__FILE__); ?>?action=upload&amp;post=<?php echo $post; ?>&amp;all=<?php echo $all; ?>&amp;start=<?php echo $start; ?>"><?php _e('Upload'); ?></a></li> 
    575601<?php if ( $attachments = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_parent = '$post'") ) { ?> 
    576 <li<?php echo $current_2; ?>><a href="<?php echo basename(__FILE__); ?>?action=view&amp;post=<?php echo $post; ?>"><?php _e('Browse'); ?></a></li> 
     602<li<?php echo $current_2; ?>><a href="<?php echo basename(__FILE__); ?>?action=view&amp;post=<?php echo $post; ?>&amp;all=false"><?php _e('Browse'); ?></a></li> 
    577603<?php } ?> 
    578604<?php if ($wpdb->get_var("SELECT count(ID) FROM $wpdb->posts WHERE post_status = 'attachment'")) { ?> 
     
    610636<table style="width:99%;"> 
    611637<tr> 
    612 <th scope="row" style="width: 4.5em;text-align: right;"><label for="upload"><?php _e('File:'); ?></label></th> 
     638<th scope="row" align="right"><label for="upload"><?php _e('File:'); ?></label></th> 
    613639<td><input type="file" id="upload" name="image" /></td> 
    614640</tr> 
    615641<tr> 
    616 <th scope="row" style="text-align: right;"><label for="title"><?php _e('Title:'); ?></label></th> 
     642<th scope="row" align="right"><label for="title"><?php _e('Title:'); ?></label></th> 
    617643<td><input type="text" id="title" name="imgtitle" /></td> 
    618644</tr> 
    619645<tr> 
    620 <th scope="row" style="text-align: right;"><label for="descr"><?php _e('Description:'); ?></label></th> 
     646<th scope="row" align="right"><label for="descr"><?php _e('Description:'); ?></label></th> 
    621647<td><input type="textarea" name="descr" id="descr" value="" /></td> 
    622648</tr> 
     
    627653<input type="hidden" name="post" value="<?php echo $post; ?>" /> 
    628654<input type="hidden" name="all" value="<?php echo $all; ?>" /> 
     655<input type="hidden" name="start" value="<?php echo $start; ?>" /> 
     656<div id="submit"> 
    629657<input type="submit" value="<?php _e('Upload'); ?>" /> 
     658<?php if ( !empty($all) ) : ?> 
    630659<input type="button" value="<?php _e('Cancel'); ?>" onclick="cancelUpload()" /> 
     660<?php endif; ?> 
     661</div> 
    631662</td> 
    632663</tr>