]> sipb.mit.edu Git - ikiwiki.git/commitdiff
allow misctemplate callers to pass params to suppress actions etc
authorJoey Hess <joey@kitenet.net>
Sat, 15 May 2010 01:45:22 +0000 (21:45 -0400)
committerJoey Hess <joey@kitenet.net>
Sat, 15 May 2010 01:45:54 +0000 (21:45 -0400)
Suppress disiplay of small search for on search results page, and of
Prefrences link on prefs page.

IkiWiki.pm
IkiWiki/CGI.pm
IkiWiki/Plugin/search.pm
templates/page.tmpl

index a42f56bf0c6d2320c7403af19618e3b65f5f966a..699ad13dac4183e5d3135e62d6956e6f40c8a731 100644 (file)
@@ -1745,6 +1745,7 @@ sub misctemplate ($$;@) {
        run_hooks(pagetemplate => sub {
                shift->(page => "", destpage => "", template => $template);
        });
+       templateactions($template, "");
 
        $template->param(
                dynamic => 1,
@@ -1755,8 +1756,6 @@ sub misctemplate ($$;@) {
                html5 => $config{html5},
                @_,
        );
-
-       templateactions($template, "");
        
        return $template->output;
 }
index b98e9e0a1b5f45ad2cd6cc6f785a39c616a1e676..28020b500c830bafc52cf49c3ba75bc5dfca1ce4 100644 (file)
@@ -247,7 +247,9 @@ sub cgi_prefs ($$) {
                $form->text(gettext("Preferences saved."));
        }
        
-       showform($form, $buttons, $session, $q);
+       showform($form, $buttons, $session, $q,
+               prefsurl => "", # avoid showing the preferences link
+       );
 }
 
 sub cgi_custom_failure ($$$) {
index a9089620b7511948dcc5fd35e4a04c4f7245a31b..ff5d0ccbe616379b0a7efdadbd1858e4a8cf098e 100644 (file)
@@ -229,7 +229,8 @@ sub setupfiles () {
                # Avoid omega interpreting anything in the misctemplate
                # as an omegascript command.
                my $misctemplate=IkiWiki::misctemplate(gettext("search"), "\0",
-                       searching => 1);
+                       searchform => "", # avoid showing the small search form
+               );
                eval q{use HTML::Entities};
                error $@ if $@;
                $misctemplate=encode_entities($misctemplate, '\$');
index a7d200466fd2a2280aabeca3065bcf8a7094429e..f7944e40ee1ae327afdd73605f2680a27ce9e1b9 100644 (file)
 </TMPL_IF>
 </span>
 </span>
-<TMPL_UNLESS SEARCHING>
 <TMPL_IF SEARCHFORM>
 <TMPL_VAR SEARCHFORM>
 </TMPL_IF>
-</TMPL_UNLESS>
 <TMPL_IF HTML5></header><TMPL_ELSE></div></TMPL_IF>
 
 <TMPL_IF HAVE_ACTIONS>