]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
More RESTish URL (/notice/:notice/delete) for notice delete
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 11 Jul 2015 09:26:48 +0000 (11:26 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 11 Jul 2015 09:26:48 +0000 (11:26 +0200)
Also returns to 'top' now after notice deletion.

actions/deletenotice.php
lib/router.php

index d8037ab4443fbcfaf1b45f3ace961726ac6bb5ec..40b276a34895e664c2801fc4b741a876ae378360 100644 (file)
@@ -68,16 +68,10 @@ class DeletenoticeAction extends FormAction
                 $this->notice->delete();
                 Event::handle('EndDeleteOwnNotice', array($this->scoped->getUser(), $this->notice));
             }
-        }
-
-        $url = common_get_returnto();
-
-        if ($url) {
-            common_set_returnto(null);
         } else {
-            $url = common_local_url('public');
+            common_redirect(common_get_returnto(), 303);
         }
 
-        common_redirect($url, 303);
+        common_redirect(common_local_url('top'), 303);
     }
 }
index 249e5e882397128e96ff76544fb2b70aaf41c34f..b13c51c32834c92fb24facdbfeccc59454699871 100644 (file)
@@ -244,12 +244,10 @@ class Router
                         array('action' => 'shownotice'),
                         array('notice' => '[0-9]+'));
 
-            $m->connect('notice/delete/:notice',
+            $m->connect('notice/:notice/delete',
                         array('action' => 'deletenotice'),
                         array('notice' => '[0-9]+'));
 
-            $m->connect('notice/delete', array('action' => 'deletenotice'));
-
             // conversation
 
             $m->connect('conversation/:id',