Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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