Source

Web-CPAN-Site / wml / template.wml

Full commit
# #use wml::des::navbar

<:{
use MyNavData;
use HTML::Widgets::NavMenu;

my $filename = "$(LATEMP_FILENAME)";
$filename =~ s!index\.html$!!;
$filename = "/$filename";

my $nav_bar = HTML::Widgets::NavMenu->new(
    'path_info' => $filename,
    'current_host' => "berlios",
    MyNavData::get_params(),
    'ul_classes' => [ "navbarmain", ("navbarnested") x 10 ],
    );

my $rendered_results = $nav_bar->render();

use vars qw($nav_links);

$nav_links = $rendered_results->{nav_links};

use vars qw($nav_html);

$nav_html = $rendered_results->{html};

}:>

<define-tag email:link>
<a href="mailto:%0">%0</a>
</define-tag>

# The Definition of the page itself
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>{#SUBJECT_LOC#}</title>
<link rel="stylesheet" href="$(ROOT)/style.css" type="text/css" />
<:{
use CGI qw();

my @keys = (sort { $a cmp $b } keys(%$nav_links));
foreach my $key (@keys)
{
    my $url = $nav_links->{$key};
    print "<link rel=\"$key\" href=\"" . CGI::escapeHTML($url) . "\" />\n"
}
}:>
</head>
<body>


<define-tag rellink whitespace="delete">
<preserve url />
<set-var %attributes />
$(ROOT)/<get-var url />
<restore url />
</define-tag>

<define-tag site:link whitespace="delete">
<preserve url />
<set-var %attributes />
http://web-cpan.berlios.de/<get-var url />
<restore url />
</define-tag>

<define-tag wiki:link whitespace="delete">
<preserve url />
<set-var %attributes />
<ifeq "<get-var url />" "" 
    "<set-var url="/Main/HomePage" />" 
    "<set-var url="/<get-var url />" />" 
    />
<site:link url="Wiki/pmwiki/pmwiki.php" /><get-var url />
<restore url />
</define-tag>

<define-tag nothing></define-tag>

<table summary="Layout Table: The first cell contains a navigation bar, the second the main page" border="0" width="99%">
<tr>
<td valign="top" class="navbar" style="width:20%">

<:{ print join("\n", @$nav_html); }:>

<define-tag validhtml>
<p>
<a href="http://www.spreadfirefox.com/?q=affiliates&amp;id=0&amp;t=70"><img 
   style="margin-top:1em; border:0;" alt="Get Firefox!" 
   title="Get Firefox! A safer, faster, better web-browser." 
   src="$(ROOT)/images/get-firefox.gif" /></a>
</p>
<p>
<a href="http://validator.w3.org/check/referer"><img 
    style="border:0" src="$(ROOT)/images/valid-xhtml10.png" 
         alt="Valid XHTML 1.0!"
         /></a>
</p>
<p>
 <a href="http://jigsaw.w3.org/css-validator/validator?uri=http%%3A//web-cpan.berlios.de/$(LATEMP_FILENAME)"><img style="border:0"
       src="$(ROOT)/images/vcss.gif" 
       alt="Valid CSS!" /></a>
</p>
<p>
<a href="https://developer.berlios.de/project/make_donation.php?group_id=2352"
title="Make a Donation to support the project."><img
style="border:0" src="$(ROOT)/images/paypal.gif" alt="PayPal Donate" /></a>
</p>
</define-tag>

<validhtml />

</td>
<td valign="top" class="main">
<h1>{#SUBJECT_LOC#}</h1>
{#BODY#}

</td>
</tr>
</table>
<hr />
<p>
<b>Webmaster:</b> <a href="http://www.shlomifish.org/">Shlomi Fish</a>,
E-mail: <a href="mailto:shlomif@shlomifish.org">shlomif@shlomifish.org</a>.
</p>

</body>
</html>

<define-tag subject>
{#SUBJECT_LOC#:%0:##}
</define-tag>

<define-tag gen_module_html>
<set-var module_name="%0" />
<:{
my $module_name = "<get-var module_name />";
my $modules_list = MyModulesList::get_module_list();
my ($module_record) = (grep {$_->{'perl_name'} eq $module_name } @$modules_list);

print "<h2>CPAN Record</h2>\n\n";
my $cpan_link = "http://search.cpan.org/dist/$module_name/";
print "<p><a href=\"$cpan_link\">$cpan_link</a></p>\n";
print "<h2>Description</h2>\n";
print $module_record->{'desc'};
print "<h2>Subversion Directories</h2>\n";
my $repos_sub_path = "$module_record->{svn_dir}/trunk/";
my $svn_url = "http://svn.berlios.de/svnroot/repos/web-cpan";
print "<ul>\n<li>\n<a href=\"$svn_url/$repos_sub_path\">Trunk URL</a> (other
branches and tags can be found one level below it.)\n</li>\n";
print "<li>\n<a href=\"http://svn.berlios.de/viewcvs/web-cpan/$repos_sub_path\" rel=\"versioncontrol\">Browse the code online</a>\n</li>\n";
print "</ul>\n";
}:>
</define-tag>
#   per default we are in body
{#BODY#: