corrected init script name for apache2
[koha.git] / help.pl
blob3d59165cd202509b913fad8746f789f1ebc311c5
1 #!/usr/bin/perl
2 use HTML::Template;
3 use strict;
4 require Exporter;
5 use C4::Output; # contains gettemplate
7 # use C4::Auth;
8 use C4::Context;
9 use CGI;
11 my $query = new CGI;
13 # find the script that called the online help using the CGI referer()
14 my $refer = $query->referer();
16 # workaround for popup not functioning correctly in IE
17 my $referurl = $query->param('url');
18 if ($referurl) {
19 $refer = $query->param('url');
22 $refer =~ /.*koha\/(.*)\.pl.*/;
23 my $from = "modules/help/$1.tmpl";
25 my $template = gethelptemplate( $from, "intranet" );
27 # my $template
28 output_html_with_http_headers $query, "", $template->output;
30 sub gethelptemplate {
31 my ($tmplbase) = @_;
33 my $htdocs;
34 $htdocs = C4::Context->config('intrahtdocs');
35 my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet" );
36 unless ( -e "$htdocs/$theme/$lang/$tmplbase" ) {
37 $tmplbase = "modules/help/nohelp.tmpl";
38 ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet" );
40 my $template = HTML::Template->new(
41 filename => "$htdocs/$theme/$lang/$tmplbase",
42 die_on_bad_params => 0,
43 global_vars => 1,
44 path => ["$htdocs/$theme/$lang/includes"]
47 # XXX temporary patch for Bug 182 for themelang
48 $template->param(
49 themelang => '/intranet-tmpl' . "/$theme/$lang",
50 interface => '/intranet-tmpl',
51 theme => $theme,
52 lang => $lang,
53 intranetcolorstylesheet =>
54 C4::Context->preference("intranetcolorstylesheet"),
55 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
56 IntranetNav => C4::Context->preference("IntranetNav"),
57 referer => $refer,
59 return $template;