]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/CGI.pm
missed a couple htmllinks
[ikiwiki.git] / IkiWiki / CGI.pm
index 92d042dc92612bc01f4d5d23d1afcd2692d18e6f..6ead8fc56b141aba89de3c0e43bc739eb9d56c4b 100644 (file)
@@ -2,6 +2,7 @@
 
 use warnings;
 use strict;
+use IkiWiki;
 use IkiWiki::UserInfo;
 
 package IkiWiki;
@@ -12,14 +13,14 @@ sub page_locked ($$;$) { #{{{
        my $nonfatal=shift;
        
        my $user=$session->param("name");
-       return if length $user && is_admin($user);
+       return if defined $user && is_admin($user);
 
        foreach my $admin (@{$config{adminuser}}) {
                my $locked_pages=userinfo_get($admin, "locked_pages");
                if (globlist_match($page, userinfo_get($admin, "locked_pages"))) {
                        return 1 if $nonfatal;
-                       error(htmllink("", $page, 1)." is locked by ".
-                             htmllink("", $admin, 1)." and cannot be edited.");
+                       error(htmllink("", "", $page, 1)." is locked by ".
+                             htmllink("", "", $admin, 1)." and cannot be edited.");
                }
        }
 
@@ -245,9 +246,9 @@ sub cgi_prefs ($$) { #{{{
        $form->field(name => "password", type => "password");
        $form->field(name => "confirm_password", type => "password");
        $form->field(name => "subscriptions", size => 50,
-               comment => "(".htmllink("", "GlobList", 1).")");
+               comment => "(".htmllink("", "", "GlobList", 1).")");
        $form->field(name => "locked_pages", size => 50,
-               comment => "(".htmllink("", "GlobList", 1).")");
+               comment => "(".htmllink("", "", "GlobList", 1).")");
        
        if (! is_admin($user_name)) {
                $form->field(name => "locked_pages", type => "hidden");
@@ -334,7 +335,7 @@ sub cgi_editpage ($$) { #{{{
        $form->tmpl_param("can_commit", $config{rcs});
        $form->tmpl_param("indexlink", indexlink());
        $form->tmpl_param("helponformattinglink",
-               htmllink("", "HelpOnFormatting", 1));
+               htmllink("", "", "HelpOnFormatting", 1));
        $form->tmpl_param("styleurl", styleurl());
        $form->tmpl_param("baseurl", "$config{url}/");
        if (! $form->submitted) {
@@ -350,7 +351,7 @@ sub cgi_editpage ($$) { #{{{
                require IkiWiki::Render;
                $form->tmpl_param("page_preview",
                        htmlize($config{default_pageext},
-                               linkify($form->field('content'), $page)));
+                               linkify($page, $page, $form->field('content'))));
        }
        else {
                $form->tmpl_param("page_preview", "");
@@ -483,26 +484,21 @@ sub cgi_editpage ($$) { #{{{
        }
 } #}}}
 
-sub cgi_hyperestraier () { #{{{
-       # only works for GET requests
-       chdir("$config{wikistatedir}/hyperestraier") || error("chdir: $!");
-       exec("./".basename($config{cgiurl})) || error("estseek.cgi failed");
-} #}}}
-
 sub cgi () { #{{{
        eval q{use CGI};
        eval q{use CGI::Session};
        
        my $q=CGI->new;
        
+       if (exists $hooks{cgi}) {
+               foreach my $id (keys %{$hooks{cgi}}) {
+                       $hooks{cgi}{$id}{call}->($q);
+               }
+       }
+       
        my $do=$q->param('do');
        if (! defined $do || ! length $do) {
-               if (defined $q->param('phrase')) {
-                       cgi_hyperestraier();
-               }
-               else {
-                       error("\"do\" parameter missing");
-               }
+               error("\"do\" parameter missing");
        }
        
        # Things that do not need a session.