Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 62 lines (51 sloc) 1.933 kb
a0b06fbe » ctfliblime
2011-03-12 Prepare for perlbrew usage by changing all script magic to "#!/usr/bi…
1 #!/usr/bin/env perl
88b2c19a » Joe Atzberger
2008-01-08 help.pl - bugfix module usage (HTML::Template::Pro)
2
b9472e7d » tipaul
2004-06-03 new feature : online HELP
3 use strict;
88b2c19a » Joe Atzberger
2008-01-08 help.pl - bugfix module usage (HTML::Template::Pro)
4 use HTML::Template::Pro;
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
5
88b2c19a » Joe Atzberger
2008-01-08 help.pl - bugfix module usage (HTML::Template::Pro)
6 use C4::Output; # contains gettemplate
b9472e7d » tipaul
2004-06-03 new feature : online HELP
7 # use C4::Auth;
3607caae » ctfliblime
2011-06-09 Add Koha.pm and include it universally
8 use Koha;
b9472e7d » tipaul
2004-06-03 new feature : online HELP
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()
88b2c19a » Joe Atzberger
2008-01-08 help.pl - bugfix module usage (HTML::Template::Pro)
15 our $refer = $query->referer();
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
16
ef2ff09c » rangi
2006-06-07 Merging Katipo changes
17 # workaround for popup not functioning correctly in IE
18 my $referurl = $query->param('url');
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
19 if ($referurl) {
ef2ff09c » rangi
2006-06-07 Merging Katipo changes
20 $refer = $query->param('url');
21 }
22
b9472e7d » tipaul
2004-06-03 new feature : online HELP
23 $refer =~ /.*koha\/(.*)\.pl.*/;
78d564b2 » Joshua Ferraro
2007-08-30 fixing help feature with new template structure
24 my $from = "modules/help/$1.tmpl";
b9472e7d » tipaul
2004-06-03 new feature : online HELP
25
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
26 my $template = gethelptemplate( $from, "intranet" );
27
b9472e7d » tipaul
2004-06-03 new feature : online HELP
28 # my $template
29 output_html_with_http_headers $query, "", $template->output;
30
6cdf0832 » Joshua Ferraro
2007-08-09 new virtual shelves changes, keyed by biblionumber
31 sub gethelptemplate {
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
32 my ($tmplbase) = @_;
33
34 my $htdocs;
35 $htdocs = C4::Context->config('intrahtdocs');
13e77ca7 » Mason James
2008-01-07 missing $query arg to themelanguage()
36 my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet", $query );
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
37 unless ( -e "$htdocs/$theme/$lang/$tmplbase" ) {
78d564b2 » Joshua Ferraro
2007-08-30 fixing help feature with new template structure
38 $tmplbase = "modules/help/nohelp.tmpl";
13e77ca7 » Mason James
2008-01-07 missing $query arg to themelanguage()
39 ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet", $query );
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
40 }
88b2c19a » Joe Atzberger
2008-01-08 help.pl - bugfix module usage (HTML::Template::Pro)
41 my $template = HTML::Template::Pro->new(
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
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"),
b883e6cd » Jesse Weaver
2008-11-19 fix for bug 2447: yuipath variable not getting passed to help pages
58 yuipath => (C4::Context->preference("yuipath") eq "local"?"/intranet-tmpl/$theme/$lang/lib/yui":C4::Context->preference("yuipath")),
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
59 referer => $refer,
60 );
61 return $template;
b9472e7d » tipaul
2004-06-03 new feature : online HELP
62 }
Something went wrong with that request. Please try again.