diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-07-21 13:50:12 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-07-21 13:50:12 -0400 |
commit | c924c76bd89d6d607b59c1d68ba32fae0fefc77a (patch) | |
tree | 25c916fef0d55b917a661cb451214d7ccc28fa95 /IkiWiki | |
parent | c6d1ae33d224486f347d39005e516f514c613d3c (diff) | |
download | ikiwiki-c924c76bd89d6d607b59c1d68ba32fae0fefc77a.tar ikiwiki-c924c76bd89d6d607b59c1d68ba32fae0fefc77a.tar.gz |
basically, removal works
Still need to consider all the edge cases..
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/remove.pm | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/remove.pm b/IkiWiki/Plugin/remove.pm index 0dded4fa4..57c43cfdf 100644 --- a/IkiWiki/Plugin/remove.pm +++ b/IkiWiki/Plugin/remove.pm @@ -106,7 +106,23 @@ sub sessioncgi ($$) { #{{{ exit 0; } elsif ($form->submitted eq 'Remove' && $form->validate) { - error("removal not yet implemented"); # TODO + my $page=IkiWiki::titlepage($form->field("page")); + my $file=$pagesources{$page}; + + # Do removal, and update the wiki. + require IkiWiki::Render; + if ($config{rcs}) { + IkiWiki::rcs_remove($file); + IkiWiki::disable_commit_hook(); + IkiWiki::rcs_commit($file, gettext("removed"), + IkiWiki::rcs_prepedit($file), + $session->param("name"), $ENV{REMOTE_ADDR}); + IkiWiki::enable_commit_hook(); + IkiWiki::rcs_update(); + } + IkiWiki::prune("$config{srcdir}/$file"); + IkiWiki::refresh(); + IkiWiki::saveindex(); } else { IkiWiki::showform($form, $buttons, $session, $q); |