<: # First the menu definition # @menu = ('Infodrom','Linux','Debian','linx','text','service','zeitungen','News','projects'); %menu_name = ( 'Infodrom' => 'Infodrom', 'Linux' => 'Linux', 'Debian' => 'Debian', 'linx' => 'Linx', 'text' => 'Texte', 'service' => 'Service', 'zeitungen' => 'Zeitungen', 'News' => 'News', 'projects' => 'Projekte', ); # Noch frei: #ba55d3 (dunkelviolett), dann aber die beiden Grüntöne tauschen %menu_colors = ( 'Infodrom' => '0000ff', 'Linux' => '00bdff', 'Debian' => 'ff4040', # 'linx' => 'ff7f00', # 'linx' => 'f6be00', # 'linx' => 'f6d629', # 'linx' => 'f9bd09', 'linx' => 'ff8c00', # 'text' => 'ffd700', 'text' => 'ffc125', 'service' => 'ff00ff', 'zeitungen' => 'ab82ff', # 'News' => '32cd05', # 'projects' => '3cb371', # 'News' => '00ee00', # 'projects' => '66cd00', 'News' => '32cd05', # 'projects' => '19c100', 'projects' => '20b705', ); sub main_menu { $menucolor = "008dfd"; # Default: - Infodrom-Blau # The main menu print ""; for ($index=0; $index <= $#menu; $index++) { print "" if ($index > 0); if (("" =~ /src\/$menu[$index]$/) && ("" eq "index")) { printf "", $menu_colors{$menu[$index]}, $menu_name{$menu[$index]}; } else { printf "", $menu_colors{$menu[$index]}, $root_prefix, $menu[$index], $menu_name{$menu[$index]}; } } print "
" ."%s" ."%s
"; # The second menu for ($index=0; $index <= $#menu; $index++) { if ("" =~ /src\/$menu[$index](\/|$)/) { $menucolor = $menu_colors{$menu[$index]}; if (open (MENU, "$root_prefix$menu[$index]/menu.def")) { printf "" ."
", $menucolor; $nr = 0; while () { chomp(); next if /^\s*#/; next if /^\s*$/; print " | " if ($nr > 0); ($name,$link) = split (/:/); $selected = 0; if ($link =~ /(.*)\/$/) { $dir = $1; "" =~ /.*\/(src\/.*)$/; $wdir = $1; if (($wdir eq "src/$menu[$index]/$dir") && ("" eq "index")) { $selected = 1; } # ACHTUNG: Ist etwas unsauber, wegen foo/bar.html != bar.php3 } elsif ($link =~ /(.*)\.(html|php3)$/) { if ("" eq "$1") { $selected = 1; } } if ($selected) { printf "%s", $name; } else { printf "%s", $root_prefix, $menu[$index], $link, $name; } $nr++; } close (MENU); print "
"; } } } } :> # The color of the current 2nd menu (regardless if there is any) <: print $menucolor; :> # Local variables: # mode: indented-text # mode: auto-fill # end: