Changeset 793 for trunk/cgi-bin
- Timestamp:
- 12/16/15 17:44:30 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/main.cgi
r789 r793 70 70 71 71 # Set up some globals 72 $ENV{HTML_TEMPLATE_ROOT} = $thingroot."templates"; 73 74 my $header = HTML::Template->new(filename => "header.tmpl"); 75 my $footer = HTML::Template->new(filename => "footer.tmpl"); 76 my $utilbar = HTML::Template->new(filename => "utilbar.tmpl", loop_context_vars => 1, global_vars => 1); 72 $ENV{HTML_TEMPLATE_ROOT} = $thingroot; 73 my @templatepath = [ "localtemplates", "templates" ]; 74 75 my $header = HTML::Template->new(filename => "header.tmpl", path => @templatepath); 76 my $footer = HTML::Template->new(filename => "footer.tmpl", path => @templatepath); 77 my $utilbar = HTML::Template->new(filename => "utilbar.tmpl", loop_context_vars => 1, global_vars => 1, 78 path => @templatepath); 77 79 78 80 print "Content-type: text/html\n\n"; … … 96 98 97 99 my $page; 98 if (-e "$ENV{HTML_TEMPLATE_ROOT}/$webvar{action}.tmpl") { 99 $page = HTML::Template->new(filename => "$webvar{action}.tmpl", loop_context_vars => 1, global_vars => 1); 100 if (-e "$ENV{HTML_TEMPLATE_ROOT}/templates/$webvar{action}.tmpl") { 101 $page = HTML::Template->new(filename => "$webvar{action}.tmpl", loop_context_vars => 1, global_vars => 1, 102 path => @templatepath); 100 103 } else { 101 $page = HTML::Template->new(filename => "dunno.tmpl"); 104 $page = HTML::Template->new(filename => "dunno.tmpl", die_on_bad_params => 0, 105 path => @templatepath); 102 106 } 103 107 … … 230 234 # remove the links a user is not allowed to click on. 231 235 if ($aclerr) { 232 $page = HTML::Template->new(filename => "aclerror.tmpl" );236 $page = HTML::Template->new(filename => "aclerror.tmpl", path => @templatepath); 233 237 $page->param(ipdbfunc => $aclmsg{$aclerr}); 234 238 } … … 272 276 # Containers have a second line for the subblock metadata. 273 277 # We need to load an alternate template for this case. 274 $page = HTML::Template->new(filename => "showsubs2.tmpl", loop_context_vars => 1, global_vars => 1); 278 $page = HTML::Template->new(filename => "showsubs2.tmpl", loop_context_vars => 1, global_vars => 1, 279 path => @templatepath); 275 280 276 281 $page->param(maydel => ($IPDBacl{$authuser} =~ /d/));
Note:
See TracChangeset
for help on using the changeset viewer.