From: Jan Michel Date: Fri, 10 May 2013 17:05:13 +0000 (+0200) Subject: set-up finished X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=4223715a0a30c1834315b16c36c58c336254b1e1;p=trb3web.git set-up finished --- diff --git a/WebConfig.pm b/WebConfig.pm new file mode 100644 index 0000000..060214e --- /dev/null +++ b/WebConfig.pm @@ -0,0 +1,39 @@ +#!/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 diff --git a/contact.htm b/contact.htm new file mode 100644 index 0000000..f1ca756 --- /dev/null +++ b/contact.htm @@ -0,0 +1,2 @@ +

Contact

+This guys, that guy, and ... this guy as well. diff --git a/frame.pm b/frame.pm index cd0dbdf..6888e70 100755 --- a/frame.pm +++ b/frame.pm @@ -1,24 +1,23 @@ #!/usr/bin/perl -w -use Data::Dumper; -#Entries for top menu -my $toplink = {"index.pl" => "Main", - "contact.pl" => "Contact" - }; -#Entries for sidebar menu -my $menues = { - toplevel => {"index.pl" => "Main", - "contact.pl" => "Contact" - }, - contact => {"index.pl" => "Main", - } - }; +use WebConfig; + + + + + +################################### +##Functions +################################### sub makeframe { -my ($menu) = @_; +my ($select) = @_; +my $menu = $menuselect->{"default"}; +$menu = $menuselect->{$select} if exists $menuselect->{$select}; + print < @@ -39,8 +38,8 @@ print < HDOC -foreach my $k (keys %$toplink) { - print "
  • $toplink->{$k}\n"; +while (my ($k) = each @toplink) { + print "
  • [0]\">$toplink[$k]->[1]\n"; } @@ -56,8 +55,8 @@ HDOC print "
    \n"; print "\n
    \r\n"; } diff --git a/help.htm b/help.htm new file mode 100644 index 0000000..94d7786 --- /dev/null +++ b/help.htm @@ -0,0 +1,44 @@ +

    Help for changing content

    +
      +
    • A content file is contains plain HTML code, headings start with <h3>. +
    • Links to other files are given as "?filename". Note the question mark and the missing .htm. +
    • If a file should show up in the menues, edit WebConfig.pm: +
        +
      • @toplink contains entries to menue at the top-right. Each entry consists of filename and link name to be shown in the menue. +
      • $menues contains the menues. Each menue is an array of filename => link name pairs. +
      • $menuselect decides which menue is shown for which page. Insert a pair of filename and menue name. +
      +
    + + + +
    +#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
    +  };
    +
    \ No newline at end of file diff --git a/index.pl b/index.pl index bf690be..c5b1adc 100755 --- a/index.pl +++ b/index.pl @@ -1,16 +1,25 @@ #!/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 "
    \n\n"; -makeframe("toplevel"); +my $MYF; +open ($MYF, "<$file.htm") or return ""; +while (<$MYF>){ + print $_; + } -print < -

    Basic Stuff

    -Very good thing, indeed. -
    -HDOC +print "\n\n"; makefoot(); \ No newline at end of file diff --git a/main.htm b/main.htm new file mode 100644 index 0000000..df46773 --- /dev/null +++ b/main.htm @@ -0,0 +1,2 @@ +

    Basic Stuff

    +Very good thing, indeed. \ No newline at end of file diff --git a/styleold.css b/styleold.css index 423da57..625aa93 100644 --- a/styleold.css +++ b/styleold.css @@ -22,6 +22,7 @@ body { 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;*/ @@ -229,4 +230,13 @@ h3, h4 { dt { font-weight:bold; + } + + +pre { + background:#eee; + width:90%; + overflow:auto; + border:1px solid #aaa; + line-height:110%; } \ No newline at end of file