redirect after removal
authorJoey Hess <joey@kodama.kitenet.net>
Mon, 21 Jul 2008 17:53:34 +0000 (13:53 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Mon, 21 Jul 2008 17:53:34 +0000 (13:53 -0400)
IkiWiki/Plugin/remove.pm

index 57c43cfdf4db1b033d19541b77d1893889e227fd..5bc59225c7016da38a26351883ab5908b7b26b85 100644 (file)
@@ -123,6 +123,14 @@ sub sessioncgi ($$) { #{{{
                        IkiWiki::prune("$config{srcdir}/$file");
                        IkiWiki::refresh();
                        IkiWiki::saveindex();
+
+                       # Redirect to parent of the page.
+                       my $parent=IkiWiki::dirname($page);
+                       if (! exists $pagesources{$parent}) {
+                               $parent="index";
+                       }
+                       IkiWiki::redirect($q, $config{url}."/".htmlpage($parent));
+                       exit 0;
                }
                else {
                        IkiWiki::showform($form, $buttons, $session, $q);