Adjusted the graph heights
[infodrom.org/lists.infodrom.org] / Styles / menu.style
1 # File imported from www.infodrom.org/Styles/
2
3 <:
4
5   # First the menu definition
6   #
7   @menu = ('Infodrom','Linux','Debian','linx','text','service','zeitungen','News','projects');
8   %menu_name = (
9                 'Infodrom'  => 'Infodrom',
10                 'Linux'     => 'Linux',
11                 'Debian'    => 'Debian',
12                 'linx'      => 'Linx',
13                 'text'     => 'Texte',
14                 'service'   => 'Service',
15                 'zeitungen' => 'Zeitungen',
16                 'News'      => 'News',
17                 'projects'  => 'Projekte',
18                 );
19 # Noch frei: #ba55d3 (dunkelviolett), dann aber die beiden Grüntöne tauschen
20   %menu_colors = (
21                   'Infodrom'  => '0000ff',
22                   'Linux'     => '00bdff',
23                   'Debian'    => 'ff4040',
24 #                 'linx'      => 'ff7f00',
25 #                 'linx'      => 'f6be00',
26 #                 'linx'      => 'f6d629',
27 #                 'linx'      => 'f9bd09',
28                   'linx'      => 'ff8c00',
29 #                 'text'      => 'ffd700',
30                   'text'      => 'ffc125',
31                   'service'   => 'ff00ff',
32                   'zeitungen' => 'ab82ff',
33 #                 'News'      => '32cd05',
34 #                 'projects'  => '3cb371',
35 #                 'News'      => '00ee00',
36 #                 'projects'  => '66cd00',
37                   'News'      => '32cd05',
38 #                 'projects'  => '19c100',
39                   'projects'  => '20b705',
40                   );
41
42
43 sub main_menu
44 {
45   $menucolor = "008dfd"; # Default: <menu-fgcolor> - Infodrom-Blau
46
47   # The main menu
48   print "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" summary=\"\"><tr>";
49   for ($index=0; $index <= $#menu; $index++) {
50     print "<td width=\"1\"> </td>" if ($index > 0);
51     if (("<get-var WML_SRC_DIRNAME>" =~ /src\/$menu[$index]$/) && ("<get-var WML_SRC_BASENAME>" eq "index")) {
52       printf "<td align=\"center\" valign=\"top\" bgcolor=\"#%s\">"
53             ."<font color=\"#ffffff\" face=\"Helvetica,Arial\"><b>%s</b></font></td>",
54              $menu_colors{$menu[$index]},
55              $menu_name{$menu[$index]};
56     } else {
57       printf "<td align=\"center\" valign=\"top\" bgcolor=\"#%s\"><a href=\"http://www.infodrom.org/%s/\" target=\"_top\">"
58             ."<font color=\"#ffffff\" face=\"Helvetica,Arial\"><b>%s</b></font></a></td>",
59              $menu_colors{$menu[$index]},
60              $menu[$index],
61              $menu_name{$menu[$index]};
62     }
63   } 
64   print "</tr></table>";
65
66   # The second menu
67   for ($index=0; $index <= $#menu; $index++) {
68     if ("<get-var WML_SRC_DIRNAME>" =~ /src\/$menu[$index](\/|$)/) {
69       $menucolor = $menu_colors{$menu[$index]};
70       if (open (MENU, "$root_prefix$menu[$index]/menu.def")) {
71         printf "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\" summary=\"\">"
72               ."<tr bgcolor=\"#%s\"><td align=\"center\" valign=\"top\">", $menucolor;
73         $nr = 0;
74         while (<MENU>) {
75           chomp();
76           next if /^\s*#/;
77           next if /^\s*$/;
78           print " <font color=\"#ffffff\" face=\"Helvetica,Arial\"><b>|</b></font> " if ($nr > 0);
79           ($name,$link) = split (/:/);
80           $selected = 0;
81           if ($link =~ /(.*)\/$/) {
82             $dir = $1;
83             "<get-var WML_SRC_DIRNAME>" =~ /.*\/(src\/.*)$/; $wdir = $1;
84             if (($wdir eq "src/$menu[$index]/$dir") && ("<get-var WML_SRC_BASENAME>" eq "index")) {
85               $selected = 1;
86             }
87           # ACHTUNG: Ist etwas unsauber, wegen foo/bar.html != bar.php3
88           } elsif ($link =~ /(.*)\.(html|php3)$/) {
89             if ("<get-var WML_SRC_BASENAME>" eq "$1") {
90               $selected = 1;
91             }
92           }
93
94           if ($selected) {
95             printf "<font size=\"-1\" color=\"#ffffff\" face=\"Helvetica,Arial\"><b>%s</b></font>", $name;
96           } else {
97             printf "<a href=\"%s%s/%s\" target=\"_top\"><font size=\"-1\" color=\"#ffffff\" face=\"Helvetica,Arial\"><b>%s</b></font></a>",
98                    $root_prefix, $menu[$index], $link, $name;
99           }
100           $nr++;
101         }
102         close (MENU);
103         print "</td></tr></table>";
104       }
105     }
106   }
107
108 }
109
110 :>
111
112 # The color of the current 2nd menu (regardless if there is any)
113 <define-tag menucolor><: print $menucolor; :></define-tag>
114
115 # Local variables:
116 # mode: indented-text
117 # mode: auto-fill
118 # end: