WordPress.org

Make WordPress Core

Changeset 4340


Ignore:
Timestamp:
10/04/2006 05:19:10 PM (12 years ago)
Author:
ryan
Message:

Uploader improvements from mdawaffe. fixes #3191

Location:
trunk/wp-admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/upload-functions.php

    r4312 r4340  
    102102                echo '<a href="' . get_permalink() . '">' . __('view') . '</a>';
    103103                echo '&nbsp;|&nbsp;';
    104                     echo '<a href="' . wp_specialchars( add_query_arg( 'action', 'view' ), 1 ) . '">' . __('options') . '</a>';
     104                    echo '<a href="' . wp_specialchars( add_query_arg( 'action', 'view' ), 1 ) . '">' . __('links') . '</a>';
    105105                echo '&nbsp;|&nbsp;';
    106106                echo '<a href="' . wp_specialchars( remove_query_arg( array('action','ID') ), 1 ) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>';
     
    298298        break;
    299299    default :
    300         global $tab, $post_id;
     300        global $tab, $post_id, $style;
    301301        add_action( 'pre_get_posts', 'wp_upload_grab_attachments' );
    302302        if ( 'browse' == $tab && $post_id )
     
    310310        echo "<ul id='upload-files'>\n";
    311311        if ( have_posts() ) : while ( have_posts() ) : the_post();
    312             $href = wp_specialchars( add_query_arg( array('action' => 'view', 'ID' => get_the_ID()) ), 1 );
     312            $href = wp_specialchars( add_query_arg( array(
     313                'action' => 'inline' == $style ? 'view' : 'edit',
     314                'ID' => get_the_ID())
     315             ), 1 );
    313316
    314317            echo "\t<li id='file-";
     
    332335
    333336function wp_upload_tab_browse_action() {
    334     wp_enqueue_script('upload');
     337    global $style;
     338    if ( 'inline' == $style )
     339        wp_enqueue_script('upload');
    335340}
    336341
     
    345350    if ( 'inline' == @$_GET['style'] ) {
    346351        echo "<style type='text/css'>\n";
    347         echo "\t#wphead, #user_info, #adminmenu, #submenu, #footer { display: none; }\n";
    348352        echo "\tbody { height: 14em; overflow: hidden; }\n";
    349353        echo "\t#upload-content { overflow-y: auto; }\n";
  • trunk/wp-admin/upload-js.php

    r4312 r4340  
    3030            $$('a.file-link').each( function(i) {
    3131                var id = i.id.split('-').pop();
    32                 i.onclick = function(e) { theFileList.imageView(id, e); }
     32                i.onclick = function(e) { theFileList[ 'inline' == theFileList.style ? 'imageView' : 'editView' ](id, e); }
    3333            } );
    3434        },
     
    118118            var h = '';
    119119
    120             h += "<form id='upload-file' method='post' action='upload.php?style=inline&amp;tab=upload&amp;post_id=" + this.postID + "'>";
     120            var action = 'upload.php?style=' + this.style + '&amp;tab=upload';
     121            if ( this.postID )
     122                action += '&amp;post_id=' + this.postID;
     123            h += "<form id='upload-file' method='post' action='" + action + "'>";
    121124            h += "<div id='file-title'>"
    122125            if ( !this.currentImage.thumb )
  • trunk/wp-admin/upload-rtl.css

    r4312 r4340  
    1919
    2020#the-attachment-links { float: left; }
     21
     22#th { text-align: left; }
  • trunk/wp-admin/upload.css

    r4312 r4340  
    9191#upload-files li { margin: 0 0 15px 15px; }
    9292
    93 #upload-files a, a.file-link {
     93#upload-files a, #upload-file-view a, a.file-link {
    9494    border: none;
    9595    text-decoration: none;
    9696}
     97
     98#upload-file-view a img { padding-bottom: .2em; border-bottom: 1px solid #6699CC; }
    9799
    98100#upload-files a.file-link {
     
    128130}
    129131
    130 th { vertical-align: text-top; }
     132th { text-align: right; vertical-align: text-top; }
    131133
    132134tr, td, th {
  • trunk/wp-admin/upload.php

    r4312 r4340  
    1414
    1515do_action( "upload_files_$tab" );
    16 
    17 add_action( 'admin_head', 'wp_upload_admin_head' );
    1816
    1917$pid = 0;
     
    5250}
    5351
    54 include_once('admin-header.php');
     52if ( 'inline' == $style ) : ?>
     53<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     54<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
     55<head>
     56<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
     57<title><?php bloginfo('name') ?> &rsaquo; <?php _e('Uploads'); ?> &#8212; WordPress</title>
     58<link rel="stylesheet" href="<?php echo get_option('siteurl') ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" />
     59<?php if ( ('rtl' == $wp_locale->text_direction) ) : ?>
     60<link rel="stylesheet" href="<?php echo get_option('siteurl') ?>/wp-admin/rtl.css?version=<?php bloginfo('version'); ?>" type="text/css" />
     61<?php endif; ?>
     62<script type="text/javascript">
     63//<![CDATA[
     64function addLoadEvent(func) {if ( typeof wpOnload!='function'){wpOnload=func;}else{ var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}
     65//]]>
     66</script>
     67<?php do_action('admin_print_scripts'); wp_upload_admin_head(); ?>
     68</head>
     69<body>
     70<?php
     71else :
     72    add_action( 'admin_head', 'wp_upload_admin_head' );
     73    include_once('admin-header.php');
     74endif;
    5575
    5676echo "<ul id='upload-menu'>\n";
     
    96116echo "</div>\n";
    97117
    98 include_once('admin-footer.php');
    99 ?>
     118if ( 'inline' != $style ) :
     119    include_once('admin-footer.php');
     120else : ?>
     121<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
     122
     123</body>
     124</html>
     125<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.