X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FOutput.pm;h=6baf5ebe1a1177e6eb5ff5b62f26dc35106054cd;hb=8ad2c7d7acc3cb0033426bd78928214a22ad9dd1;hp=fde73f1be0a3e8b7d442545f6a623c703052aaa3;hpb=a25eb07178da24b875391b9398a4d52a0ab43358;p=koha-ffzg.git diff --git a/C4/Output.pm b/C4/Output.pm index fde73f1be0..6baf5ebe1a 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -70,17 +70,10 @@ my $path = C4::Context->config('intrahtdocs') . "/prog/en/includes/"; #--------------------------------------------------------------------------------------------------------- # FIXME - POD -sub gettemplate { + +sub _get_template_file { my ( $tmplbase, $interface, $query ) = @_; - ($query) or warn "no query in gettemplate"; - my $htdocs; - if ( $interface ne "intranet" ) { - $htdocs = C4::Context->config('opachtdocs'); - } - else { - $htdocs = C4::Context->config('intrahtdocs'); - } - my $path = C4::Context->preference('intranet_includes') || 'includes'; + my $htdocs = C4::Context->config( $interface ne 'intranet' ? 'opachtdocs' : 'intrahtdocs' ); my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, $interface, $query ); my $opacstylesheet = C4::Context->preference('opacstylesheet'); @@ -90,6 +83,17 @@ sub gettemplate { $lang = 'en'; $filename = "$htdocs/$theme/$lang/modules/$tmplbase"; } + + return ( $htdocs, $theme, $lang, $filename ); +} + +sub gettemplate { + my ( $tmplbase, $interface, $query ) = @_; + ($query) or warn "no query in gettemplate"; + my $path = C4::Context->preference('intranet_includes') || 'includes'; + my $opacstylesheet = C4::Context->preference('opacstylesheet'); + my ( $htdocs, $theme, $lang, $filename ) = _get_template_file( $tmplbase, $interface, $query ); + my $template = HTML::Template::Pro->new( filename => $filename, die_on_bad_params => 1,