Skip to content
Newer
Older
100755 63 lines (51 sloc) 1.89 KB
a0b06fb @ctfliblime Prepare for perlbrew usage by changing all script magic to "#!/usr/bi…
ctfliblime authored Mar 12, 2011
1 #!/usr/bin/env perl
88b2c19 help.pl - bugfix module usage (HTML::Template::Pro)
Joe Atzberger authored Jan 8, 2008
2
b9472e7 new feature : online HELP
tipaul authored Jun 3, 2004
3 use strict;
88b2c19 help.pl - bugfix module usage (HTML::Template::Pro)
Joe Atzberger authored Jan 8, 2008
4 use HTML::Template::Pro;
ebb3697 perltidy help.pl
Joshua Ferraro authored Aug 30, 2007
5
88b2c19 help.pl - bugfix module usage (HTML::Template::Pro)
Joe Atzberger authored Jan 8, 2008
6 use C4::Output; # contains gettemplate
b9472e7 new feature : online HELP
tipaul authored Jun 3, 2004
7 # use C4::Auth;
3607caa @ctfliblime Add Koha.pm and include it universally
ctfliblime authored Jun 9, 2011
8 use Koha;
b9472e7 new feature : online HELP
tipaul authored Jun 3, 2004
9 use C4::Context;
10 use CGI;
11
12 my $query = new CGI;
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 Jan 8, 2008
15 our $refer = $query->referer();
ebb3697 perltidy help.pl
Joshua Ferraro authored Aug 30, 2007
16
ef2ff09 Merging Katipo changes
rangi authored Jun 7, 2006
17 # workaround for popup not functioning correctly in IE
18 my $referurl = $query->param('url');
ebb3697 perltidy help.pl
Joshua Ferraro authored Aug 30, 2007
19 if ($referurl) {
ef2ff09 Merging Katipo changes
rangi authored Jun 7, 2006
20 $refer = $query->param('url');
21 }
22
b9472e7 new feature : online HELP
tipaul authored Jun 3, 2004
23 $refer =~ /.*koha\/(.*)\.pl.*/;
78d564b fixing help feature with new template structure
Joshua Ferraro authored Aug 30, 2007
24 my $from = "modules/help/$1.tmpl";
b9472e7 new feature : online HELP
tipaul authored Jun 3, 2004
25
ebb3697 perltidy help.pl
Joshua Ferraro authored Aug 30, 2007
26 my $template = gethelptemplate( $from, "intranet" );
27
b9472e7 new feature : online HELP
tipaul authored Jun 3, 2004
28 # my $template
29 output_html_with_http_headers $query, "", $template->output;
30
6cdf083 new virtual shelves changes, keyed by biblionumber
Joshua Ferraro authored Aug 9, 2007
31 sub gethelptemplate {
ebb3697 perltidy help.pl
Joshua Ferraro authored Aug 30, 2007
32 my ($tmplbase) = @_;
33
34 my $htdocs;
35 $htdocs = C4::Context->config('intrahtdocs');
13e77ca missing $query arg to themelanguage()
Mason James authored Jan 7, 2008
36 my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet", $query );
ebb3697 perltidy help.pl
Joshua Ferraro authored Aug 30, 2007
37 unless ( -e "$htdocs/$theme/$lang/$tmplbase" ) {
78d564b fixing help feature with new template structure
Joshua Ferraro authored Aug 30, 2007
38 $tmplbase = "modules/help/nohelp.tmpl";
13e77ca missing $query arg to themelanguage()
Mason James authored Jan 7, 2008
39 ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet", $query );
ebb3697 perltidy help.pl
Joshua Ferraro authored Aug 30, 2007
40 }
88b2c19 help.pl - bugfix module usage (HTML::Template::Pro)
Joe Atzberger authored Jan 8, 2008
41 my $template = HTML::Template::Pro->new(
ebb3697 perltidy help.pl
Joshua Ferraro authored Aug 30, 2007
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 Nov 19, 2008
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 Aug 30, 2007
59 referer => $refer,
60 );
61 return $template;
b9472e7 new feature : online HELP
tipaul authored Jun 3, 2004
62 }
Something went wrong with that request. Please try again.