Ticket #9434: press-this-roles.patch
| File press-this-roles.patch, 4.6 KB (added by , 17 years ago) |
|---|
-
wp-admin/tools.php
77 77 } ?> 78 78 </div> 79 79 80 <?php if ( current_user_can(' publish_posts') ) : ?>80 <?php if ( current_user_can('edit_posts') ) : ?> 81 81 <div class="tool-box"> 82 82 <h3 class="title"><?php _e('Press This') ?></h3> 83 83 <p><?php _e('Press This is a bookmarklet: a little app that runs in your browser and lets you grab bits of the web.');?></p> -
wp-admin/press-this.php
10 10 require_once('admin.php'); 11 11 header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 12 12 13 if ( ! current_user_can(' publish_posts') ) wp_die( __( 'Cheatin’ uh?' ) );13 if ( ! current_user_can('edit_posts') ) wp_die( __( 'Cheatin’ uh?' ) ); 14 14 15 15 /** 16 16 * Replace forward slash with backslash and slash. … … 64 64 $post_ID = wp_insert_post($quick, true); 65 65 $content = $_REQUEST['content']; 66 66 67 if( $_REQUEST['photo_src'])67 if( $_REQUEST['photo_src'] && current_user_can('upload_files') ) 68 68 foreach( (array) $_REQUEST['photo_src'] as $key => $image) 69 69 // see if files exist in content - we don't want to upload non-used selected files. 70 70 if( strpos($_REQUEST['content'], $image) !== false ) { 71 71 $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); 77 75 } 78 76 79 77 // set the post_content and status … … 461 459 462 460 <!-- This div holds the photo metadata --> 463 461 <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 465 478 <div id="categorydiv" class="stuffbox"> 466 479 <h3><?php _e('Categories') ?></h3> 467 480 <div class="inside"> … … 502 515 <p class="tagcloud-link"><a href="#titlediv" class="tagcloud-link" id="link-post_tag"><?php _e('Choose from the most used tags in Post Tags'); ?></a></p> 503 516 </div> 504 517 </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>515 518 </div> 516 519 </div> 517 520 … … 530 533 531 534 <div class="postdivrich"> 532 535 <ul id="actions"> 536 533 537 <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="#"> 535 539 <img alt="<?php _e('Insert an Image'); ?>" src="images/media-button-image.gif"/></a> 540 <?php } ?> 536 541 </li> 537 542 <li id="video_button"> 538 543 <a title="<?php _e('Embed a Video'); ?>" href="#"><img alt="<?php _e('Embed a Video'); ?>" src="images/media-button-video.gif"/></a> -
wp-admin/css/press-this.css
16 16 background: #444 !important; 17 17 } 18 18 19 .tagchecklist span a { 20 background: transparent url(../images/xit.gif) no-repeat 0 0; 21 } 22 19 23 #poststuff #edButtonPreview, 20 24 #poststuff #edButtonHTML { 21 25 -moz-border-radius: 3px 3px 0 0;