summaryrefslogtreecommitdiff
path: root/actions/newnotice.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-06-19 12:18:14 -0400
committerEvan Prodromou <evan@controlyourself.ca>2008-06-19 12:18:14 -0400
commit50c7e4c722a39582c185eafe452f0b321dd39e7e (patch)
tree3a228cbd8e75d046336758a87089d8a43878bf3a /actions/newnotice.php
parent912947c690f26f4b1a20b35fbc74288b031cd0c9 (diff)
posting from a form takes you back to the same page0.3.3
darcs-hash:20080619161814-5ed1f-5add55346470e71a53a676d39617062acc0f19bf.gz
Diffstat (limited to 'actions/newnotice.php')
-rw-r--r--actions/newnotice.php18
1 files changed, 14 insertions, 4 deletions
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();
}