Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 64 lines (52 sloc) 1.971 kb
a0b06fb @ctfliblime Prepare for perlbrew usage by changing all script magic to "#!/usr/bi…
ctfliblime authored
1 #!/usr/bin/env perl
88b2c19 help.pl - bugfix module usage (HTML::Template::Pro)
Joe Atzberger authored
2
b9472e7 new feature : online HELP
tipaul authored
3 use strict;
88b2c19 help.pl - bugfix module usage (HTML::Template::Pro)
Joe Atzberger authored
4 use HTML::Template::Pro;
ebb3697 perltidy help.pl
Joshua Ferraro authored
5
88b2c19 help.pl - bugfix module usage (HTML::Template::Pro)
Joe Atzberger authored
6 use C4::Output; # contains gettemplate
b9472e7 new feature : online HELP
tipaul authored
7 # use C4::Auth;
3607caa @ctfliblime Add Koha.pm and include it universally
ctfliblime authored
8 use Koha;
b9472e7 new feature : online HELP
tipaul authored
9 use C4::Context;
10 use CGI;
11
b05cdbf @ctfliblime [#21464023] (followup) Security: arbitrary file inclusion
ctfliblime authored
12 our $query = CGI->new();
b9472e7 new feature : online HELP
tipaul authored
13
14 # find the script that called the online help using the CGI referer()
88b2c19 help.pl - bugfix module usage (HTML::Template::Pro)
Joe Atzberger authored
15 our $refer = $query->referer();
ebb3697 perltidy help.pl
Joshua Ferraro authored
16
ef2ff09 Merging Katipo changes
rangi authored
17 # workaround for popup not functioning correctly in IE
18 my $referurl = $query->param('url');
ebb3697 perltidy help.pl
Joshua Ferraro authored
19 if ($referurl) {
ef2ff09 Merging Katipo changes
rangi authored
20 $refer = $query->param('url');
21 }
22
b05cdbf @ctfliblime [#21464023] (followup) Security: arbitrary file inclusion
ctfliblime authored
23 $refer =~ s{/\.\.}{}g; # untaint
b9472e7 new feature : online HELP
tipaul authored
24 $refer =~ /.*koha\/(.*)\.pl.*/;
78d564b fixing help feature with new template structure
Joshua Ferraro authored
25 my $from = "modules/help/$1.tmpl";
b9472e7 new feature : online HELP
tipaul authored
26
b05cdbf @ctfliblime [#21464023] (followup) Security: arbitrary file inclusion
ctfliblime authored
27 our $template = gethelptemplate( $from, "intranet" );
ebb3697 perltidy help.pl
Joshua Ferraro authored
28
b9472e7 new feature : online HELP
tipaul authored
29 # my $template
30 output_html_with_http_headers $query, "", $template->output;
31
6cdf083 new virtual shelves changes, keyed by biblionumber
Joshua Ferraro authored
32 sub gethelptemplate {
ebb3697 perltidy help.pl
Joshua Ferraro authored
33 my ($tmplbase) = @_;
34
35 my $htdocs;
36 $htdocs = C4::Context->config('intrahtdocs');
13e77ca missing $query arg to themelanguage()
Mason James authored
37 my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet", $query );
ebb3697 perltidy help.pl
Joshua Ferraro authored
38 unless ( -e "$htdocs/$theme/$lang/$tmplbase" ) {
78d564b fixing help feature with new template structure
Joshua Ferraro authored
39 $tmplbase = "modules/help/nohelp.tmpl";
13e77ca missing $query arg to themelanguage()
Mason James authored
40 ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet", $query );
ebb3697 perltidy help.pl
Joshua Ferraro authored
41 }
88b2c19 help.pl - bugfix module usage (HTML::Template::Pro)
Joe Atzberger authored
42 my $template = HTML::Template::Pro->new(
ebb3697 perltidy help.pl
Joshua Ferraro authored
43 filename => "$htdocs/$theme/$lang/$tmplbase",
44 die_on_bad_params => 0,
45 global_vars => 1,
46 path => ["$htdocs/$theme/$lang/includes"]
47 );
48
49 # XXX temporary patch for Bug 182 for themelang
50 $template->param(
51 themelang => '/intranet-tmpl' . "/$theme/$lang",
52 interface => '/intranet-tmpl',
53 theme => $theme,
54 lang => $lang,
55 intranetcolorstylesheet =>
56 C4::Context->preference("intranetcolorstylesheet"),
57 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
58 IntranetNav => C4::Context->preference("IntranetNav"),
b883e6c fix for bug 2447: yuipath variable not getting passed to help pages
Jesse Weaver authored
59 yuipath => (C4::Context->preference("yuipath") eq "local"?"/intranet-tmpl/$theme/$lang/lib/yui":C4::Context->preference("yuipath")),
ebb3697 perltidy help.pl
Joshua Ferraro authored
60 referer => $refer,
61 );
62 return $template;
b9472e7 new feature : online HELP
tipaul authored
63 }
Something went wrong with that request. Please try again.