mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-19 21:15:23 +00:00
Move timestamp to submitbox. Put it in a slidedown. see #5846
git-svn-id: http://svn.automattic.com/wordpress/trunk@6904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
23a4e81028
commit
7d06b85a36
@ -127,22 +127,29 @@ addLoadEvent(focusit);
|
|||||||
|
|
||||||
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Keep this post private') ?></label></p>
|
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Keep this post private') ?></label></p>
|
||||||
<?php
|
<?php
|
||||||
if ($post_ID):
|
if ($post_ID) {
|
||||||
|
|
||||||
if ( 'future' == $post->post_status ) {
|
if ( 'future' == $post->post_status ) {
|
||||||
$time = __('Scheduled for:<br />%1$s at %2$s');
|
$stamp = __('Scheduled for:<br />%1$s at %2$s');
|
||||||
$date = $post->post_date;
|
|
||||||
} else if ( 'publish' == $post->post_status ) {
|
} else if ( 'publish' == $post->post_status ) {
|
||||||
$time = __('Published on:<br />%1$s at %2$s');
|
$stamp = __('Published on:<br />%1$s at %2$s');
|
||||||
$date = $post->post_date;
|
|
||||||
} else {
|
} else {
|
||||||
$time = __('Saved on:<br />%1$s at %2$s');
|
$stamp = __('Saved on:<br />%1$s at %2$s');
|
||||||
$date = $post->post_modified;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$date = mysql2date(get_option('date_format'), $post->post_date);
|
||||||
|
$time = mysql2date(get_option('time_format'), $post->post_date);
|
||||||
|
} else {
|
||||||
|
$stamp = __('Timestamp:<br />%1$s at %2$s');
|
||||||
|
$date = mysql2date(get_option('date_format'), current_time('mysql'));
|
||||||
|
$time = mysql2date(get_option('time_format'), current_time('mysql'));
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<p><?php printf($time, mysql2date(get_option('date_format'), $date), mysql2date(get_option('time_format'), $date)); ?>
|
<p><?php printf($stamp, $date, $time); ?>
|
||||||
<?php endif; ?>
|
<a href="#edit_timestamp" class="edit-timestamp"><?php _e('Edit') ?></a></p>
|
||||||
|
|
||||||
|
<div id='timestamp'><?php touch_time(($action == 'edit')); ?></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
@ -316,13 +323,6 @@ list_meta($metadata);
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ( current_user_can('edit_posts') ) : ?>
|
|
||||||
<div id="posttimestampdiv" class="postbox <?php echo postbox_classes('posttimestampdiv', 'post'); ?>">
|
|
||||||
<h3><?php _e('Post Timestamp'); ?></h3>
|
|
||||||
<div class="inside"><?php touch_time(($action == 'edit')); ?></div>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
|
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
|
||||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||||
|
@ -91,22 +91,30 @@ addLoadEvent(focusit);
|
|||||||
|
|
||||||
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Keep this post private') ?></label></p>
|
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Keep this post private') ?></label></p>
|
||||||
<?php
|
<?php
|
||||||
if ($post_ID):
|
|
||||||
|
if ($post_ID) {
|
||||||
|
|
||||||
if ( 'future' == $post->post_status ) {
|
if ( 'future' == $post->post_status ) {
|
||||||
$time = __('Scheduled for:<br />%1$s at %2$s');
|
$stamp = __('Scheduled for:<br />%1$s at %2$s');
|
||||||
$date = $post->post_date;
|
|
||||||
} else if ( 'publish' == $post->post_status ) {
|
} else if ( 'publish' == $post->post_status ) {
|
||||||
$time = __('Published on:<br />%1$s at %2$s');
|
$stamp = __('Published on:<br />%1$s at %2$s');
|
||||||
$date = $post->post_date;
|
|
||||||
} else {
|
} else {
|
||||||
$time = __('Saved on:<br />%1$s at %2$s');
|
$stamp = __('Saved on:<br />%1$s at %2$s');
|
||||||
$date = $post->post_modified;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$date = mysql2date(get_option('date_format'), $post->post_date);
|
||||||
|
$time = mysql2date(get_option('time_format'), $post->post_date);
|
||||||
|
} else {
|
||||||
|
$stamp = __('Timestamp:<br />%1$s at %2$s');
|
||||||
|
$date = mysql2date(get_option('date_format'), current_time('mysql'));
|
||||||
|
$time = mysql2date(get_option('time_format'), current_time('mysql'));
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<p><?php printf($time, mysql2date(get_option('date_format'), $date), mysql2date(get_option('time_format'), $date)); ?>
|
<p><?php printf($stamp, $date, $time); ?>
|
||||||
<?php endif; ?>
|
<a href="#edit_timestamp" class="edit-timestamp"><?php _e('Edit') ?></a></p>
|
||||||
|
|
||||||
|
<div id='timestamp'><?php touch_time(($action == 'edit')); ?></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
|
@ -754,7 +754,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0 ) {
|
|||||||
if ( (int) $tab_index > 0 )
|
if ( (int) $tab_index > 0 )
|
||||||
$tab_index_attribute = " tabindex=\"$tab_index\"";
|
$tab_index_attribute = " tabindex=\"$tab_index\"";
|
||||||
|
|
||||||
echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label></legend>';
|
echo '<legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label></legend>';
|
||||||
|
|
||||||
$time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
|
$time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
|
||||||
$post_date = ($for_post) ? $post->post_date : $comment->comment_date;
|
$post_date = ($for_post) ? $post->post_date : $comment->comment_date;
|
||||||
@ -780,13 +780,6 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0 ) {
|
|||||||
<input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="edit_date.checked=true"<?php echo $tab_index_attribute ?> />
|
<input type="text" id="mn" name="mn" value="<?php echo $mn ?>" size="2" maxlength="2" onchange="edit_date.checked=true"<?php echo $tab_index_attribute ?> />
|
||||||
<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
|
<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
|
||||||
<?php
|
<?php
|
||||||
if ( $edit ) {
|
|
||||||
printf( _c( 'Existing timestamp: %1$s %2$s, %3$s @ %4$s:%5$s|1: month, 2: month string, 3: full year, 4: hours, 5: minutes' ), $wp_locale->get_month( $mm ), $jj, $aa, $hh, $mn );
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</fieldset>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function page_template_dropdown( $default = '' ) {
|
function page_template_dropdown( $default = '' ) {
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
addLoadEvent( function() {
|
addLoadEvent( function() {
|
||||||
add_postbox_toggles('page');
|
add_postbox_toggles('page');
|
||||||
make_slugedit_clickable();
|
make_slugedit_clickable();
|
||||||
|
|
||||||
|
jQuery('#timestamp').css('display', 'none');
|
||||||
|
jQuery('.edit-timestamp').click(function () {
|
||||||
|
if (jQuery('#timestamp').is(":hidden")) {
|
||||||
|
jQuery('#timestamp').slideDown("normal");
|
||||||
|
} else {
|
||||||
|
jQuery('#timestamp').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -140,4 +140,13 @@ addLoadEvent( function() {
|
|||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
|
jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
|
||||||
|
|
||||||
|
jQuery('#timestamp').css('display', 'none');
|
||||||
|
jQuery('.edit-timestamp').click(function () {
|
||||||
|
if (jQuery('#timestamp').is(":hidden")) {
|
||||||
|
jQuery('#timestamp').slideDown("normal");
|
||||||
|
} else {
|
||||||
|
jQuery('#timestamp').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user