Make WordPress Core

Ticket #3191: 3191d.diff

File 3191d.diff, 6.2 KB (added by mdawaffe, 18 years ago)

don't include admin-header for inline

  • wp-admin/upload-js.php

     
    2929                                return;
    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                },
    3535
     
    117117                        this.prepView(id);
    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 )
    123126                                h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>";
  • wp-admin/upload-rtl.css

     
    1818table { float: right; }
    1919
    2020#the-attachment-links { float: left; }
     21
     22#th { text-align: left; }
  • wp-admin/upload.php

     
    1414
    1515do_action( "upload_files_$tab" );
    1616
    17 add_action( 'admin_head', 'wp_upload_admin_head' );
    18 
    1917$pid = 0;
    2018if ( $post_id < 0 )
    2119        $pid = $post_id;
     
    5149        }
    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";
    5777foreach ( $wp_upload_tabs as $t => $tab_array ) { // We've already done the current_user_can check
     
    95115
    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; ?>
  • wp-admin/upload-functions.php

     
    101101                                echo '[&nbsp;';
    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>';
    107107                                echo '&nbsp;]'; ?></span>
     
    297297                endwhile; endif;
    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 )
    303303                        add_filter( 'posts_where', 'wp_upload_posts_where' );
     
    309309
    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-";
    315318                        the_ID();
     
    331334
    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
    337342add_action( 'upload_files_browse', 'wp_upload_tab_browse_action' );
     
    344349                echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload-rtl.css?version=' . get_bloginfo('version') . "' type='text/css' />\n";
    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";
    350354                echo "\t#upload-file { position: absolute; }\n";
  • wp-admin/upload.css

     
    9090
    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}
    9797
     98#upload-file-view a img { padding-bottom: .2em; border-bottom: 1px solid #6699CC; }
     99
    98100#upload-files a.file-link {
    99101        display: block;
    100102        width: 130px;
     
    127129        padding: 0;
    128130}
    129131
    130 th { vertical-align: text-top; }
     132th { text-align: right; vertical-align: text-top; }
    131133
    132134tr, td, th {
    133135        margin-top: 0;