X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=edithelp.pl;h=28586b39101324c89601693e361f1efe65b089d8;hb=ca11d0ba2998996bbef39a9a9e2483bba21572d6;hp=32db0622915cd56b101fa9ef0e2aee663c0cf46a;hpb=ed328807c37c452bc700295e823170721905053c;p=koha.git diff --git a/edithelp.pl b/edithelp.pl index 32db062291..28586b3910 100755 --- a/edithelp.pl +++ b/edithelp.pl @@ -67,7 +67,7 @@ sub _get_filepath ($;$) { $referer =~ /koha\/(.*)\.pl/; my $from = "help/$1.tt"; my $htdocs = C4::Context->config('intrahtdocs'); - my ($theme, $lang) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $input ); + my ($theme, $lang, $availablethemes) = C4::Templates::themelanguage( $htdocs, $from, "intranet", $input ); $debug and print STDERR "help filepath: $htdocs/$theme/$lang/modules/$from"; return "$htdocs/$theme/$lang/modules/$from"; } @@ -97,14 +97,12 @@ elsif ( $type eq 'modify' ) { } else { (-w $file) or $error = "WARNING: You will not be able save, because your webserver cannot write to '$file'. Contact your admin about help file permissions."; - open (INFILE, $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked + open (my $fh, '<', $file) or die "Cannot read file '$file'"; # unlikely death, since we just checked my $help = ''; - while ( my $inp = ) { - unless ( $inp =~ /INCLUDE/ ) { - $help .= $inp; - } + while ( <$fh> ) { + $help .= /\[% INCLUDE .* %\](.*)$/ ? $1 : $_; } - close INFILE; + close $fh; $template->param( 'help' => $help ); $type = 'save'; }