Make WordPress Core


Ignore:
Timestamp:
09/28/2006 05:35:59 PM (18 years ago)
Author:
ryan
Message:

Add support for RTL in install.php, upgrade.php and inline-uploading.php. Props Sewar. #3136

File:
1 edited

Legend:

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

    r4206 r4259  
    11<?php
    2 
    32require_once('admin.php');
    4 
    5 header('Content-Type: text/html; charset=' . get_option('blog_charset'));
     3@header('Content-type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
    64
    75if (!current_user_can('upload_files'))
     
    277275
    278276default:
    279 wp_die(__('This script was not meant to be called directly.'));
     277    wp_die(__('This script was not meant to be called directly.'));
    280278}
    281279
    282280?>
    283281<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    284 <html xmlns="http://www.w3.org/1999/xhtml">
     282<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    285283<head>
    286284<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
     
    428426</script>
    429427<style type="text/css">
    430 <?php if ( $action == 'links' ) : ?>
    431 * html { overflow-x: hidden; }
    432 <?php else : ?>
    433 * html { overflow-y: hidden; }
    434 <?php endif; ?>
    435 body {
    436     font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana;
    437     border: none;
    438     margin: 0px;
    439     height: 150px;
    440     background: #dfe8f1;
    441 }
    442 form {
    443     margin: 3px 2px 0px 6px;
    444 }
    445 #wrap {
    446     clear: both;
    447     padding: 0px;
    448     width: 100%;
    449 }
    450 #images {
    451     position: absolute;
    452     clear: both;
    453     margin: 0px;
    454     padding: 15px 15px;
    455     width: <?php echo $images_width; ?>px;
    456 }
    457 #images img {
    458     background-color: rgb(209, 226, 239);
    459 }
    460 <?php echo $style; ?>
    461 .attwrap, .attwrap * {
    462     margin: 0px;
    463     padding: 0px;
    464     border: 0px;
    465 }
    466 .imagewrap {
    467     margin-right: 5px;
    468     overflow: hidden;
    469     width: 128px;
    470 }
    471 .otherwrap {
    472     margin-right: 5px;
    473     overflow: hidden;
    474     background-color: #f9fcfe;
    475 }
    476 .otherwrap a {
    477     display: block;
    478 }
    479 .otherwrap a, .otherwrap a:hover, .otherwrap a:active, .otherwrap a:visited {
    480     color: blue;
    481 }
    482 .usingicon {
    483     padding: 0px;
    484     height: 96px;
    485     text-align: center;
    486     width: 128px;
    487 }
    488 .usingtext {
    489     padding: 3px;
    490     height: 90px;
    491     text-align: left;
    492     width: 122px;
    493 }
    494 .filetype {
    495     font-size: 80%;
    496     border-bottom: 3px double #89a
    497 }
    498 .imagewrap, .imagewrap img, .imagewrap a, .imagewrap a img, .imagewrap a:hover img, .imagewrap a:visited img, .imagewrap a:active img {
    499     text-decoration: none;
    500 }
    501 #upload-menu {
    502     background: #fff;
    503     margin: 0px;
    504     padding: 0;
    505     list-style: none;
    506     height: 2em;
    507     border-bottom: 1px solid #448abd;
    508     width: 100%;
    509 }
    510 #upload-menu li {
    511     float: left;
    512     margin: 0 0 0 .75em;
    513 }
    514 #upload-menu a {
    515     display: block;
    516     padding: 5px;
    517     text-decoration: none;
    518     color: #000;
    519     border-top: 3px solid #fff;
    520 }
    521 #upload-menu .current a {
    522     background: #dfe8f1;
    523     border-right: 2px solid #448abd;
    524 }
    525 #upload-menu a:hover {
    526     background: #dfe8f1;
    527     color: #000;
    528 }
    529 .tip {
    530     color: rgb(68, 138, 189);
    531     padding: 2px 1em;
    532 }
    533 .inactive {
    534     color: #fff;
    535     padding: 1px 3px;
    536 }
    537 .left {
    538     float: left;
    539 }
    540 .right {
    541     float: right;
    542 }
    543 .center {
    544     text-align: center;
    545 }
    546 #upload-menu li.spacer {
    547     margin-left: 40px;
    548 }
    549 #title, #descr {
    550     width: 99%;
    551     margin-top: 1px;
    552 }
    553 th {
    554     width: 4.5em;
    555 }
    556 #descr {
    557     height: 36px;
    558 }
    559 #buttons {
    560     margin-top: 2px;
    561     text-align: right;
    562 }
    563 .popup {
    564     margin: 4px 4px;
    565     padding: 1px;
    566     position: absolute;
    567     width: 114px;
    568     display: none;
    569     background-color: rgb(240, 240, 238);
    570     border-top: 2px solid #fff;
    571     border-right: 2px solid #ddd;
    572     border-bottom: 2px solid #ddd;
    573     border-left: 2px solid #fff;
    574     text-align: center;
    575 }
    576 .imagewrap .popup {
    577     opacity: .90;
    578     filter:alpha(opacity=90);
    579 }
    580 .otherwrap .popup {
    581     padding-top: 20px;
    582 }
    583 .popup a, .popup a:visited, .popup a:active {
    584     background-color: transparent;
    585     display: block;
    586     width: 100%;
    587     text-decoration: none;
    588     color: #246;
    589 }
    590 .popup a:hover {
    591     background-color: #fff;
    592     color: #000;
    593 }
    594 .caption {
    595     text-align: center;
    596 }
    597 #submit {
    598     margin: 1px;
    599     width: 99%;
    600 }
    601 #submit input, #submit input:focus {
    602     background: url( images/fade-butt.png );
    603     border: 3px double #999;
    604     border-left-color: #ccc;
    605     border-top-color: #ccc;
    606     color: #333;
    607     padding: 0.25em;
    608 }
    609 #submit input:active {
    610     background: #f4f4f4;
    611     border: 3px double #ccc;
    612     border-left-color: #999;
    613     border-top-color: #999;
    614 }
    615 .zerosize {
    616     width: 0px;
    617     height: 0px;
    618     overflow: hidden;
    619     position: absolute;
    620 }
    621 #links {
    622     margin: 3px 8px;
    623     line-height: 2em;
    624 }
    625 #links textarea {
    626     width: 95%;
    627     height: 4.5em;
    628 }
     428    <?php if ( $action == 'links' ) : ?>
     429    * html { overflow-x: hidden; }
     430    <?php else : ?>
     431    * html { overflow-y: hidden; }
     432    <?php endif; ?>
     433
     434    body {
     435        font: 13px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana;
     436        border: none;
     437        margin: 0px;
     438        height: 150px;
     439        background: #dfe8f1;
     440    }
     441
     442    form { margin: 3px 2px 0px 6px; }
     443
     444    #wrap {
     445        clear: both;
     446        padding: 0px;
     447        width: 100%;
     448    }
     449
     450    #images {
     451        position: absolute;
     452        clear: both;
     453        margin: 0px;
     454        padding: 15px 15px;
     455        width: <?php echo $images_width; ?>px;
     456    }
     457
     458    #images img { background-color: rgb(209, 226, 239); }
     459
     460    <?php echo $style; ?>
     461
     462    .attwrap, .attwrap * {
     463        margin: 0px;
     464        padding: 0px;
     465        border: 0px;
     466    }
     467
     468    .imagewrap {
     469        margin-right: 5px;
     470        overflow: hidden;
     471        width: 128px;
     472    }
     473
     474    .otherwrap {
     475        margin-right: 5px;
     476        overflow: hidden;
     477        background-color: #f9fcfe;
     478    }
     479
     480    .otherwrap a { display: block; }
     481
     482    .otherwrap a, .otherwrap a:hover, .otherwrap a:active, .otherwrap a:visited { color: blue; }
     483
     484    .usingicon {
     485        padding: 0px;
     486        height: 96px;
     487        text-align: center;
     488        width: 128px;
     489    }
     490
     491    .usingtext {
     492        padding: 3px;
     493        height: 90px;
     494        text-align: left;
     495        width: 122px;
     496    }
     497
     498    .filetype {
     499        font-size: 80%;
     500        border-bottom: 3px double #89a;
     501    }
     502
     503    .imagewrap, .imagewrap img, .imagewrap a, .imagewrap a img, .imagewrap a:hover img, .imagewrap a:visited img, .imagewrap a:active img { text-decoration: none; }
     504
     505    #upload-menu {
     506        background: #fff;
     507        margin: 0px;
     508        padding: 0;
     509        list-style: none;
     510        height: 2em;
     511        border-bottom: 1px solid #448abd;
     512        width: 100%;
     513    }
     514
     515    #upload-menu li {
     516        float: left;
     517        margin: 0 0 0 .75em;
     518    }
     519
     520    #upload-menu a {
     521        display: block;
     522        padding: 5px;
     523        text-decoration: none;
     524        color: #000;
     525        border-top: 3px solid #fff;
     526    }
     527
     528    #upload-menu .current a {
     529        background: #dfe8f1;
     530        border-right: 2px solid #448abd;
     531    }
     532
     533    #upload-menu a:hover {
     534        background: #dfe8f1;
     535        color: #000;
     536    }
     537
     538    .tip {
     539        color: rgb(68, 138, 189);
     540        padding: 2px 1em;
     541    }
     542
     543    .inactive {
     544        color: #fff;
     545        padding: 1px 3px;
     546    }
     547
     548    .left { float: left; }
     549
     550    .right { float: right; }
     551
     552    .center { text-align: center; }
     553
     554    #upload-menu li.spacer { margin-left: 40px; }
     555
     556    #title, #descr {
     557        width: 99%;
     558        margin-top: 1px;
     559    }
     560
     561    th {
     562        text-align: right;
     563        width: 4.5em;
     564    }
     565
     566    #descr { height: 36px; }
     567
     568    #buttons {
     569        margin-top: 2px;
     570        text-align: right;
     571    }
     572
     573    .popup {
     574        margin: 4px 4px;
     575        padding: 1px;
     576        position: absolute;
     577        width: 114px;
     578        display: none;
     579        background-color: rgb(240, 240, 238);
     580        border-top: 2px solid #fff;
     581        border-right: 2px solid #ddd;
     582        border-bottom: 2px solid #ddd;
     583        border-left: 2px solid #fff;
     584        text-align: center;
     585    }
     586
     587    .imagewrap .popup {
     588        opacity: .90;
     589        filter:alpha(opacity=90);
     590    }
     591
     592    .otherwrap .popup { padding-top: 20px; }
     593
     594    .popup a, .popup a:visited, .popup a:active {
     595        background-color: transparent;
     596        display: block;
     597        width: 100%;
     598        text-decoration: none;
     599        color: #246;
     600    }
     601
     602    .popup a:hover {
     603        background-color: #fff;
     604        color: #000;
     605    }
     606
     607    .caption { text-align: center; }
     608
     609    #submit {
     610        margin: 1px;
     611        width: 99%;
     612    }
     613
     614    #submit input, #submit input:focus {
     615        background: url( images/fade-butt.png );
     616        border: 3px double #999;
     617        border-left-color: #ccc;
     618        border-top-color: #ccc;
     619        color: #333;
     620        padding: 0.25em;
     621    }
     622
     623    #submit input:active {
     624        background: #f4f4f4;
     625        border: 3px double #ccc;
     626        border-left-color: #999;
     627        border-top-color: #999;
     628    }
     629
     630    .zerosize {
     631        width: 0px;
     632        height: 0px;
     633        overflow: hidden;
     634        position: absolute;
     635    }
     636
     637    #links {
     638        margin: 3px 8px;
     639        line-height: 2em;
     640    }
     641
     642    #links textarea {
     643        width: 95%;
     644        height: 4.5em;
     645    }
    629646</style>
     647<?php if ( ('rtl' == $wp_locale->text_direction) ): ?>
     648<style type="text/css">
     649    body { font: 13px Tahoma, "Lucida Grande", "Lucida Sans Unicode", Verdana; }
     650
     651    .usingtext { text-align: right; }
     652
     653    th { text-align: left; }
     654
     655    .left, #upload-menu li { float: right; }
     656
     657    .right { float: left; }
     658
     659    .popup {
     660        border-right: 2px solid #fff;
     661        border-left: 2px solid #ddd;
     662    }
     663
     664    #upload-menu .current a {
     665        border-right: 0;
     666        border-left: 2px solid #448abd;
     667    }
     668
     669    #submit input, #submit input:focus {
     670        border-left: 0;
     671        border-right-color: #ccc;
     672    }
     673
     674    #submit input:active {
     675        border-left: 0;
     676        border-right-color: #999;
     677    }
     678</style>
     679<?php endif; ?>
    630680</head>
    631681<body>
    632682<ul id="upload-menu">
    633 <li<?php echo $current_1; ?>><a href="<?php echo basename(__FILE__) . "?action=upload&amp;post=$post&amp;all=$all&amp;start=$start"; ?>"><?php _e('Upload'); ?></a></li>
    634 <?php if ( $attachments = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_parent = '$post'") ) { ?>
    635 <li<?php echo $current_2; ?>><a href="<?php echo basename(__FILE__) . "?action=view&amp;post=$post&amp;all=false"; ?>"><?php _e('Browse'); ?></a></li>
    636 <?php } ?>
    637 <?php if ($wpdb->get_var("SELECT count(ID) FROM $wpdb->posts WHERE post_type = 'attachment'")) { ?>
    638 <li<?php echo $current_3; ?>><a href="<?php echo basename(__FILE__) . "?action=view&amp;post=$post&amp;all=true"; ?>"><?php _e('Browse All'); ?></a></li>
    639 <?php } ?>
    640 <li> </li>
    641 <?php if ( $action == 'view' ) { ?>
    642 <?php if ( false !== $back ) : ?>
    643 <li class="spacer"><a href="<?php echo basename(__FILE__) . "?action=$action&amp;post=$post&amp;all=$all&amp;start=0"; ?>" title="<?php _e('First'); ?>">|&laquo;</a></li>
    644 <li><a href="<?php echo basename(__FILE__) . "?action=$action&amp;post=$post&amp;all=$all&amp;start=$back"; ?>">&laquo; <?php _e('Back'); ?></a></li>
    645 <?php else : ?>
    646 <li class="inactive spacer">|&laquo;</li>
    647 <li class="inactive">&laquo; <?php _e('Back'); ?></li>
    648 <?php endif; ?>
    649 <?php if ( false !== $next ) : ?>
    650 <li><a href="<?php echo basename(__FILE__) . "?action=$action&amp;post=$post&amp;all=$all&amp;start=$next"; ?>"><?php _e('Next &raquo;'); ?></a></li>
    651 <li><a href="<?php echo basename(__FILE__) . "?action=$action&amp;post=$post&amp;all=$all&amp;last=true"; ?>" title="<?php _e('Last'); ?>">&raquo;|</a></li>
    652 <?php else : ?>
    653 <li class="inactive"><?php _e('Next &raquo;'); ?></li>
    654 <li class="inactive">&raquo;|</li>
    655 <?php endif; ?>
    656 <?php } // endif not upload?>
     683    <li<?php echo $current_1; ?>><a href="<?php echo basename(__FILE__) . "?action=upload&amp;post=$post&amp;all=$all&amp;start=$start"; ?>"><?php _e('Upload'); ?></a></li>
     684
     685    <?php if ( $attachments = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_parent = '$post'") ): ?>
     686        <li<?php echo $current_2; ?>><a href="<?php echo basename(__FILE__) . "?action=view&amp;post=$post&amp;all=false"; ?>"><?php _e('Browse'); ?></a></li>
     687    <?php endif; ?>
     688
     689    <?php if ($wpdb->get_var("SELECT count(ID) FROM $wpdb->posts WHERE post_type = 'attachment'")): ?>
     690        <li<?php echo $current_3; ?>><a href="<?php echo basename(__FILE__) . "?action=view&amp;post=$post&amp;all=true"; ?>"><?php _e('Browse All'); ?></a></li>
     691    <?php endif; ?>
     692
     693    <li> </li>
     694
     695    <?php if ( $action == 'view' ): ?>
     696        <?php if ( false !== $back ): ?>
     697            <li class="spacer"><a href="<?php echo basename(__FILE__) . "?action=$action&amp;post=$post&amp;all=$all&amp;start=0"; ?>" title="<?php _e('First'); ?>">|&laquo;</a></li>
     698            <li><a href="<?php echo basename(__FILE__) . "?action=$action&amp;post=$post&amp;all=$all&amp;start=$back"; ?>">&laquo; <?php _e('Back'); ?></a></li>
     699        <?php else: ?>
     700            <li class="inactive spacer">|&laquo;</li>
     701            <li class="inactive">&laquo; <?php _e('Back'); ?></li>
     702        <?php endif; ?>
     703
     704        <?php if ( false !== $next ): ?>
     705            <li><a href="<?php echo basename(__FILE__) . "?action=$action&amp;post=$post&amp;all=$all&amp;start=$next"; ?>"><?php _e('Next &raquo;'); ?></a></li>
     706            <li><a href="<?php echo basename(__FILE__) . "?action=$action&amp;post=$post&amp;all=$all&amp;last=true"; ?>" title="<?php _e('Last'); ?>">&raquo;|</a></li>
     707        <?php else: ?>
     708            <li class="inactive"><?php _e('Next &raquo;'); ?></li>
     709            <li class="inactive">&raquo;|</li>
     710        <?php endif; ?>
     711    <?php endif; ?>
    657712</ul>
    658 <?php if ( $action == 'view' ) : ?>
    659 <div id="wrap">
    660 <!--<div class="tip"><?php _e('You can drag and drop these items into your post. Click on one for more options.'); ?></div>-->
    661 <div id="images">
    662 <?php echo $html; ?>
    663 <?php echo $popups; ?>
    664 </div>
    665 </div>
    666 <?php elseif ( $action == 'upload' ) : ?>
    667 <div class="tip"></div>
    668 <form enctype="multipart/form-data" id="uploadForm" method="post" action="<?php echo basename(__FILE__); ?>">
    669 <table style="width:99%;">
    670 <tr>
    671 <th scope="row" align="right"><label for="upload"><?php _e('File:'); ?></label></th>
    672 <td><input type="file" id="upload" name="image" /></td>
    673 </tr>
    674 <tr>
    675 <th scope="row" align="right"><label for="title"><?php _e('Title:'); ?></label></th>
    676 <td><input type="text" id="title" name="imgtitle" /></td>
    677 </tr>
    678 <tr>
    679 <th scope="row" align="right"><label for="descr"><?php _e('Description:'); ?></label></th>
    680 <td><input type="textarea" name="descr" id="descr" value="" /></td>
    681 </tr>
    682 <tr id="buttons">
    683 <th></th>
    684 <td>
    685 <input type="hidden" name="action" value="save" />
    686 <input type="hidden" name="post" value="<?php echo $post; ?>" />
    687 <input type="hidden" name="all" value="<?php echo $all; ?>" />
    688 <input type="hidden" name="start" value="<?php echo $start; ?>" />
    689 <?php wp_nonce_field( 'inlineuploading' ); ?>
    690 <div id="submit">
    691 <input type="submit" value="<?php _e('Upload'); ?>" />
    692 <?php if ( !empty($all) ) : ?>
    693 <input type="button" value="<?php _e('Cancel'); ?>" onclick="cancelUpload()" />
    694 <?php endif; ?>
    695 </div>
    696 </td>
    697 </tr>
    698 </table>
    699 </form>
    700 <?php elseif ( $action == 'links' ) : ?>
    701 <div id="links">
    702 <?php the_attachment_links($attachment); ?>
    703 </div>
     713
     714<?php if ( $action == 'view' ): ?>
     715    <div id="wrap">
     716        <!--<div class="tip"><?php _e('You can drag and drop these items into your post. Click on one for more options.'); ?></div>-->
     717        <div id="images">
     718            <?php echo $html; ?>
     719            <?php echo $popups; ?>
     720        </div>
     721    </div>
     722<?php elseif ( $action == 'upload' ): ?>
     723    <div class="tip"></div>
     724    <form enctype="multipart/form-data" id="uploadForm" method="post" action="<?php echo basename(__FILE__); ?>">
     725        <table style="width: 99%">
     726            <tr>
     727                <th scope="row"><label for="upload"><?php _e('File:'); ?></label></th>
     728                <td><input type="file" id="upload" name="image" /></td>
     729            </tr>
     730            <tr>
     731                <th scope="row"><label for="title"><?php _e('Title:'); ?></label></th>
     732                <td><input type="text" id="title" name="imgtitle" /></td>
     733            </tr>
     734            <tr>
     735                <th scope="row"><label for="descr"><?php _e('Description:'); ?></label></th>
     736                <td><input type="textarea" name="descr" id="descr" value="" /></td>
     737            </tr>
     738            <tr id="buttons">
     739                <th></th>
     740                <td>
     741                    <input type="hidden" name="action" value="save" />
     742                    <input type="hidden" name="post" value="<?php echo $post; ?>" />
     743                    <input type="hidden" name="all" value="<?php echo $all; ?>" />
     744                    <input type="hidden" name="start" value="<?php echo $start; ?>" />
     745                    <?php wp_nonce_field( 'inlineuploading' ); ?>
     746                    <div id="submit">
     747                        <input type="submit" value="<?php _e('Upload'); ?>" />
     748                        <?php if ( !empty($all) ): ?>
     749                            <input type="button" value="<?php _e('Cancel'); ?>" onclick="cancelUpload()" />
     750                        <?php endif; ?>
     751                    </div>
     752                </td>
     753            </tr>
     754        </table>
     755    </form>
     756<?php elseif ( $action == 'links' ): ?>
     757    <div id="links">
     758        <?php the_attachment_links($attachment); ?>
     759    </div>
    704760<?php endif; ?>
    705761</body>
Note: See TracChangeset for help on using the changeset viewer.