]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
move error display to save_new_notice
authorEvan Prodromou <evan@prodromou.name>
Wed, 21 May 2008 12:31:06 +0000 (08:31 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 21 May 2008 12:31:06 +0000 (08:31 -0400)
darcs-hash:20080521123106-84dde-2ad51d79df069cdba4102a4545640260bf5aa8b1.gz

actions/newnotice.php

index f17ada3072e49785b56abf32aeceb35825a8f59e..535b1a512dde8fd72d3274cb31b64693c211d303 100644 (file)
@@ -28,14 +28,7 @@ class NewnoticeAction extends Action {
                if (!common_logged_in()) {
                        common_user_error(_t('Not logged in.'));
                } else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
-                       $id = $this->save_new_notice();
-                       if ($id) {
-                               common_broadcast_notices($id);
-                               common_redirect(common_local_url('shownotice',
-                                                                                                array('notice' => $id)), 303);
-                       } else {
-                               common_server_error(_t('Problem saving notice.'));
-                       }
+                       $this->save_new_notice();
                } else {
                        $this->show_form();
                }
@@ -60,7 +53,15 @@ class NewnoticeAction extends Action {
                        return;
                }
 
-               return $notice->insert();
+               $id = $notice->insert();
+               
+               if ($id) {
+                       common_broadcast_notices($id);
+                       common_redirect(common_local_url('shownotice',
+                                                                                        array('notice' => $id)), 303);
+               } else {
+                       common_server_error(_t('Problem saving notice.'));
+               }
        }
 
        function show_form($msg=NULL) {