sub import {
hook(type => "getsetup", id => "getsource", call => \&getsetup);
hook(type => "pagetemplate", id => "getsource", call => \&pagetemplate);
- hook(type => "sessioncgi", id => "getsource", call => \&cgi_getsource);
+ hook(type => "cgi", id => "getsource", call => \&cgi_getsource);
}
sub getsetup () {
}
}
-sub cgi_getsource ($$) {
+sub cgi_getsource ($) {
my $cgi=shift;
- my $session=shift;
# Note: we use sessioncgi rather than just cgi
# because we need $IkiWiki::pagesources{} to be
my $page=$cgi->param('page');
+ IkiWiki::loadindex();
+
if ($IkiWiki::pagesources{$page}) {
my $data = IkiWiki::readfile(IkiWiki::srcfile($IkiWiki::pagesources{$page}));