Changeset 8889
- Timestamp:
- 09/14/2008 12:58:00 PM (18 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 11 edited
-
css/colors-classic.css (modified) (1 diff)
-
css/colors-fresh.css (modified) (1 diff)
-
edit-form-advanced.php (modified) (11 diffs)
-
edit-link-form.php (modified) (2 diffs)
-
edit-page-form.php (modified) (7 diffs)
-
includes/post.php (modified) (2 diffs)
-
includes/template.php (modified) (1 diff)
-
js/page.js (modified) (2 diffs)
-
js/post.js (modified) (2 diffs)
-
js/postbox.js (modified) (5 diffs)
-
wp-admin.css (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/colors-classic.css
r8884 r8889 781 781 } 782 782 783 .submitbox .submitdelete {784 color: #fff;785 }786 787 783 #edit-settings-wrap, 788 784 #show-settings { -
trunk/wp-admin/css/colors-fresh.css
r8884 r8889 770 770 } 771 771 772 .submitbox .submitdelete {773 color: #fff;774 }775 776 772 #edit-settings-wrap, 777 773 #show-settings { -
trunk/wp-admin/edit-form-advanced.php
r8883 r8889 64 64 function post_submit_meta_box($post) { 65 65 global $action; 66 67 $can_publish = current_user_can('publish_posts'); 66 68 ?> 67 69 <div class="submitbox" id="submitpost"> … … 69 71 <div class="inside-submitbox"> 70 72 71 < p><label for='post_status'><?php _e('This post is') ?></label>73 <div class="insidebox"><label for="post_status"><?php _e('This post is') ?></label> 72 74 <strong><span id="post-status-display"> 73 75 <?php … … 89 91 ?> 90 92 </span></strong> 91 <a href="#edit_post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> 92 </p> 93 94 <p id='post-status-select' class="hide-if-js"> 93 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?> 94 <a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> 95 96 <div id="post-status-select" class="hide-if-js"> 97 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" /> 98 <?php _e('Change post status'); ?><br /> 95 99 <select name='post_status' id='post_status' tabindex='4'> 96 100 <?php 97 101 // only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability) 98 if ( current_user_can('publish_posts') OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) : ?> 99 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?> 102 if ( $can_publish OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) : ?> 100 103 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option> 101 <?php } ?>102 104 <?php if ( 'future' == $post->post_status ) : ?> 103 105 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option> … … 107 109 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option> 108 110 </select> 109 </p> 110 111 <?php if ( current_user_can( 'publish_posts' ) ) : ?> 112 <?php if ( current_user_can( 'edit_others_posts' ) ) : ?> 113 <p id="sticky-checkbox"><label for="sticky" class="selectit"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID), true); ?> tabindex="4" /> <?php _e('Stick this post to the front page') ?></label></p> 114 <?php endif; ?> 115 <?php endif; ?> 111 112 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a> 113 <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a> 114 </div> 115 </div> 116 117 <?php } else { ?> 118 </div> 119 120 <?php if ( $can_publish && 'pending' != $post->post_status ) { ?> 121 <div class="insidebox"><input name="pending" type="submit" class="button" id="pending" tabindex="6" accesskey="r" value="<?php _e('Submit for Review') ?>" /></div> 122 <?php } ?> 123 124 <?php } ?> 125 126 <?php if ( $can_publish && current_user_can( 'edit_others_posts' ) ) { ?> 127 <div class="insidebox" id="sticky-checkbox"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID), true); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick this post to the front page') ?></label></div> 128 <?php } ?> 129 130 <?php 131 if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?> 132 <div class="insidebox" id="deletebutton"><a class="submitdelete" href="<?php echo wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete post'); ?></a></div> 133 <?php } ?> 134 116 135 <?php 117 136 if ( 0 != $post->ID ) { 118 137 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 119 $stamp = __('Scheduled for: <br />%1$s at %2$s');138 $stamp = __('Scheduled for: %1$s at %2$s'); 120 139 } else if ( 'publish' == $post->post_status ) { // already published 121 $stamp = __('Published on: <br />%1$s at %2$s');140 $stamp = __('Published on: %1$s at %2$s'); 122 141 } else if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified 123 142 $stamp = __('Publish immediately'); 124 143 } else { // draft, 1 or more saves, date specified 125 $stamp = __('Publish on: <br />%1$s at %2$s');144 $stamp = __('Publish on: %1$s at %2$s'); 126 145 } 127 146 $date = mysql2date(get_option('date_format'), $post->post_date); … … 133 152 } 134 153 ?> 135 <?php if ( current_user_can( 'publish_posts' )) : // Contributors don't get to choose the date of publish ?>136 < p class="curtime"><?php printf($stamp, $date, $time); ?>137 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> </p>138 139 <div id= 'timestampdiv' class='hide-if-js'><?php touch_time(($action == 'edit'),1,4); ?></div>154 <?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?> 155 <div class="insidebox curtime"><span id="timestamp"><?php printf($stamp, $date, $time); ?></span> 156 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> 157 158 <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div></div> 140 159 <?php endif; ?> 141 160 … … 144 163 <p class="submit"> 145 164 <?php do_action('post_submitbox_start'); ?> 146 <input type="submit" name="save" id="save-post" value="<?php _e('Save Draft'); ?>" tabindex="4" class="button button-highlighted" /> 165 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) 166 $savebtn = attribute_escape( __('Save') ); 167 else 168 $savebtn = attribute_escape( __('Save Draft') ); 169 ?> 170 <input type="submit" name="save" id="save-post" value="<?php echo $savebtn; ?>" tabindex="4" class="button button-highlighted" /> 147 171 148 172 <?php if ( 'publish' == $post->post_status ) { ?> 149 173 <a class="preview button" href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View this Post'); ?></a> 150 174 <?php } else { ?> 151 <a class="preview button" href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" target="_blank" tabindex="4"><?php _e('Preview'); ?></a>175 <a class="preview button" href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" target="_blank" tabindex="4"><?php _e('Preview'); ?></a> 152 176 <?php } ?> 153 177 154 178 <?php 155 if ( ( 'edit' == $action) && current_user_can('delete_post', $post->ID) ) 156 echo "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete post') . "</a>"; 157 ?> 158 <br class="clear" /> 159 <?php 160 if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) { 161 ?> 179 if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) { ?> 162 180 <?php if ( current_user_can('publish_posts') ) : ?> 163 181 <input name="publish" type="submit" class="button" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> … … 167 185 <?php } ?> 168 186 169 <!-- moved under the editor170 <?php if ( 0 != $post->ID ): ?>171 <?php if ( $last_id = get_post_meta($post->ID, '_edit_last', true) ) {172 $last_user = get_userdata($last_id);173 printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));174 } else {175 printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));176 }177 ?>178 <br class="clear" />179 <?php endif; ?>180 -->181 182 187 </p> 183 </div> 188 <div class="clear"></div> 189 </div> 190 184 191 <?php 185 192 } … … 274 281 275 282 function post_trackback_meta_box($post) { 276 $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';283 $form_trackback = '<input type="text" name="trackback_url" id="trackback_url" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />'; 277 284 if ('' != $post->pinged) { 278 285 $pings = '<p>'. __('Already pinged:') . '</p><ul>'; … … 288 295 <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a> on this post') ?></label> 289 296 </p> 290 <p><label for="trackback "><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>297 <p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p> 291 298 <p><?php _e('Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress blogs they’ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p> 292 299 <?php … … 439 446 else 440 447 wp_nonce_field('update-post_' . $post_ID); 441 442 $form_pingback = '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />';443 444 $form_prevstatus = '<input type="hidden" name="prev_status" value="' . attribute_escape( $post->post_status ) . '" />';445 446 $saveasdraft = '<input name="save" type="submit" id="save" class="button" tabindex="3" value="' . attribute_escape( __('Save and Continue Editing') ) . '" />';447 448 448 449 ?> … … 542 543 <?php 543 544 544 echo $form_pingback;545 echo $form_prevstatus;546 547 545 do_meta_boxes('post', 'normal', $post); 548 546 -
trunk/wp-admin/edit-link-form.php
r8883 r8889 42 42 43 43 <div class="inside-submitbox"> 44 < p><label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label></p>44 <div class="insidebox"><label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label></div> 45 45 </div> 46 46 … … 53 53 54 54 <?php 55 if ( ( 'edit' == $action)&& current_user_can('manage_links') )55 if ( 'edit' == $_GET['action'] && current_user_can('manage_links') ) 56 56 echo "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm('" . js_escape( sprintf( __("You are about to delete this link '%s'\n'Cancel' to stop, 'OK' to delete."), $link->link_name )) . "') ) { return true;}return false;\">" . __('Delete link') . "</a>"; 57 57 ?> 58 58 </p> 59 59 <?php do_action('submitlink_box'); ?> 60 <div class="clear"></div> 60 61 </div> 61 62 <?php -
trunk/wp-admin/edit-page-form.php
r8883 r8889 58 58 function page_submit_meta_box($post) { 59 59 global $action; 60 61 $can_publish = current_user_can('publish_pages'); 60 62 ?> 61 63 <div class="submitbox" id="submitpage"> … … 63 65 <div class="inside-submitbox"> 64 66 65 < p><label for='post_status'><?php _e('This postis') ?></label>67 <div class="insidebox"><label for='post_status'><?php _e('This page is') ?></label> 66 68 <strong><span id="post-status-display"> 67 69 <?php … … 83 85 ?> 84 86 </span></strong> 87 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?> 85 88 <a href="#edit_post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> 86 </p> 87 88 <p id='post-status-select' class="hide-if-js"> 89 90 <div id="post-status-select" class="hide-if-js"> 91 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" /> 92 <?php _e('Change page status'); ?><br /> 89 93 <select name='post_status' id='post_status' tabindex='4'> 90 94 <?php 91 95 // only show the publish menu item if they are allowed to publish posts or they are allowed to edit this post (accounts for 'edit_published_posts' capability) 92 if ( current_user_can('publish_pages') OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) : ?> 93 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?> 96 if ( $can_publish OR ( $post->post_status == 'publish' AND current_user_can('edit_page', $post->ID) ) ) : ?> 94 97 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option> 95 <?php } ?>96 98 <?php if ( 'future' == $post->post_status ) : ?> 97 99 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option> … … 101 103 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Unpublished') ?></option> 102 104 </select> 103 </p> 105 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a> 106 <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a> 107 </div> 108 </div> 109 110 <?php } else { ?> 111 </div> 112 113 <?php if ( $can_publish && 'pending' != $post->post_status ) { ?> 114 <div class="insidebox"><input name="pending" type="submit" class="button" id="pending" tabindex="6" accesskey="r" value="<?php _e('Submit for Review') ?>" /></div> 115 <?php } ?> 116 117 <?php } ?> 118 119 <?php if ( ('edit' == $action) && current_user_can('delete_page', $post->ID) ) { ?> 120 <div class="insidebox" id="deletebutton"><a class="submitdelete" href="<?php echo wp_nonce_url("page.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete page'); ?></a></div> 121 <?php } ?> 104 122 105 123 <?php 106 124 if ( 0 != $post->ID ) { 107 125 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 108 $stamp = __('Scheduled for: <br />%1$s at %2$s');126 $stamp = __('Scheduled for: %1$s at %2$s'); 109 127 } else if ( 'publish' == $post->post_status ) { // already published 110 $stamp = __('Published on: <br />%1$s at %2$s');128 $stamp = __('Published on: %1$s at %2$s'); 111 129 } else if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified 112 130 $stamp = __('Publish immediately'); 113 131 } else { // draft, 1 or more saves, date specified 114 $stamp = __('Publish on: <br />%1$s at %2$s');132 $stamp = __('Publish on: %1$s at %2$s'); 115 133 } 116 134 $date = mysql2date(get_option('date_format'), $post->post_date); … … 122 140 } 123 141 ?> 124 <?php if ( current_user_can( 'publish_pages' )) : // Contributors don't get to choose the date of publish ?>125 < p class="curtime"><?php printf($stamp, $date, $time); ?>142 <?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?> 143 <div class="insidebox curtime"><span id="timestamp"><?php printf($stamp, $date, $time); ?></span> 126 144 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a></p> 127 145 128 <div id= 'timestampdiv' class='hide-if-js'><?php touch_time(($action == 'edit'),1,4); ?></div>146 <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div></div> 129 147 <?php endif; ?> 130 148 … … 133 151 <p class="submit"> 134 152 <?php do_action('page_submitbox_start'); ?> 135 <input type="submit" name="save" class="button button-highlighted" value="<?php _e('Save'); ?>" tabindex="4" /> 153 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) 154 $savebtn = attribute_escape( __('Save') ); 155 else 156 $savebtn = attribute_escape( __('Save Draft') ); 157 ?> 158 <input type="submit" name="save" id="save-post" value="<?php echo $savebtn; ?>" tabindex="4" class="button button-highlighted" /> 136 159 137 160 <?php if ( 'publish' == $post->post_status ) { ?> 138 161 <a class="preview button" href="<?php echo clean_url(get_permalink($post->ID)); ?>" target="_blank" tabindex="4"><?php _e('View this Page'); ?></a> 139 162 <?php } else { ?> 140 <a class="preview button" href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" target="_blank" tabindex="4"><?php _e('Preview'); ?></a>163 <a class="preview button" href="<?php echo clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" target="_blank" tabindex="4"><?php _e('Preview'); ?></a> 141 164 <?php } ?> 142 165 143 <?php if ( ('edit' == $action) && current_user_can('delete_page', $post->ID) ) 144 echo "<a class='submitdelete' href='" . wp_nonce_url("page.php?action=delete&post=$post->ID", 'delete-page_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete page') . "</a>"; 145 ?> 146 <br class="clear" /> 147 <?php 148 if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) { 149 ?> 166 <?php 167 if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) { ?> 150 168 <?php if ( current_user_can('publish_pages') ) : ?> 151 169 <input name="publish" type="submit" class="button" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> … … 153 171 <input name="publish" type="submit" class="button" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" /> 154 172 <?php endif; ?> 155 <?php 156 } 157 ?> 158 159 <!-- moved under the editor 160 <?php if ( 0 != $post->ID ) : ?> 161 <?php if ( $last_id = get_post_meta($post->ID, '_edit_last', true) ) { 162 $last_user = get_userdata($last_id); 163 printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); 164 } else { 165 printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); 166 } 167 ?> 168 <br class="clear" /> 169 <?php endif; ?> 170 --> 173 <?php } ?> 171 174 172 175 </p> 173 </div> 176 <div class="clear"></div> 177 </div> 178 174 179 <?php 175 180 } -
trunk/wp-admin/includes/post.php
r8861 r8889 63 63 if ( isset($post_data['advanced']) && '' != $post_data['advanced'] ) 64 64 $post_data['post_status'] = 'draft'; 65 if ( isset($post_data['pending']) && '' != $post_data['pending'] ) 66 $post_data['post_status'] = 'pending'; 65 67 66 68 $previous_status = get_post_field('post_status', $post_data['ID']); … … 68 70 // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published. 69 71 // Change status from 'publish' to 'pending' if user lacks permissions to publish or to resave published posts. 70 if ( 'page' == $post_data['post_type'] ) { 71 if ( 'publish' == $post_data['post_status'] && !current_user_can( 'publish_pages' ) ) 72 if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') ) 73 $post_data['post_status'] = 'pending'; 74 } else { 75 if ( isset($post_data['post_status']) && ('publish' == $post_data['post_status'] && !current_user_can( 'publish_posts' )) ) : 76 // Stop attempts to publish new posts, but allow already published posts to be saved if appropriate. 77 if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_posts') ) 78 $post_data['post_status'] = 'pending'; 79 endif; 80 } 81 72 if ( isset($post_data['post_status']) && ('publish' == $post_data['post_status'] && !current_user_can( 'publish_posts' )) ) 73 if ( $previous_status != 'publish' OR !current_user_can( 'edit_published_pages') ) 74 $post_data['post_status'] = 'pending'; 75 76 if ( ! isset($post_data['post_status']) ) 77 $post_data['post_status'] = $previous_status; 78 82 79 if (!isset( $post_data['comment_status'] )) 83 80 $post_data['comment_status'] = 'closed'; -
trunk/wp-admin/includes/template.php
r8888 r8889 1572 1572 1573 1573 <a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php _e('OK'); ?></a> 1574 <a href="#edit_timestamp" class=" edit-timestamp hide-if-no-js"><?php _e('Cancel'); ?></a>1574 <a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js"><?php _e('Cancel'); ?></a> 1575 1575 <?php 1576 1576 } -
trunk/wp-admin/js/page.js
r8883 r8889 11 11 jQuery('#pageslugdiv').hide(); 12 12 13 jQuery('.edit-timestamp').click(function () { 14 if (jQuery('#timestampdiv').is(":hidden")) { 15 jQuery('#curtime').slideUp("normal"); 16 jQuery('#timestampdiv').slideDown("normal"); 17 } else { 18 jQuery('#timestampdiv').slideUp("normal"); 19 jQuery('#mm').val(jQuery('#hidden_mm').val()); 20 jQuery('#jj').val(jQuery('#hidden_jj').val()); 21 jQuery('#aa').val(jQuery('#hidden_aa').val()); 22 jQuery('#hh').val(jQuery('#hidden_hh').val()); 23 jQuery('#mn').val(jQuery('#hidden_mn').val()); 24 jQuery('#curtime').slideDown("normal"); 13 var stamp = $('#timestamp').html(); 14 15 $('.edit-timestamp').click(function () { 16 if ($('#timestampdiv').is(":hidden")) { 17 $('#timestampdiv').slideDown("normal"); 18 $('.edit-timestamp').hide(); 25 19 } 20 26 21 return false; 27 22 }); 28 23 29 jQuery('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels 30 jQuery('#timestampdiv').hide(); 31 var link = jQuery('.timestamp a').clone( true ); 32 jQuery('.timestamp').show().html( 33 jQuery( '#mm option[value=' + jQuery('#mm').val() + ']' ).text() + ' ' + 34 jQuery('#jj').val() + ',' + 35 jQuery('#aa').val() + '@' + 36 jQuery('#hh').val() + ':' + 37 jQuery('#mn').val() + ' ' 38 ).append( link ); 39 jQuery('#curtime').slideDown("normal"); 24 $('.cancel-timestamp').click(function() { 25 $('#timestampdiv').slideUp("normal"); 26 $('#mm').val($('#hidden_mm').val()); 27 $('#jj').val($('#hidden_jj').val()); 28 $('#aa').val($('#hidden_aa').val()); 29 $('#hh').val($('#hidden_hh').val()); 30 $('#mn').val($('#hidden_mn').val()); 31 $('#timestamp').html(stamp); 32 $('.edit-timestamp').show(); 33 34 return false; 35 }); 36 37 $('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels 38 $('#timestampdiv').slideUp("normal"); 39 $('.edit-timestamp').show(); 40 $('#timestamp').html( 41 $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' + 42 $('#jj').val() + ', ' + 43 $('#aa').val() + ' @ ' + 44 $('#hh').val() + ':' + 45 $('#mn').val() + ' ' 46 ); 47 40 48 return false; 41 49 }); … … 62 70 }); 63 71 64 jQuery('.edit-post-status').click(function () { 65 if (jQuery('#post-status-select').is(":hidden")) { 66 jQuery('#post-status-select').slideDown("normal"); 67 } else { 68 jQuery('#post-status-select').slideUp("normal"); 69 jQuery('#post-status-display').html(jQuery('#post_status :selected').text()); 72 $('.edit-post-status').click(function() { 73 if ($('#post-status-select').is(":hidden")) { 74 $('#post-status-select').slideDown("normal"); 75 $(this).hide(); 70 76 } 77 78 return false; 79 }); 80 81 $('.save-post-status').click(function() { 82 $('#post-status-select').slideUp("normal"); 83 $('#post-status-display').html($('#post_status :selected').text()); 84 $('.edit-post-status').show(); 85 86 return false; 87 }); 88 89 $('.cancel-post-status').click(function() { 90 $('#post-status-select').slideUp("normal"); 91 $('#post_status').val($('#hidden_post_status').val()); 92 $('#post-status-display').html($('#post_status :selected').text()); 93 $('.edit-post-status').show(); 94 71 95 return false; 72 96 }); -
trunk/wp-admin/js/post.js
r8875 r8889 155 155 } ); 156 156 jQuery('.categorychecklist .popular-category :checkbox').change( syncChecks ).filter( ':checked' ).change(); 157 158 jQuery('.edit-timestamp').click(function () { 159 if (jQuery('#timestampdiv').is(":hidden")) { 160 jQuery('#curtime').slideUp("normal"); 161 jQuery('#timestampdiv').slideDown("normal"); 162 } else { 163 jQuery('#timestampdiv').slideUp("normal"); 164 jQuery('#mm').val(jQuery('#hidden_mm').val()); 165 jQuery('#jj').val(jQuery('#hidden_jj').val()); 166 jQuery('#aa').val(jQuery('#hidden_aa').val()); 167 jQuery('#hh').val(jQuery('#hidden_hh').val()); 168 jQuery('#mn').val(jQuery('#hidden_mn').val()); 169 jQuery('#curtime').slideDown("normal"); 170 } 171 return false; 172 }); 173 174 jQuery('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels 175 jQuery('#timestampdiv').hide(); 176 var link = jQuery('.timestamp a').clone( true ); 177 jQuery('.timestamp').show().html( 178 jQuery( '#mm option[value=' + jQuery('#mm').val() + ']' ).text() + ' ' + 179 jQuery('#jj').val() + ',' + 180 jQuery('#aa').val() + '@' + 181 jQuery('#hh').val() + ':' + 182 jQuery('#mn').val() + ' ' 183 ).append( link ); 184 jQuery('#curtime').slideDown("normal"); 157 var stamp = $('#timestamp').html(); 158 159 $('.edit-timestamp').click(function () { 160 if ($('#timestampdiv').is(":hidden")) { 161 $('#timestampdiv').slideDown("normal"); 162 $('.edit-timestamp').hide(); 163 } 164 165 return false; 166 }); 167 168 $('.cancel-timestamp').click(function() { 169 $('#timestampdiv').slideUp("normal"); 170 $('#mm').val($('#hidden_mm').val()); 171 $('#jj').val($('#hidden_jj').val()); 172 $('#aa').val($('#hidden_aa').val()); 173 $('#hh').val($('#hidden_hh').val()); 174 $('#mn').val($('#hidden_mn').val()); 175 $('#timestamp').html(stamp); 176 $('.edit-timestamp').show(); 177 178 return false; 179 }); 180 181 $('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels 182 $('#timestampdiv').slideUp("normal"); 183 $('.edit-timestamp').show(); 184 $('#timestamp').html( 185 $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' + 186 $('#jj').val() + ', ' + 187 $('#aa').val() + ' @ ' + 188 $('#hh').val() + ':' + 189 $('#mn').val() + ' ' 190 ); 191 185 192 return false; 186 193 }); … … 218 225 }); 219 226 220 jQuery('.edit-post-status').click(function () { 221 if (jQuery('#post-status-select').is(":hidden")) { 222 jQuery('#post-status-select').slideDown("normal"); 223 } else { 224 jQuery('#post-status-select').slideUp("normal"); 225 jQuery('#post-status-display').html(jQuery('#post_status :selected').text()); 226 } 227 $('.edit-post-status').click(function() { 228 if ($('#post-status-select').is(":hidden")) { 229 $('#post-status-select').slideDown("normal"); 230 $(this).hide(); 231 } 232 233 return false; 234 }); 235 236 $('.save-post-status').click(function() { 237 $('#post-status-select').slideUp("normal"); 238 $('#post-status-display').html($('#post_status :selected').text()); 239 $('.edit-post-status').show(); 240 227 241 return false; 228 242 }); 229 243 244 $('.cancel-post-status').click(function() { 245 $('#post-status-select').slideUp("normal"); 246 $('#post_status').val($('#hidden_post_status').val()); 247 $('#post-status-display').html($('#post_status :selected').text()); 248 $('.edit-post-status').show(); 249 250 return false; 251 }); 230 252 }); -
trunk/wp-admin/js/postbox.js
r8871 r8889 4 4 add_postbox_toggles : function(page) { 5 5 $('.postbox h3').before('<a class="togbox">+</a> '); 6 $('.postbox h3, .postbox a.togbox').click( function() { $($(this).parent().get(0)).toggleClass('closed'); save_postboxes_state(page); } ); 6 $('.postbox h3, .postbox a.togbox').click( function() { 7 $($(this).parent().get(0)).toggleClass('closed'); 8 postboxes.save_state(page); 9 }); 7 10 8 11 $('.hide-postbox-tog').click( function() { … … 14 17 jQuery('#' + box).hide(); 15 18 } 16 save_postboxes_state(page);19 postboxes.save_state(page); 17 20 } ); 18 21 … … 26 29 this.init(page); 27 30 }, 28 31 29 32 expandSidebar : function( doIt ) { 30 33 if ( doIt || $.trim( $( '#side-info-column' ).text() ) ) { … … 43 46 handle: '.hndle', 44 47 distance: 2, 45 containment: '#wpbody-content',46 48 stop: function() { 47 49 if ( 'side-sortables' == this.id ) { // doing this with jQuery doesn't work for some reason: make-it-tall gets duplicated … … 70 72 } 71 73 } ); 74 }, 75 76 save_state : function(page) { 77 var closed = $('.postbox').filter('.closed').map(function() { return this.id; }).get().join(','); 78 var hidden = $('.postbox').filter(':hidden').map(function() { return this.id; }).get().join(','); 79 $.post(postboxL10n.requestFile, { 80 action: 'closed-postboxes', 81 closed: closed, 82 hidden: hidden, 83 closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(), 84 page: page 85 }); 72 86 } 73 } 87 }; 88 89 $(document).ready(function(){postboxes.expandSidebar();}); 90 74 91 }(jQuery)); 75 76 jQuery(document).ready(function(){postboxes.expandSidebar();});77 78 function save_postboxes_state(page) {79 var closed = jQuery('.postbox').filter('.closed').map(function() { return this.id; }).get().join(',');80 var hidden = jQuery('.postbox').filter(':hidden').map(function() { return this.id; }).get().join(',');81 jQuery.post(postboxL10n.requestFile, {82 action: 'closed-postboxes',83 closed: closed,84 hidden: hidden,85 closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(),86 page: page87 });88 } -
trunk/wp-admin/wp-admin.css
r8875 r8889 238 238 239 239 .preview { 240 border: 0 none;241 240 padding: 7px; 242 241 } 243 242 244 .submitbox .submit a.preview:hover {245 border: 0 none;246 }247 248 243 #publish { 249 display: block;250 244 margin: 8px auto auto; 251 245 min-width: 150px; … … 1071 1065 min-width: 195px; 1072 1066 } 1073 #normal-sortables .postbox .submitbox { 1074 clear: both; 1075 position: relative; 1076 } 1077 #normal-sortables .postbox p { 1078 display: inline; 1079 } 1080 #normal-sortables .postbox .curtime { 1081 display: block; 1082 } 1083 #normal-sortables .postbox p strong { 1084 display: inline; 1085 } 1086 #normal-sortables .postbox #private-checkbox, #normal-sortables .postbox #sticky-checkbox { 1087 padding-left: 30px; 1088 } 1067 1068 #normal-sortables .inside-submitbox .insidebox { 1069 float: left; 1070 margin: 5px 12px 5px 0; 1071 } 1072 1073 #normal-sortables .submit #publish { 1074 margin: 8px 0 0 12px; 1075 } 1076 1077 #normal-sortables .inside-submitbox { 1078 float: left; 1079 } 1080 1081 #trackback_url { 1082 width: 99%; 1083 } 1084 1089 1085 #normal-sortables .postbox .submit { 1090 position: absolute; 1091 top: -1em; 1092 right: 0; 1093 background: none; 1094 border: 0; 1095 padding: 0; 1086 background: transparent none; 1087 border: 0 none; 1088 float: right; 1089 padding: 0 12px; 1090 margin: 0; 1091 } 1092 1093 #side-sortables .submitbox .submit input, 1094 #side-sortables .submitbox .submit .preview, 1095 #side-sortables .submitbox .submit a.preview:hover { 1096 border: 0 none; 1097 } 1098 1099 #side-sortables .inside-submitbox .insidebox { 1100 margin: 11px 0; 1096 1101 } 1097 1102 … … 1138 1143 } 1139 1144 1140 .submitbox {1141 /* margin: 1em 0; */1142 }1143 1144 .submitbox p {1145 /* padding: 0;1146 margin: 0; */1147 }1148 1149 .submitbox .submit {1150 text-align: left;1151 padding: 12px 10px 10px;1152 font-size: 11px;1153 }1154 1155 .submitbox .submitdelete {1156 border-bottom-width: 1px;1157 border-bottom-style: solid;1158 text-decoration: none;1159 margin-left: 8px;1160 padding-bottom: 1px;1161 }1162 1163 .submitbox .submit a:hover {1164 border-bottom-width: 1px;1165 border-bottom-style: solid;1166 }1167 1168 .submitbox .submit input {1169 margin-bottom: 8px;1170 margin-right: 3px;1171 padding: 6px 4px;1172 border: none;1173 }1174 1175 1176 1145 #tagchecklist { 1177 1146 margin-left: 10px; … … 1295 1264 margin: 0 12px 12px; 1296 1265 font-size: 11px; 1266 } 1267 1268 #pending { 1269 background: 0 none; 1270 border: 0 none; 1271 padding: 0; 1272 font-size: 11px; 1273 margin-top: -1px; 1297 1274 } 1298 1275 … … 1417 1394 #side-info-column #side-sortables { 1418 1395 height: 100%; 1419 padding-top: 39px; 1396 } 1397 1398 .submitbox .submit { 1399 text-align: left; 1400 padding: 12px 10px 10px; 1401 font-size: 11px; 1420 1402 } 1421 1403 … … 1424 1406 border-bottom-style: solid; 1425 1407 text-decoration: none; 1426 margin-left: 8px; 1427 padding-bottom: 1px; 1408 padding: 1px 2px; 1409 } 1410 1411 .submitbox .inside-submitbox #deletebutton { 1412 padding: 0 0 2px 20px; 1413 background-image: url(images/no.png); 1414 background-position: left center; 1415 background-repeat: no-repeat; 1428 1416 } 1429 1417 … … 1435 1423 .submitbox .submit input { 1436 1424 margin-bottom: 8px; 1437 margin-right: 3px;1425 margin-right: 4px; 1438 1426 padding: 6px; 1427 } 1428 1429 #post-status-select { 1430 line-height: 2.5em; 1439 1431 } 1440 1432 … … 1843 1835 #jj, #hh, #mn { 1844 1836 width: 1.5em; 1837 padding: 1px; 1845 1838 } 1846 1839 1847 1840 #aa { 1848 1841 width: 2.7em; 1842 padding: 1px; 1843 } 1844 1845 #timestampdiv { 1846 padding-top: 3px; 1849 1847 } 1850 1848
Note: See TracChangeset
for help on using the changeset viewer.