From 50c7e4c722a39582c185eafe452f0b321dd39e7e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 19 Jun 2008 12:18:14 -0400 Subject: posting from a form takes you back to the same page darcs-hash:20080619161814-5ed1f-5add55346470e71a53a676d39617062acc0f19bf.gz --- actions/newnotice.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'actions/newnotice.php') diff --git a/actions/newnotice.php b/actions/newnotice.php index b65edf4c3..a3ba4c9cc 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -69,15 +69,25 @@ class NewnoticeAction extends Action { } common_broadcast_notice($notice); - common_redirect(common_local_url('shownotice', - array('notice' => $id)), 303); + $returnto = $this->trimmed('returnto'); + if ($returnto) { + $url = common_local_url($returnto, + array('nickname' => $user->nickname)); + } else { + $url = common_local_url('shownotice', + array('notice' => $id)); + } + common_redirect($url, 303); } - function show_form($msg=NULL) { - common_show_header(_t('New notice')); + function show_top($msg=NULL) { if ($msg) { common_element('div', 'error', $msg); } + } + + function show_form($msg=NULL) { + common_show_header(_t('New notice'), NULL, $msg, array($this, 'show_top')); common_notice_form(); common_show_footer(); } -- cgit v1.2.3-54-g00ecf