-#! /usr/bin/perl
-#
# $Id$
# List of projects Perl template.
-# Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
+# 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
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;
-require CGI;
-Wrequire 'My::Project';
+Wrequire 'project::Lib';
+sub handler
+{
My::Web->init(
- "__PACKAGE__"=>__PACKAGE__,
"title"=>'Project List',
"args_check"=>{
"platform"=>'^(?:platform)?$',
},
-# "rel_up"=>top_dir(), # TODO:homepage
-# "rel_start"=>top_dir(), # TODO:homepage
+# "rel_up"=>"/", # TODO:homepage
+# "rel_start"=>"/", # TODO:homepage
"footer_ids"=>0,
);
My::Web->heading();
-my $CGI=CGI->new();
-print My::Project->views(($W->{"args"}{"platform"} ? "BriefPlatform" : "BriefUnified"));
-print My::Project->platforms(undef(),"novskip"=>1) if $W->{"args"}{"platform"};
+print(project::Lib->views(($W->{"args"}{"platform"} ? "BriefPlatform" : "BriefUnified")));
+print(project::Lib->platforms(undef(),"novskip"=>1)) if $W->{"args"}{"platform"};
-my %item=( My::Project::item_hash_read() );
+my %item=project::Lib->name_to_hashref();
# $col{"name"}{"show"}=1
# $col{"name"}{"format"}=sub { "<".$_[0].">"; }
sub format_url ($) { return (!$_[0] ? "" : '<a href="'.$_[0].'">X</a>'); }
$col{"name"}{"format"}=sub {
- $_[0]=~s#<a\s[^>]*>([^<]*)</a>#$1#g;
+ local $_=$_[0];
+ s#<a\s[^>]*>([^<]*)</a>#$1#g;
return "<a href=\"".$_[1]."/\">"
.(!$My::Web::W->{"args"}{"W"} ? "" : $item{$_[1]}{"priority"}.":")
- .$_[0]."</a>";
+ .$_."</a>";
};
$col{"license"}{"format"}=sub {
print '</td>';
}
print '</tr>'."\n";
- if ($CGI->param("description_opt")) {
+ if ($W->{"args"}{"description_opt"}) {
print '<tr><td style="border: none;"></td>';
print '<td colspan="'.(scalar(@col_order)-1).'"><blockquote>'.$item{$row}{"description"}.'</blockquote></td>';
print '</tr>'."\n";
&{$print_one_platform}(undef());
}
else {
- my @platforms=@My::Project::platforms;
+ my @platforms=@project::Lib::platforms;
while (@platforms) {
my $platform_sym =shift @platforms;
my $platform_name=shift @platforms;
- print '<a name="'.$platform_sym.'">';
- print "<h2>$platform_name</h2>";
- print '</a>'."\n";
+ print '<h2 id="'.$platform_sym.'">'.$platform_name.'</h2>'."\n";
&{$print_one_platform}($platform_sym);
}
}
-My::Web->footer();
+exit;
+}
+1;