View | Details | Raw Unified | Return to bug 8705
Collapse All | Expand All

(-)a/help.pl (-7 / +13 lines)
Lines 25-43 use C4::Output; Link Here
25
use C4::Context;
25
use C4::Context;
26
use CGI;
26
use CGI;
27
27
28
sub _help_template_file_of_url($) {
29
    my $url = shift;
30
    my $file;
31
    if ($url =~ /koha\/(.*)\.pl/) {
32
        $file = $1; 
33
    } else {
34
        $file = 'mainpage';
35
    }
36
    $file =~ s/[^a-zA-Z0-9_\-\/]*//g;
37
    return "help/$file.tt";
38
}
39
28
my $query = new CGI;
40
my $query = new CGI;
29
41
30
# find the script that called the online help using the CGI referer()
42
# find the script that called the online help using the CGI referer()
31
our $refer = $query->param('url');
43
our $refer = $query->param('url');
32
$refer = $query->referer()  if !$refer || $refer eq 'undefined';
44
$refer = $query->referer()  if !$refer || $refer eq 'undefined';
33
45
my $from = _help_template_file_of_url($refer);
34
$refer =~ /koha\/(.*)\.pl/;
35
my $file = $1;
36
$file =~ s/[^a-zA-Z0-9_\-\/]*//g;
37
my $from = "help/$file.tt";
38
46
39
my $template = C4::Templates::gettemplate($from, 'intranet', $query);
47
my $template = C4::Templates::gettemplate($from, 'intranet', $query);
40
$template->param( referer => $refer );
48
$template->param( referer => $refer );
41
49
42
output_html_with_http_headers $query, "", $template->output;
50
output_html_with_http_headers $query, "", $template->output;
43
44
- 

Return to bug 8705