Changeset 801 for trunk/cgi-bin/admin.cgi
- Timestamp:
- 12/24/15 13:14:27 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/admin.cgi
r789 r801 55 55 56 56 # Set up some globals 57 $ENV{HTML_TEMPLATE_ROOT} = $thingroot."templates"; 57 $ENV{HTML_TEMPLATE_ROOT} = $thingroot; 58 my @templatepath = [ "localtemplates", "templates" ]; 58 59 59 60 # Why not a global DB handle? (And a global statement handle, as well...) … … 75 76 # handle DB error output 76 77 if ($webvar{action} eq 'dberr') { 77 my $page = HTML::Template->new(filename => "admin/dberr.tmpl" );78 my $page = HTML::Template->new(filename => "admin/dberr.tmpl", path => @templatepath); 78 79 $page->param(errmsg => $errstr); 79 80 print "Content-Type: text/html\n\n".$page->output; … … 82 83 83 84 if ($IPDBacl{$authuser} !~ /A/) { 84 my $page = HTML::Template->new(filename => "admin/aclerr.tmpl" );85 my $page = HTML::Template->new(filename => "admin/aclerr.tmpl", path => @templatepath); 85 86 ##fixme: need params for IPDB admin email and name 86 87 $page->param(ipdbadmin_email => 'ipdbadmin@example.com'); … … 90 91 } 91 92 92 my $header = HTML::Template->new(filename => "admin/header.tmpl" );93 my $header = HTML::Template->new(filename => "admin/header.tmpl", path => @templatepath); 93 94 $header->param(mainpage => 1) if $webvar{action} eq 'main'; 94 95 $header->param(webpath => $IPDB::webpath); … … 96 97 97 98 my $page; 98 if (-e "$ENV{HTML_TEMPLATE_ROOT}/ admin/$webvar{action}.tmpl") {99 $page = HTML::Template->new(filename => "admin/$webvar{action}.tmpl" );99 if (-e "$ENV{HTML_TEMPLATE_ROOT}/templates/admin/$webvar{action}.tmpl") { 100 $page = HTML::Template->new(filename => "admin/$webvar{action}.tmpl", path => @templatepath); 100 101 } else { 101 $page = HTML::Template->new(filename => "admin/dunno.tmpl" );102 $page = HTML::Template->new(filename => "admin/dunno.tmpl", path => @templatepath); 102 103 } 103 104 … … 481 482 482 483 # We print the footer here, so we don't have to do it elsewhere. 483 my $footer = HTML::Template->new(filename => "footer.tmpl" );484 my $footer = HTML::Template->new(filename => "footer.tmpl", path => @templatepath); 484 485 # we're already in the admin tools, no need to provide a bottom link. maybe. 485 486 #$footer->param(adminlink => ($IPDBacl{$authuser} =~ /A/));
Note:
See TracChangeset
for help on using the changeset viewer.