Changeset 9641
- Timestamp:
- 11/12/2008 07:31:39 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
wp-admin/edit-form-advanced.php (modified) (1 diff)
-
wp-admin/edit-page-form.php (modified) (8 diffs)
-
wp-admin/js/page.js (modified) (5 diffs)
-
wp-includes/script-loader.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r9639 r9641 166 166 } elseif ( is_sticky( $post->ID ) ) { 167 167 $visibility = 'public'; 168 $visibility_trans = __('Public, sticky');168 $visibility_trans = __('Public, Sticky'); 169 169 $sticky = 'sticky'; 170 170 } else { -
trunk/wp-admin/edit-page-form.php
r9620 r9641 86 86 87 87 <div id="save-action"> 88 <?php if ( 'publish' != $post->post_status && ' private' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>89 <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />88 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> 89 <input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" /> 90 90 <?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?> 91 91 <input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save as Pending') ); ?>" tabindex="4" class="button button-highlighted" /> … … 107 107 <?php 108 108 switch ( $post->post_status ) { 109 case 'private': 110 _e('Privately Published'); 111 break; 109 112 case 'publish': 110 case 'private':111 113 _e('Published'); 112 114 break; … … 124 126 </span></b> 125 127 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?> 126 <a href="#post_status" class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>128 <a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a> 127 129 128 130 <div id="post-status-select" class="hide-if-js"> 129 131 <input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" /> 130 132 <select name='post_status' id='post_status' tabindex='4'> 131 <?php if ( $post->post_status == 'publish' ) : ?> 132 <option<?php selected( $post->post_status, 'publish' ); selected( $post->post_status, 'private' );?> value='publish'><?php _e('Published') ?></option> 133 <?php if ( 'publish' == $post->post_status ) : ?> 134 <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option> 135 <?php elseif ( 'private' == $post->post_status ) : ?> 136 <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option> 133 137 <?php elseif ( 'future' == $post->post_status ) : ?> 134 138 <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option> … … 145 149 </div><?php // /misc-pub-section ?> 146 150 151 <div class="misc-pub-section " id="visibility"> 152 <?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php 153 154 if ( !empty( $post->post_password ) ) { 155 $visibility = 'password'; 156 $visibility_trans = __('Password protected'); 157 } elseif ( 'private' == $post->post_status ) { 158 $visibility = 'private'; 159 $visibility_trans = __('Private'); 160 } else { 161 $visibility = 'public'; 162 $visibility_trans = __('Public'); 163 } 164 165 ?><?php echo wp_specialchars( $visibility_trans ); ?></span></b> <?php if ( $can_publish ) { ?> <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a> 166 167 <div id="post-visibility-select" class="hide-if-js"> 168 <input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attribute_escape($post->post_password); ?>" /> 169 <input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attribute_escape( $visibility ); ?>" /> 170 171 172 <input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br /> 173 <input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br /> 174 <span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo attribute_escape($post->post_password); ?>" /><br /></span> 175 <input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br /> 176 177 <p> 178 <a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a> 179 <a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a> 180 </p> 181 </div> 182 <?php } ?> 183 184 </div><?php // /misc-pub-section ?> 185 147 186 <?php 148 187 $datef = _c( 'M j, Y @ G:i|Publish box date format'); … … 150 189 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 151 190 $stamp = __('Scheduled for: <b>%1$s</b>'); 152 } else if ( 'publish' == $post->post_status ) { // already published191 } else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published 153 192 $stamp = __('Published on: <b>%1$s</b>'); 154 193 } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified … … 189 228 <div id="publishing-action"> 190 229 <?php 191 if ( !in_array( $post->post_status, array('publish', 'future' ) ) || 0 == $post->ID ) { ?>230 if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?> 192 231 <?php if ( current_user_can('publish_posts') ) : ?> 193 232 <?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> 233 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Schedule') ?>" /> 194 234 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" /> 195 235 <?php else : ?> 236 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Publish') ?>" /> 196 237 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" /> 197 238 <?php endif; ?> 198 239 <?php else : ?> 240 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Submit for Review') ?>" /> 199 241 <input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" /> 200 242 <?php endif; ?> 201 243 <?php } else { ?> 244 <input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Update Page') ?>" /> 202 245 <input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Page') ?>" /> 203 246 <?php } ?> … … 225 268 <?php 226 269 } 227 add_meta_box('pagepassworddiv', __('Privacy Options'), 'page_password_meta_box', 'page', 'side', 'core');270 // add_meta_box('pagepassworddiv', __('Privacy Options'), 'page_password_meta_box', 'page', 'side', 'core'); 228 271 229 272 /** … … 379 422 380 423 <div class="wrap"> 381 <h2><?php echo wp_specialchars( $title ); ?></h2> 424 <h2><?php echo wp_specialchars( $title ); ?></h2> 382 425 383 426 <form name="post" action="page.php" method="post" id="post"> -
trunk/wp-admin/js/page.js
r9564 r9641 12 12 13 13 var stamp = $('#timestamp').html(); 14 15 var visibility = $('#post-visibility-display').html(); 16 17 function updateVisibility() { 18 if ( $('#post-visibility-select input:radio:checked').val() != 'public' ) { 19 $('#sticky').attr('checked', false); 20 $('#sticky-span').hide(); 21 } else { 22 $('#sticky-span').show(); 23 } 24 if ( $('#post-visibility-select input:radio:checked').val() != 'password' ) { 25 $('#password-span').hide(); 26 } else { 27 $('#password-span').show(); 28 } 29 } 30 31 function updateText() { 32 var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val()); 33 var originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val()); 34 var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val()); 35 if ( attemptedDate > currentDate ) { 36 var publishOn = postL10n.publishOnFuture; 37 $('#publish').val( postL10n.schedule ); 38 } else if ( $('#original_post_status').val() != 'publish' ) { 39 var publishOn = postL10n.publishOn; 40 $('#publish').val( postL10n.publish ); 41 } else { 42 var publishOn = postL10n.publishOnPast; 43 $('#publish').val( postL10n.update ); 44 } 45 if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack 46 $('#timestamp').html(stamp); 47 } else { 48 $('#timestamp').html( 49 publishOn + ' <b>' + 50 $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' + 51 $('#jj').val() + ', ' + 52 $('#aa').val() + ' @ ' + 53 $('#hh').val() + ':' + 54 $('#mn').val() + '</b> ' 55 ); 56 } 57 58 if ( $('#post-visibility-select input:radio:checked').val() == 'private' ) { 59 $('#publish').val( postL10n.update ); 60 if ( $('#post_status option[value=publish]').length == 0 ) { 61 $('#post_status').append('<option value="publish">' + postL10n.privatelyPublished + '</option>'); 62 } 63 $('#post_status option[value=publish]').html( postL10n.privatelyPublished ); 64 $('#post_status option[value=publish]').attr('selected', true); 65 $('.edit-post-status').hide(); 66 } else { 67 if ( $('#original_post_status').val() == 'future' || $('#original_post_status').val() == 'draft' ) { 68 if ( $('#post_status option[value=publish]').length != 0 ) { 69 $('#post_status option[value=publish]').remove(); 70 $('#post_status').val($('#hidden_post_status').val()); 71 } 72 } else { 73 $('#post_status option[value=publish]').html( postL10n.published ); 74 } 75 $('.edit-post-status').show(); 76 } 77 $('#post-status-display').html($('#post_status :selected').text()); 78 if ( $('#post_status :selected').val() == 'private' || $('#post_status :selected').val() == 'publish' ) { 79 $('#save-post').hide(); 80 } else { 81 $('#save-post').show(); 82 if ( $('#post_status :selected').val() == 'pending' ) { 83 $('#save-post').show().val( postL10n.savePending ); 84 } else { 85 $('#save-post').show().val( postL10n.saveDraft ); 86 } 87 } 88 } 89 90 $('.edit-visibility').click(function () { 91 if ($('#post-visibility-select').is(":hidden")) { 92 updateVisibility(); 93 $('#post-visibility-select').slideDown("normal"); 94 $('.edit-visibility').hide(); 95 } 96 return false; 97 }); 98 99 $('.cancel-post-visibility').click(function () { 100 $('#post-visibility-select').slideUp("normal"); 101 $('#visibility-radio-' + $('#hidden-post-visibility').val()).attr('checked', true); 102 $('#post_password').val($('#hidden_post_password').val()); 103 $('#post-visibility-display').html(visibility); 104 $('.edit-visibility').show(); 105 updateText(); 106 return false; 107 }); 108 109 $('.save-post-visibility').click(function () { // crazyhorse - multiple ok cancels 110 $('#post-visibility-select').slideUp("normal"); 111 $('.edit-visibility').show(); 112 updateText(); 113 114 $('#post-visibility-display').html( 115 postL10n[$('#post-visibility-select input:radio:checked').val()] 116 ); 117 118 return false; 119 }); 120 121 $('#post-visibility-select input:radio').change(function() { 122 updateVisibility(); 123 }); 14 124 15 125 $('.edit-timestamp').click(function () { … … 29 139 $('#hh').val($('#hidden_hh').val()); 30 140 $('#mn').val($('#hidden_mn').val()); 31 $('#timestamp').html(stamp);32 141 $('.edit-timestamp').show(); 33 142 34 var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val() ); 35 var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() ); 36 if ( attemptedDate > currentDate ) { 37 $('#publish').val( postL10n.schedule ); 38 } else if ( $('#original_post_status').val() != 'publish' ) { 39 $('#publish').val( postL10n.publish ); 40 } else { 41 $('#publish').val( postL10n.update ); 42 } 43 143 updateText(); 44 144 return false; 45 145 }); … … 48 148 $('#timestampdiv').slideUp("normal"); 49 149 $('.edit-timestamp').show(); 50 var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val() ); 51 var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val() ); 52 if ( attemptedDate > currentDate ) { 53 var publishOn = postL10n.publishOnFuture; 54 $('#publish').val( postL10n.schedule ); 55 } else if ( $('#original_post_status').val() != 'publish' ) { 56 var publishOn = postL10n.publishOn; 57 $('#publish').val( postL10n.publish ); 58 } else { 59 var publishOn = postL10n.publishOnPast; 60 $('#publish').val( postL10n.update ); 61 } 62 $('#timestamp').html( 63 publishOn + ' <b>' + 64 $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' + 65 $('#jj').val() + ', ' + 66 $('#aa').val() + ' @ ' + 67 $('#hh').val() + ':' + 68 $('#mn').val() + '</b> ' 69 ); 150 updateText(); 70 151 71 152 return false; … … 83 164 $('.save-post-status').click(function() { 84 165 $('#post-status-select').slideUp("normal"); 85 $('#post-status-display').html($('#post_status :selected').text());86 166 $('.edit-post-status').show(); 87 if ( $('#post_status :selected').val() == 'pending' ) { 88 $('#save-post').val( postL10n.savePending ); 89 } else { 90 $('#save-post').val( postL10n.saveDraft ); 91 } 167 updateText(); 92 168 return false; 93 169 }); … … 96 172 $('#post-status-select').slideUp("normal"); 97 173 $('#post_status').val($('#hidden_post_status').val()); 98 $('#post-status-display').html($('#post_status :selected').text());99 174 $('.edit-post-status').show(); 100 if ( $('#post_status :selected').val() == 'pending' ) { 101 $('#save-post').val( postL10n.savePending ); 102 } else { 103 $('#save-post').val( postL10n.saveDraft ); 104 } 105 175 176 updateText(); 106 177 return false; 107 178 }); -
trunk/wp-includes/script-loader.php
r9640 r9641 195 195 'private' => __('Private'), 196 196 'public' => __('Public'), 197 'publicSticky' => __('Public, sticky'),198 'password' => __('Password protected'),197 'publicSticky' => __('Public, Sticky'), 198 'password' => __('Password Protected'), 199 199 'privatelyPublished' => __('Privately Published'), 200 200 'published' => __('Published') 201 202 ) ); 203 $scripts->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'wp-lists', 'postbox'), '20081107' ); 201 ) ); 202 $scripts->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'wp-lists', 'postbox'), '20081112' ); 204 203 $scripts->localize( 'page', 'postL10n', array( 205 204 'cancel' => __('Cancel'), … … 214 213 'update' => __('Update Page'), 215 214 'savePending' => __('Save as Pending'), 216 'saveDraft' => __('Save Draft') 215 'saveDraft' => __('Save Draft'), 216 'private' => __('Private'), 217 'public' => __('Public'), 218 'password' => __('Password Protected'), 219 'privatelyPublished' => __('Privately Published'), 220 'published' => __('Published') 217 221 ) ); 218 222 $scripts->add( 'link', '/wp-admin/js/link.js', array('jquery-ui-tabs', 'wp-lists', 'postbox'), '20080925' );
Note: See TracChangeset
for help on using the changeset viewer.