Changeset 801
- Timestamp:
- 12/24/15 13:14:27 (9 years ago)
- Location:
- trunk/cgi-bin
- Files:
-
- 2 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/)); -
trunk/cgi-bin/search.cgi
r670 r801 71 71 72 72 # Set up some globals 73 $ENV{HTML_TEMPLATE_ROOT} = $thingroot."templates"; 73 $ENV{HTML_TEMPLATE_ROOT} = $thingroot; 74 my @templatepath = [ "localtemplates", "templates" ]; 74 75 75 76 my $page; 76 77 if (!defined($webvar{stype})) { 77 78 $webvar{stype} = "<NULL>"; #shuts up the warnings. 78 $page = HTML::Template->new(filename => "search/compsearch.tmpl" );79 $page = HTML::Template->new(filename => "search/compsearch.tmpl", path => @templatepath); 79 80 } else { 80 $page = HTML::Template->new(filename => "search/sresults.tmpl", global_vars => 1 );81 $page = HTML::Template->new(filename => "search/sresults.tmpl", global_vars => 1, path => @templatepath); 81 82 $page->param(webpath => $IPDB::webpath); 82 83 } 83 84 84 my $header = HTML::Template->new(filename => "header.tmpl" );85 my $header = HTML::Template->new(filename => "header.tmpl", path => @templatepath); 85 86 $header->param(version => $IPDB::VERSION); 86 87 $header->param(addperm => $IPDBacl{$authuser} =~ /a/); … … 94 95 # Handle the DB error first 95 96 if (!$ip_dbh) { 96 $page = HTML::Template->new(filename => "dberr.tmpl" );97 $page = HTML::Template->new(filename => "dberr.tmpl", path => @templatepath); 97 98 $page->param(errmsg => $errstr); 98 99 } elsif ($webvar{stype} eq 'q') { … … 314 315 315 316 # We print the footer here, so we don't have to do it elsewhere. 316 my $footer = HTML::Template->new(filename => "footer.tmpl" );317 my $footer = HTML::Template->new(filename => "footer.tmpl", path => @templatepath); 317 318 # include the admin tools link in the output? 318 319 $footer->param(adminlink => ($IPDBacl{$authuser} =~ /A/));
Note:
See TracChangeset
for help on using the changeset viewer.