Make WordPress Core

Changeset 10855


Ignore:
Timestamp:
04/01/2009 05:41:52 AM (16 years ago)
Author:
markjaquith
Message:

Press This UI, Quoting fixes, plus ability for Contributors to use Press This. props noel. fixes #9434

Location:
trunk/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/press-this.css

    r10290 r10855  
    1515    padding-top: 4px;
    1616    background: #444 !important;
     17}
     18
     19.tagchecklist span a {
     20background: transparent url(../images/xit.gif) no-repeat 0 0;
    1721}
    1822
  • trunk/wp-admin/press-this.php

    r10810 r10855  
    1111header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
    1212
    13 if ( ! current_user_can('publish_posts') ) wp_die( __( 'Cheatin’ uh?' ) );
     13if ( ! current_user_can('edit_posts') ) wp_die( __( 'Cheatin’ uh?' ) );
    1414
    1515/**
     
    6565    $content = $_REQUEST['content'];
    6666
    67     if($_REQUEST['photo_src'])
     67    if( $_REQUEST['photo_src'] && current_user_can('upload_files') )
    6868        foreach( (array) $_REQUEST['photo_src'] as $key => $image)
    6969            // see if files exist in content - we don't want to upload non-used selected files.
    7070            if( strpos($_REQUEST['content'], $image) !== false ) {
    7171                $upload = media_sideload_image($image, $post_ID, $_REQUEST['photo_description'][$key]);
    72 
    73                 // Replace the POSTED content <img> with correct uploaded ones.
    74                 // escape quote for matching
    75                 $quoted = preg_quote2($image);
    76                 if( !is_wp_error($upload) ) $content = preg_replace('/<img ([^>]*)src=(\"|\')'.$quoted.'(\2)([^>\/]*)\/*>/is', $upload, $content);
     72               
     73                // Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes
     74                if( !is_wp_error($upload) ) $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote2($image).'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content);
    7775            }
    7876
     
    462460            <!-- This div holds the photo metadata -->
    463461            <div class="photolist"></div>
    464 
     462           
     463            <div id="submitdiv" class="stuffbox">
     464                <h3><?php _e('Publish') ?></h3>
     465                <div class="inside">
     466                    <p>
     467                        <input class="button" type="submit" name="draft" value="<?php _e('Save Draft') ?>" id="save" />
     468                        <?php if ( current_user_can('publish_posts') ) { ?>
     469                            <input class="button-primary" type="submit" name="publish" value="<?php _e('Publish') ?>" id="publish" />
     470                        <?php } else { ?>
     471                            <br /><br /><input class="button-primary" type="submit" name="review" value="<?php _e('Submit for Review') ?>" id="review" />
     472                        <?php } ?>
     473                        <img src="images/loading-publish.gif" alt="" id="saving" style="display:none;" />
     474                    </p>
     475                </div>
     476            </div>
     477           
    465478            <div id="categorydiv" class="stuffbox">
    466479                <h3><?php _e('Categories') ?></h3>
     
    503516                </div>
    504517            </div>
    505             <div id="submitdiv" class="stuffbox">
    506                 <h3><?php _e('Publish') ?></h3>
    507                 <div class="inside">
    508                     <p>
    509                         <input class="button" type="submit" name="draft" value="<?php _e('Save Draft') ?>" id="save" />
    510                         <input class="button-primary" type="submit" name="publish" value="<?php _e('Publish') ?>" id="publish" />
    511                         <img src="images/loading-publish.gif" alt="" id="saving" style="display:none;" />
    512                     </p>
    513                 </div>
    514             </div>
    515518        </div>
    516519    </div>
     
    531534        <div class="postdivrich">
    532535            <ul id="actions">
     536               
    533537                <li id="photo_button">
    534                     Add: <a title="<?php _e('Insert an Image'); ?>" href="#">
     538                    Add: <?php if ( current_user_can('upload_files') ) { ?><a title="<?php _e('Insert an Image'); ?>" href="#">
    535539<img alt="<?php _e('Insert an Image'); ?>" src="images/media-button-image.gif"/></a>
     540                    <?php } ?>
    536541                </li>
    537542                <li id="video_button">
  • trunk/wp-admin/tools.php

    r10746 r10855  
    7878</div>
    7979
    80 <?php if ( current_user_can('publish_posts') ) : ?>
     80<?php if ( current_user_can('edit_posts') ) : ?>
    8181<div class="tool-box">
    8282    <h3 class="title"><?php _e('Press This') ?></h3>
Note: See TracChangeset for help on using the changeset viewer.