Add page saved notice.

git-svn-id: http://svn.automattic.com/wordpress/trunk@7047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-02-26 20:53:07 +00:00
parent 3b82fdffc7
commit 83908c9078
3 changed files with 22 additions and 4 deletions

View File

@ -36,6 +36,12 @@ if (isset($mode) && 'bookmarklet' == $mode)
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
<?php echo $form_extra ?>
<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
<input name="referredby" type="hidden" id="referredby" value="<?php
if ( url_to_postid(wp_get_referer()) == $post_ID )
echo 'redo';
else
echo clean_url(stripslashes(wp_get_referer()));
?>" />
<script type="text/javascript">
// <![CDATA[

View File

@ -97,6 +97,13 @@ unset($status_links);
?>
</ul>
<?php
if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?>
<div id="message" class="updated fade"><p><strong><?php _e('Your page has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View page'); ?></a> | <a href="page.php?action=edit&amp;post=<?php echo $_GET['posted']; ?>"><?php _e('Edit page'); ?></a></p></div>
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
endif;
?>
<p id="post-search">
<input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" />
<input type="submit" value="<?php _e( 'Search Pages' ); ?>" class="button" />

View File

@ -109,9 +109,12 @@ case 'editpost':
if ( isset($_POST['save']) )
$location = "page.php?action=edit&post=$page_ID";
} else {
if ($_POST['save']) {
$location = "page.php?action=edit&post=$page_ID";
} elseif ($_POST['addmeta']) {
$referredby = '';
if ( !empty($_POST['referredby']) )
$referredby = preg_replace('|https?://[^/]+|i', '', $_POST['referredby']);
$referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
if ($_POST['addmeta']) {
$location = add_query_arg( 'message', 2, wp_get_referer() );
$location = explode('#', $location);
$location = $location[0] . '#postcustom';
@ -119,10 +122,12 @@ case 'editpost':
$location = add_query_arg( 'message', 3, wp_get_referer() );
$location = explode('#', $location);
$location = $location[0] . '#postcustom';
} elseif (!empty($_POST['referredby']) && $_POST['referredby'] != wp_get_referer()) {
} elseif (!empty($referredby) && $referredby != $referer) {
$location = $_POST['referredby'];
if ( $_POST['referredby'] == 'redo' )
$location = get_permalink( $page_ID );
if ( false !== strpos($location, 'edit-pages.php') )
$location = add_query_arg('posted', $page_ID, $location);
} elseif ($action == 'editattachment') {
$location = 'attachments.php';
} else {