modperl bootstrap
[www.jankratochvil.net.git] / project / line9k / Index.html.pl
similarity index 76%
rename from project/line9k/index.html.pl
rename to project/line9k/Index.html.pl
index b803226..dc8beec 100755 (executable)
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 
+package project::line9k::Index;
 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$;
+our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
+our $CVS_ID=q$Id$;
 use strict;
 use warnings;
 
+BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
 use My::Web;
+use My::Project;
 use project::line9k::ListItem;
 
 
-My::Web->init_project(
-               "ListItem"=>\%My::Project::line9k::ListItem,
+My::Project->init_project(
+               "__PACKAGE__"=>__PACKAGE__,
+               "ListItem"=>\@project::line9k::ListItem::ListItem,
                );
 
 print <<'HERE';
@@ -40,6 +43,6 @@ your original mobile phone charge to <code>AC</code> pins. <code>PS/2</code> key
 fork of <code>+5V</code>/<code>GND</code> pins are required to power this hardware switch.</p>
 HERE
 
-print '<table border="0"><tr><td align="center">'.My::Web::img("line9k.gif","AC Switch Scheme").'</td></tr></table>'."\n";
+print '<table border="0"><tr><td align="center">'.My::Web::img("line9k","AC Switch Scheme").'</td></tr></table>'."\n";
 
 My::Web->footer();