Changeset 9402
- Timestamp:
- 10/29/2008 07:22:56 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
wp-admin/edit-form-advanced.php (modified) (6 diffs)
-
wp-admin/includes/template.php (modified) (2 diffs)
-
wp-admin/js/post.js (modified) (4 diffs)
-
wp-admin/wp-admin.css (modified) (2 diffs)
-
wp-includes/script-loader.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r9398 r9402 96 96 } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified 97 97 $stamp = __('Publish immediately'); 98 } else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified 99 $stamp = __('Schedule for:<br />%1$s'); 98 100 } else { // draft, 1 or more saves, date specified 99 101 $stamp = __('Publish on:<br />%1$s'); … … 107 109 <?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?> 108 110 <div class="misc-pub-section curtime"> 109 <span id="timestamp"><?php printf($stamp, $date); ?></span> 111 <span id="timestamp"> 112 <?php printf($stamp, $date); ?></span> 110 113 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> 111 114 <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div> … … 133 136 ?> 134 137 </span></b> 135 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { ?>138 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?> 136 139 <a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> 137 140 138 141 <div id="post-status-select" class="hide-if-js"> 139 142 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" /> 140 <br />141 143 <select name='post_status' id='post_status' tabindex='4'> 142 144 <?php 143 // 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) 144 if ( $can_publish OR ( $post->post_status == 'publish' AND current_user_can('edit_post', $post->ID) ) ) : ?> 145 if ( $post->post_status == 'publish' ) : ?> 145 146 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option> 146 147 <?php if ( 'future' == $post->post_status ) : ?> … … 151 152 <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option> 152 153 </select> 153 154 <br /> 154 155 <a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a> 155 156 <a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a> … … 172 173 <div id="minor-publishing-actions"> 173 174 174 <?php if ( 'publish' != $post->post_status && 'private' != $post->post_status ) { ?>175 <?php if ( 'publish' != $post->post_status && 'private' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> 175 176 <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" /> 177 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?> 178 <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Pending') ); ?>" tabindex="4" class="button button-highlighted" /> 176 179 <?php } ?> 177 180 … … 198 201 if ( !in_array( $post->post_status, array('publish', 'future') ) || 0 == $post->ID ) { ?> 199 202 <?php if ( current_user_can('publish_posts') ) : ?> 200 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> 203 <?php if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> 204 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" /> 205 <?php else : ?> 206 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> 207 <?php endif; ?> 201 208 <?php else : ?> 202 209 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" /> -
trunk/wp-admin/includes/template.php
r9399 r9402 2237 2237 $ss = ($edit) ? mysql2date( 's', $post_date ) : gmdate( 's', $time_adj ); 2238 2238 2239 $cur_jj = gmdate( 'd', $time_adj ); 2240 $cur_mm = gmdate( 'm', $time_adj ); 2241 $cur_aa = gmdate( 'Y', $time_adj ); 2242 $cur_hh = gmdate( 'H', $time_adj ); 2243 $cur_mn = gmdate( 'i', $time_adj ); 2244 2239 2245 $month = "<select " . ( $multi ? '' : 'id="mm" ' ) . "name=\"mm\"$tab_index_attribute>\n"; 2240 2246 for ( $i = 1; $i < 13; $i = $i +1 ) { … … 2255 2261 2256 2262 echo "\n\n"; 2257 foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) 2263 foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) { 2258 2264 echo '<input type="hidden" id="hidden_' . $timeunit . '" name="hidden_' . $timeunit . '" value="' . $$timeunit . '" />' . "\n"; 2265 $cur_timeunit = 'cur_' . $timeunit; 2266 echo '<input type="hidden" id="'. $cur_timeunit . '" name="'. $cur_timeunit . '" value="' . $$cur_timeunit . '" />' . "\n"; 2267 } 2259 2268 ?> 2260 2269 -
trunk/wp-admin/js/post.js
r9241 r9402 176 176 $('.edit-timestamp').show(); 177 177 178 var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val() ); 179 var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() ); 180 if ( attemptedDate > currentDate ) { 181 $('#publish').val( postL10n.schedule ); 182 } else if ( $('#original_post_status').val() != 'publish' ) { 183 $('#publish').val( postL10n.publish ); 184 } else { 185 $('#publish').val( postL10n.update ); 186 } 187 178 188 return false; 179 189 }); … … 182 192 $('#timestampdiv').slideUp("normal"); 183 193 $('.edit-timestamp').show(); 194 var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val() ); 195 var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() ); 196 if ( attemptedDate > currentDate ) { 197 var publishOn = postL10n.publishOnFuture; 198 $('#publish').val( postL10n.schedule ); 199 } else if ( $('#original_post_status').val() != 'publish' ) { 200 var publishOn = postL10n.publishOn; 201 $('#publish').val( postL10n.publish ); 202 } else { 203 var publishOn = postL10n.publishOnPast; 204 $('#publish').val( postL10n.update ); 205 } 184 206 $('#timestamp').html( 207 publishOn + '<br />' + 185 208 $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' + 186 209 $('#jj').val() + ', ' + … … 217 240 $('#post-status-display').html($('#post_status :selected').text()); 218 241 $('.edit-post-status').show(); 219 242 if ( $('#post_status :selected').val() == 'pending' ) { 243 $('#save-post').val( postL10n.savePending ); 244 } else { 245 $('#save-post').val( postL10n.saveDraft ); 246 } 220 247 return false; 221 248 }); … … 226 253 $('#post-status-display').html($('#post_status :selected').text()); 227 254 $('.edit-post-status').show(); 255 if ( $('#post_status :selected').val() == 'pending' ) { 256 $('#save-post').val( postL10n.savePending ); 257 } else { 258 $('#save-post').val( postL10n.saveDraft ); 259 } 228 260 229 261 return false; -
trunk/wp-admin/wp-admin.css
r9394 r9402 211 211 float: left; 212 212 border-right: 1px solid #ddd; 213 min-height: 70px; 213 214 } 214 215 215 216 #side-sortables #misc-publishing-actions { 216 217 max-width: 170px; 218 } 219 220 #side-sortable #minor-publishing-actions { 221 max-width: 108px; 217 222 } 218 223 … … 227 232 228 233 #minor-publishing-actions { 229 padding: 6px 6px 00;234 padding: 4px 4px 4px 0; 230 235 float: right; 231 236 text-align: right; -
trunk/wp-includes/script-loader.php
r9396 r9402 184 184 'cancel' => __('Cancel'), 185 185 'edit' => __('Edit'), 186 'publishOn' => __('Publish on:'), 187 'publishOnFuture' => __('Schedule for:'), 188 'publishOnPast' => __('Published on:'), 186 189 'showcomm' => __('Show more comments'), 187 'endcomm' => __('No more comments found.') 190 'endcomm' => __('No more comments found.'), 191 'publish' => __('Publish'), 192 'schedule' => __('Schedule'), 193 'update' => __('Update Post'), 194 'savePending' => __('Save Pending'), 195 'saveDraft' => __('Save Draft') 188 196 ) ); 189 197 $scripts->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'postbox', 'settings-box'), '20080925' ); … … 309 317 $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'press-this-ie' ); 310 318 311 $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20081029 ' );319 $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20081029b' ); 312 320 $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' ); 313 321
Note: See TracChangeset
for help on using the changeset viewer.