Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 61 lines (50 sloc) 1.919 kb
b9472e7d » tipaul
2004-06-03 new feature : online HELP
1 #!/usr/bin/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;
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()
88b2c19a » Joe Atzberger
2008-01-08 help.pl - bugfix module usage (HTML::Template::Pro)
14 our $refer = $query->referer();
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
15
ef2ff09c » rangi
2006-06-07 Merging Katipo changes
16 # workaround for popup not functioning correctly in IE
17 my $referurl = $query->param('url');
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
18 if ($referurl) {
ef2ff09c » rangi
2006-06-07 Merging Katipo changes
19 $refer = $query->param('url');
20 }
21
b9472e7d » tipaul
2004-06-03 new feature : online HELP
22 $refer =~ /.*koha\/(.*)\.pl.*/;
78d564b2 » Joshua Ferraro
2007-08-30 fixing help feature with new template structure
23 my $from = "modules/help/$1.tmpl";
b9472e7d » tipaul
2004-06-03 new feature : online HELP
24
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
25 my $template = gethelptemplate( $from, "intranet" );
26
b9472e7d » tipaul
2004-06-03 new feature : online HELP
27 # my $template
28 output_html_with_http_headers $query, "", $template->output;
29
6cdf0832 » Joshua Ferraro
2007-08-09 new virtual shelves changes, keyed by biblionumber
30 sub gethelptemplate {
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
31 my ($tmplbase) = @_;
32
33 my $htdocs;
34 $htdocs = C4::Context->config('intrahtdocs');
13e77ca7 » Mason James
2008-01-07 missing $query arg to themelanguage()
35 my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet", $query );
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
36 unless ( -e "$htdocs/$theme/$lang/$tmplbase" ) {
78d564b2 » Joshua Ferraro
2007-08-30 fixing help feature with new template structure
37 $tmplbase = "modules/help/nohelp.tmpl";
13e77ca7 » Mason James
2008-01-07 missing $query arg to themelanguage()
38 ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet", $query );
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
39 }
88b2c19a » Joe Atzberger
2008-01-08 help.pl - bugfix module usage (HTML::Template::Pro)
40 my $template = HTML::Template::Pro->new(
ebb3697a » Joshua Ferraro
2007-08-30 perltidy help.pl
41 filename => "$htdocs/$theme/$lang/$tmplbase",
42 die_on_bad_params => 0,
43 global_vars => 1,
44 path => ["$htdocs/$theme/$lang/includes"]
45 );
46
47 # XXX temporary patch for Bug 182 for themelang
48 $template->param(
49 themelang => '/intranet-tmpl' . "/$theme/$lang",
50 interface => '/intranet-tmpl',
51 theme => $theme,
52 lang => $lang,
53 intranetcolorstylesheet =>
54 C4::Context->preference("intranetcolorstylesheet"),
55 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
56 IntranetNav => C4::Context->preference("IntranetNav"),
b883e6cd » Jesse Weaver
2008-11-19 fix for bug 2447: yuipath variable not getting passed to help pages
57 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
58 referer => $refer,
59 );
60 return $template;
b9472e7d » tipaul
2004-06-03 new feature : online HELP
61 }
Something went wrong with that request. Please try again.