<html>
<head>
 <title><%$title%></title>
 <link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body><table width="99%">
<tr>
 <td colspan="2" id="title"><%$title%></td>
</tr>
<tr>
 <td id="left-menu">
 &nbsp;<br />
% for my $page (@pages){
 <% menu_link($page) %><br />
% }
 &nbsp;<br />
 </td>
 <td id="body">
% $m->call_next();
 </td>
</tr>
<tr>
 <td colspan="2" id="about">
 Daniel Garcia-Galili (<a href="mailto:dgg@marlboro.edu">dgg@marlboro.edu</a>)<br />
 December 2 2004
</td>
</tr>
</table></body>
</html>
%#
%#====================================================
%#
<%init>

 # Set the path where PERL looks for packages to include the
 # directory where this autohandler is, if it's not already there.
 my $directory = $m->current_comp->source_dir;
 push @INC, $directory unless grep(/$directory/,@INC);


 my $title = "Periodicals_DB v0.02";

 require periodicals::periodicals;
 require periodicals::journal;
 require periodicals::frequency;
 require periodicals::publisher;
 require periodicals::vendor;
 require periodicals::issue;

 # These are the pages that show up in the menu on the left of the screen.
 # The URL for each is its name with .html appended.
 my @pages = qw( home add_entries edit_entries show_tables manage_issues search );

 # Given one of the entries in that @page list, 
 # return the HTML string that links to that page,
 # or a string that shows we're already visiting that page.
 sub menu_link {
   my ($page) = @_;
   return $m->base_comp->name =~ /$page/ ?
     qq{<span class="current-page">$page</span>} :
     qq{<a href="$page.html">$page</a>};
 }

</%init>
