--- /dev/null
+#!/usr/bin/perl
+
+
+
+###################################
+##Content Menu Setup
+###################################
+
+#Entries for top menu
+our @toplink = (["main","Main"],
+ ["contact","Contact"]
+ );
+
+
+
+
+#Entries for sidebar menu
+our $menues = {
+
+ withhelp => [["main","Main"],
+ ["contact", "Contact"],
+ ["help", "Help"]
+ ],
+
+ withouthelp => [["main","Main"],
+ ["contact", "Contact"],
+ ],
+};
+
+
+#Assign a menu to each file that shall not show the main menu
+#file name => menue name
+our $menuselect = {
+ "default" => "withouthelp",
+ "contact" => "withhelp", #just to demonstrate it
+ };
+
+
+1;
\ No newline at end of file
--- /dev/null
+<h3>Contact</h3>
+This guys, that guy, and ... this guy as well.
#!/usr/bin/perl -w\r
-use Data::Dumper;\r
\r
-#Entries for top menu\r
-my $toplink = {"index.pl" => "Main",\r
- "contact.pl" => "Contact"\r
- };\r
\r
-#Entries for sidebar menu\r
-my $menues = {\r
- toplevel => {"index.pl" => "Main",\r
- "contact.pl" => "Contact"\r
- },\r
- contact => {"index.pl" => "Main",\r
- }\r
- };\r
+use WebConfig;\r
\r
+ \r
+ \r
+ \r
+ \r
+ \r
+###################################\r
+##Functions\r
+###################################\r
\r
\r
sub makeframe {\r
-my ($menu) = @_;\r
+my ($select) = @_;\r
+my $menu = $menuselect->{"default"};\r
+$menu = $menuselect->{$select} if exists $menuselect->{$select};\r
+\r
\r
print <<HDOC;\r
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\r
<ul id="menu">\r
HDOC\r
\r
-foreach my $k (keys %$toplink) {\r
- print "<li><a href=\"$k\">$toplink->{$k}</a>\n";\r
+while (my ($k) = each @toplink) {\r
+ print "<li><a href=\"index.pl?$toplink[$k]->[0]\">$toplink[$k]->[1]</a>\n";\r
}\r
\r
\r
\r
print "<dl id=\"navigation\"><dt>\n";\r
print "\n<dd><ul>\n";\r
-foreach my $k (keys $menues->{$menu}) {\r
- print "<li><a href=\"$k\">$menues->{$menu}->{$k}</a>\n";\r
+while (my ($k) = each $menues->{$menu}) {\r
+ print "<li><a href=\"index.pl?$menues->{$menu}->[$k]->[0]\">$menues->{$menu}->[$k]->[1]</a>\n";\r
}\r
print "</ul></dl>\r\n";\r
}\r
--- /dev/null
+<h3>Help for changing content</h3>
+<ul>
+ <li>A content file is contains plain HTML code, headings start with <h3>.
+ <li>Links to other files are given as "?filename". Note the question mark and the missing .htm.
+ <li>If a file should show up in the menues, edit WebConfig.pm:
+ <ul>
+ <li><tt>@toplink</tt> contains entries to menue at the top-right. Each entry consists of filename and link name to be shown in the menue.
+ <li><tt>$menues</tt> contains the menues. Each menue is an array of filename => link name pairs.
+ <li><tt>$menuselect</tt> decides which menue is shown for which page. Insert a pair of filename and menue name.
+ </ul>
+</ul>
+
+
+
+<pre>
+#Entries for top menu
+our @toplink = (["main","Main"],
+ ["contact","Contact"]
+ );
+
+
+
+
+#Entries for sidebar menu
+our $menues = {
+
+ withhelp => [["main","Main"],
+ ["contact", "Contact"],
+ ["help", "Help"]
+ ],
+
+ withouthelp => [["main","Main"],
+ ["contact", "Contact"],
+ ],
+};
+
+
+#Assign a menu to each file that shall not show the main menu
+#file name => menue name
+our $menuselect = {
+ "default" => "withouthelp",
+ "contact" => "withhelp", #just to demonstrate it
+ };
+</pre>
\ No newline at end of file
#!/usr/bin/perl -w
+use strict;
+use warnings;
+use CGI::Carp qw(fatalsToBrowser);
+use frame;
print "Content-type: text/html\n\n";
-use frame;
+my $file = $ENV{'QUERY_STRING'};
+$file = "main" unless (defined $file && $file =~ /\w/ && -e "$file.htm");
+
+
+
+makeframe($file);
+print "<div id=\"content\">\n\n";
-makeframe("toplevel");
+my $MYF;
+open ($MYF, "<$file.htm") or return "";
+while (<$MYF>){
+ print $_;
+ }
-print <<HDOC;
-<div id="content">
-<h3>Basic Stuff</h3>
-Very good thing, indeed.
-</div>
-HDOC
+print "\n\n</div>";
makefoot();
\ No newline at end of file
--- /dev/null
+<h3>Basic Stuff</h3>
+Very good thing, indeed.
\ No newline at end of file
background-color: #ffe; /*#dddde1;#e5ebdf*/
font-size: .9em;
width:100%;
+ height:100%;
font-family: Lucida Sans, Verdana, Arial, Helvetica, SunSans-Regular, Sans-Serif;
color:#474756;
/*margin: 100px 140px 5px 190px;*/
dt {
font-weight:bold;
+ }
+
+
+pre {
+ background:#eee;
+ width:90%;
+ overflow:auto;
+ border:1px solid #aaa;
+ line-height:110%;
}
\ No newline at end of file