Ignore:
Timestamp:
12/24/15 13:14:27 (8 years ago)
Author:
Kris Deugau
Message:

/trunk

Extend template-replacement from r793 to search.cgi and admin.cgi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/search.cgi

    r670 r801  
    7171
    7272# Set up some globals
    73 $ENV{HTML_TEMPLATE_ROOT} = $thingroot."templates";
     73$ENV{HTML_TEMPLATE_ROOT} = $thingroot;
     74my @templatepath = [ "localtemplates", "templates" ];
    7475
    7576my $page;
    7677if (!defined($webvar{stype})) {
    7778  $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);
    7980} 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);
    8182  $page->param(webpath => $IPDB::webpath);
    8283}
    8384
    84 my $header = HTML::Template->new(filename => "header.tmpl");
     85my $header = HTML::Template->new(filename => "header.tmpl", path => @templatepath);
    8586$header->param(version => $IPDB::VERSION);
    8687$header->param(addperm => $IPDBacl{$authuser} =~ /a/);
     
    9495# Handle the DB error first
    9596if (!$ip_dbh) {
    96   $page = HTML::Template->new(filename => "dberr.tmpl");
     97  $page = HTML::Template->new(filename => "dberr.tmpl", path => @templatepath);
    9798  $page->param(errmsg => $errstr);
    9899} elsif ($webvar{stype} eq 'q') {
     
    314315
    315316# We print the footer here, so we don't have to do it elsewhere.
    316 my $footer = HTML::Template->new(filename => "footer.tmpl");
     317my $footer = HTML::Template->new(filename => "footer.tmpl", path => @templatepath);
    317318# include the admin tools link in the output?
    318319$footer->param(adminlink => ($IPDBacl{$authuser} =~ /A/));
Note: See TracChangeset for help on using the changeset viewer.