X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/479c7a1ea62d8fce3ef54f9deae89230d0b52a5d..4c0ffd59fd8c193c6b207d902750de4a63ded897:/IkiWiki/Plugin/conditional.pm?ds=inline diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm index 35418a3ba..22057c135 100644 --- a/IkiWiki/Plugin/conditional.pm +++ b/IkiWiki/Plugin/conditional.pm @@ -17,7 +17,7 @@ sub preprocess_if (@) { #{{{ my %params=@_; if (! exists $params{test} || ! exists $params{then}) { - return "[[if requires \"test\" and \"then\" parameters]]"; + return "[[if ".gettext('"test" and "then" parameters are required')."]]"; } my $result=0; @@ -28,7 +28,7 @@ sub preprocess_if (@) { #{{{ # tests. if ($params{test} =~ /^(enabled|sourcepage|destpage)\((.*)\)$/) { $result=eval "IkiWiki::PageSpec::match_$1(undef, ". - IkiWiki::safequote($2).")"; + IkiWiki::safequote($2).", \$params{page})"; } else { add_depends($params{page}, $params{test}); @@ -53,12 +53,13 @@ sub preprocess_if (@) { #{{{ else { $ret=""; } - return IkiWiki::preprocess($params{page}, $params{destpage}, $ret); + return IkiWiki::preprocess($params{page}, $params{destpage}, + IkiWiki::filter($params{page}, $ret)); } # }}} package IkiWiki::PageSpec; -sub match_enabled ($$) { #{{{ +sub match_enabled ($$$) { #{{{ shift; my $plugin=shift; @@ -66,7 +67,7 @@ sub match_enabled ($$) { #{{{ return UNIVERSAL::can("IkiWiki::Plugin::".$plugin, "import"); } #}}} -sub match_sourcepage ($$) { #{{{ +sub match_sourcepage ($$$) { #{{{ shift; my $glob=shift; @@ -74,7 +75,7 @@ sub match_sourcepage ($$) { #{{{ $IkiWiki::Plugin::conditional::sourcepage); } #}}} -sub match_destpage ($$) { #{{{ +sub match_destpage ($$$) { #{{{ shift; my $glob=shift; @@ -82,7 +83,7 @@ sub match_destpage ($$) { #{{{ $IkiWiki::Plugin::conditional::sourcepage); } #}}} -sub match_included ($$) { #{{{ +sub match_included ($$$) { #{{{ return $IkiWiki::Plugin::conditional::sourcepage ne $IkiWiki::Plugin::conditional::destpage; } #}}}