Ignore:
Timestamp:
07/27/10 17:06:18 (14 years ago)
Author:
Kris Deugau
Message:

/branches/htmlform

Remove printFooter from CommonWeb.pm
Add HTML::Template to main.cgi, admin.cgi, and search.cgi
Convert footer.inc to templates/footer.tmpl, and normalize
output for three scripts above
See #3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/htmlform/cgi-bin/main.cgi

    r448 r449  
    1313use CGI::Carp qw(fatalsToBrowser);
    1414use CGI::Simple;
     15use HTML::Template;
    1516use DBI;
    1617use CommonWeb qw(:ALL);
     
    4950}
    5051initIPDBGlobals($ip_dbh);
     52
     53# Set up some globals
     54##fixme - need to autofill this somehow
     55$ENV{HTML_TEMPLATE_ROOT} = '/home/kdeugau/dev/ipdb/trunk/templates';
    5156
    5257# Headerize!  Make sure we replace the $$EXTRA0$$ bit as needed.
     
    173178finish($ip_dbh);
    174179
    175 print qq(<div align=right style="position: absolute; right: 30px;">).
    176         qq(<a href="/ip/cgi-bin/admin.cgi">Admin tools</a></div><br>\n)
    177         if $IPDBacl{$authuser} =~ /A/;
     180#print qq(<div align=right style="position: absolute; right: 30px;">).
     181#       qq(<a href="/ip/cgi-bin/admin.cgi">Admin tools</a></div><br>\n)
     182#       if $IPDBacl{$authuser} =~ /A/;
    178183
    179184# We print the footer here, so we don't have to do it elsewhere.
    180 printFooter;
     185my $footer = HTML::Template->new(filename => "footer.tmpl");
     186# include the admin tools link in the output?
     187$footer->param(adminlink => ($IPDBacl{$authuser} =~ /A/));
     188
     189print $footer->output;
     190
    181191# Just in case something waaaayyy down isn't in place
    182192# properly... we exit explicitly.
     
    11811191    # Relatively simple SQL transaction here.
    11821192    my $sql;
    1183 ##fixme:  SQL parameters (#34)
    1184 # need to make sure we log roughly the same info
    11851193    if (my $pooltype = ($webvar{alloctype} =~ /^(.)i$/) ) {
    11861194      $sql = "update poolips set custid='$webvar{custid}',notes='$webvar{notes}',".
     
    14131421
    14141422
     1423# going, going, gone... this sub to be removed Any Day Real Soon Now(TM)
    14151424sub exitError {
    14161425  my $errStr = $_[0];
     
    14201429</center>
    14211430);
    1422   printFooter();
     1431
     1432  # We print the footer here, so we don't have to do it elsewhere.
     1433  my $footer = HTML::Template->new(filename => "footer.tmpl");
     1434  # include the admin tools link in the output?
     1435  $footer->param(adminlink => ($IPDBacl{$authuser} =~ /A/));
     1436
     1437  print $footer->output;
     1438
    14231439  exit;
    14241440} # errorExit
Note: See TracChangeset for help on using the changeset viewer.