X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/8b00c9523de616592e71e0bf5fdbdeb95b90446c..a6b4d94e0c40c633c4473d058e65a9f005aa6b8c:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index 6e03121c0..d4e19c388 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -189,11 +189,6 @@ sub loadplugin ($) { #{{{ sub error ($;$) { #{{{ my $message=shift; my $cleaner=shift; - if ($config{cgi}) { - print "Content-type: text/html\n\n"; - print misctemplate(gettext("Error"), - "

".gettext("Error").": $message

"); - } log_message('err' => $message) if $config{syslog}; if (defined $cleaner) { $cleaner->(); @@ -337,7 +332,7 @@ sub readfile ($;$$) { #{{{ return $ret; } #}}} -sub prep_writefile ($$) { +sub prep_writefile ($$) { #{{{ my $file=shift; my $destdir=shift; @@ -361,7 +356,7 @@ sub prep_writefile ($$) { } return 1; -} +} #}}} sub writefile ($$$;$$) { #{{{ my $file=shift; # can include subdirs @@ -533,7 +528,7 @@ sub displaytime ($;$) { #{{{ return decode_utf8(POSIX::strftime($format, localtime($time))); } #}}} -sub beautify_url ($) { #{{{ +sub beautify_urlpath ($) { #{{{ my $url=shift; if ($config{usedirs}) { @@ -554,7 +549,7 @@ sub urlto ($$) { #{{{ my $from=shift; if (! length $to) { - return beautify_url(baseurl($from)."index.$config{htmlext}"); + return beautify_urlpath(baseurl($from)."index.$config{htmlext}"); } if (! $destsources{$to}) { @@ -563,7 +558,7 @@ sub urlto ($$) { #{{{ my $link = abs2rel($to, dirname(htmlpage($from))); - return beautify_url($link); + return beautify_urlpath($link); } #}}} sub htmllink ($$$;@) { #{{{ @@ -610,7 +605,7 @@ sub htmllink ($$$;@) { #{{{ } $bestlink=abs2rel($bestlink, dirname(htmlpage($page))); - $bestlink=beautify_url($bestlink); + $bestlink=beautify_urlpath($bestlink); if (! $opts{noimageinline} && isinlinableimage($bestlink)) { return "\"$linktext\""; @@ -1202,6 +1197,12 @@ sub gettext { #{{{ } } #}}} +sub yesno ($) { #{{{ + my $val=shift; + + return (defined $val && lc($val) eq gettext("yes")); +} #}}} + sub pagespec_merge ($$) { #{{{ my $a=shift; my $b=shift;