Initial mod_perl-2.0 port.
[www.jankratochvil.net.git] / Contact.pm
diff --git a/Contact.pm b/Contact.pm
new file mode 100644 (file)
index 0000000..0a5c947
--- /dev/null
@@ -0,0 +1,71 @@
+# $Id$
+# Contact page Perl template.
+# Copyright (C) 2003-2005 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+package Contact;
+require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
+use vars qw($VERSION $CVS_ID);
+$VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+$CVS_ID=q$Id$;
+use strict;
+use warnings;
+
+use My::Web;
+require CGI;
+Wrequire 'resume::ResumeJanKratochvil';
+use Carp qw(confess cluck);
+
+
+sub handler
+{
+my $W=My::Web->init(
+               "title"=>"Contact",
+               "section"=>"Contact",
+               "head"=><<"HERE",
+<link rel="stylesheet" type="text/css" href="@{[ uri_escaped(path_web "/Contact.css") ]}" />
+HERE
+               );
+My::Web->heading();
+
+
+print <<"HERE";
+<table width="100%" style="border-style: none;"><tr><td align="center"><table class="contact">
+HERE
+my @contact=resume::ResumeJanKratochvil->Contact();
+my %keys=map(($_=>1),qw(Name eMail Projects OpenPGP));
+while (@contact) {
+       my $key=shift @contact;
+       my $val=shift @contact;
+       next if !$keys{$key};
+       delete $keys{$key};
+       print <<"HERE";
+<tr>
+       <td class="tab-head">$key</td>
+       <td@{[ ($key ne "OpenPGP" ? '' : ' style="font-family: monospace;"') ]}>$val</td>
+</tr>
+HERE
+       }
+cluck join(" ","Not found keys:",keys(%keys)) if keys(%keys);
+print <<"HERE";
+</table></td></tr></table>
+
+HERE
+
+
+My::Web->footer();
+}
+1;