#################################################################################
#
# File: $RCSfile: MAPSWeb.pm,v $
#################################################################################
#
# File: $RCSfile: MAPSWeb.pm,v $
# Description: Routines for generating portions of MAPSWeb
# Author: Andrew@DeFaria.com
# Created: Fri Nov 29 14:17:21 2002
# Description: Routines for generating portions of MAPSWeb
# Author: Andrew@DeFaria.com
# Created: Fri Nov 29 14:17:21 2002
$percent = sprintf '%5.1f%s', $percent, '%';
} # if
my $stat = $value == 0 ?
0 : a {-href => "detail.cgi?type=$_;date=$date"}, $value;
print
$percent = sprintf '%5.1f%s', $percent, '%';
} # if
my $stat = $value == 0 ?
0 : a {-href => "detail.cgi?type=$_;date=$date"}, $value;
print
# This subroutine puts out the header for web pages. It is called by
# various cgi scripts thus has a few parameters.
sub Heading ($$$$;$$@) {
# This subroutine puts out the header for web pages. It is called by
# various cgi scripts thus has a few parameters.
sub Heading ($$$$;$$@) {
- my ($action, # One of getcookie, setcookie, unsetcookie
- $userid, # User id (if setting a cookie)
- $title, # Title string
- $h1, # H1 header
- $h2, # H2 header (optional)
- $table_name, # Name of table in page, if any
- @scripts) = @_; # Array of JavaScript scripts to include
+ my ($action, # One of getcookie, setcookie, unsetcookie
+ $userid, # User id (if setting a cookie)
+ $title, # Title string
+ $h1, # H1 header
+ $h2, # H2 header (optional)
+ $table_name, # Name of table in page, if any
+ @scripts) = @_; # Array of JavaScript scripts to include
# Since CheckAddress appears on all pages (well except for the login
# page) include it by default along with MAPSUtils.js
push @java_scripts, [
# Since CheckAddress appears on all pages (well except for the login
# page) include it by default along with MAPSUtils.js
push @java_scripts, [
- {-language => 'JavaScript1.2',
- -src => '/maps/JavaScript/MAPSUtils.js'},
- {-language => 'JavaScript1.2',
- -src => '/maps/JavaScript/CheckAddress.js'}
+ {-language => 'JavaScript1.2',
+ -src => '/maps/JavaScript/MAPSUtils.js'},
+ {-language => 'JavaScript1.2',
+ -src => '/maps/JavaScript/CheckAddress.js'}
];
# Add on any additional JavaScripts that the caller wants. Note the
# odd single element array of hashes but that's what CGI requires!
# Build up scripts from array
];
# Add on any additional JavaScripts that the caller wants. Note the
# odd single element array of hashes but that's what CGI requires!
# Build up scripts from array
- {-language => 'JavaScript1.2',
- -src => "/maps/JavaScript/$_"}
+ {-language => 'JavaScript1.2',
+ -src => "/maps/JavaScript/$_"}
- start_html (-title => "MAPS: $title",
- -author => 'Andrew\@DeFaria.com',
- -style => {-src => '/maps/css/MAPSStyle.css'},
- -onResize => "AdjustTableWidth (\"$table_name\");",
- -head => [
- Link ({-rel => 'icon',
- -href => '/maps/MAPS.png',
- -type => 'image/png'}),
- Link ({-rel => 'shortcut icon',
- -href => '/maps/favicon.ico'})
+ start_html (-title => "MAPS: $title",
+ -author => 'Andrew\@DeFaria.com',
+ -style => {-src => '/maps/css/MAPSStyle.css'},
+ -onResize => "AdjustTableWidth (\"$table_name\");",
+ -head => [
+ Link ({-rel => 'icon',
+ -href => '/maps/MAPS.png',
+ -type => 'image/png'}),
+ Link ({-rel => 'shortcut icon',
+ -href => '/maps/favicon.ico'})
- start_html (-title => "MAPS: $title",
- -author => 'Andrew\@DeFaria.com',
- -style => {-src => '/maps/css/MAPSStyle.css'},
- -head => [
- Link ({-rel => 'icon',
- -href => '/maps/MAPS.png',
- -type => 'image/png'}),
- Link ({-rel => 'shortcut icon',
- -href => '/maps/favicon.ico'})],
- -script => @java_scripts);
+ start_html (-title => "MAPS: $title",
+ -author => 'Andrew\@DeFaria.com',
+ -style => {-src => '/maps/css/MAPSStyle.css'},
+ -head => [
+ Link ({-rel => 'icon',
+ -href => '/maps/MAPS.png',
+ -type => 'image/png'}),
+ Link ({-rel => 'shortcut icon',
+ -href => '/maps/favicon.ico'})],
+ -script => @java_scripts);
- print h2 {-align => 'center',
- -class => 'header'},
- font ({-class => 'standout'}, 'MAPS'),
+ print h2 {-align => 'center',
+ -class => 'header'},
+ font ({-class => 'standout'}, 'MAPS'),
- print div ({-class => 'username'}, 'Welcome to MAPS');
- print div ({-class => 'menu'},
- (a {-href => '/maps/doc/'},
+ print div ({-class => 'username'}, 'Welcome to MAPS');
+ print div ({-class => 'menu'},
+ (a {-href => '/maps/doc/'},
- print div ({-class => 'username'}, 'Welcome '. ucfirst $userid);
- print div ({-class => 'menu'},
- (a {-href => '/maps/'},
+ print div ({-class => 'username'}, 'Welcome '. ucfirst $userid);
+ print div ({-class => 'menu'},
+ (a {-href => '/maps/'},
- print start_form {-method => 'get',
- -action => '/maps/bin/search.cgi',
- -name => 'search'};
+ print start_form {-method => 'get',
+ -action => '/maps/bin/search.cgi',
+ -name => 'search'};
- textfield {-class => 'searchfield',
- -id => 'searchfield',
- -name => 'str',
- -size => 20,
- -maxlength => 255,
- -value => '',
- -onclick => "document.search.str.value = '';"};
+ textfield {-class => 'searchfield',
+ -id => 'searchfield',
+ -name => 'str',
+ -size => 20,
+ -maxlength => 255,
+ -value => '',
+ -onclick => "document.search.str.value = '';"};
- print start_form {-method => 'post',
- -action => 'javascript://',
- -name => 'address',
- -onsubmit => 'checkaddress(this);'};
+ print start_form {-method => 'post',
+ -action => 'javascript://',
+ -name => 'address',
+ -onsubmit => 'checkaddress(this);'};
- textfield {-class => 'searchfield',
- -id => 'searchfield',
- -name => 'email',
- -size => 20,
- -maxlength => 255,
- -value => '',
- -onclick => "document.address.email.value = '';"};
+ textfield {-class => 'searchfield',
+ -id => 'searchfield',
+ -name => 'email',
+ -size => 20,
+ -maxlength => 255,
+ -value => '',
+ -onclick => "document.address.email.value = '';"};