]> git.ipfire.org Git - ipfire-2.x.git/blob - config/cfgroot/header-menu.pl
git-svn-id: http://svn.ipfire.org/svn/ipfire/IPFire/source@16 ea5c0bd1-69bd-2848...
[ipfire-2.x.git] / config / cfgroot / header-menu.pl
1 sub genmenu
2 {
3 ... snip ...
4 if ( ! -e "${General::swroot}/proxy/enable" && ! -e "${General::swroot}/proxy/enable_blue" ) {
5 splice (@{$menu{'2.status'}{'subMenu'}}, 4, 1);
6 splice (@{$menu{'7.mainlogs'}{'subMenu'}}, 2, 1);
7 }
8
9 # Read additionnal menus entry
10 # this have to be hardened and accepted. To be extended.
11 opendir (DIR, "${General::swroot}/addon-menu");
12 while (my $menuitem = readdir (DIR)) {
13
14 if ( $menuitem =~ /^menu\.([1-6]\..*)\..*/) { #model is "menu.(N.submenu).filename"
15 my $submenu = $1;
16 open (FILE,"${General::swroot}/addon-menu/$menuitem") or die;
17 while (my $text = <FILE>) { # file may content many entry
18 splice (@{$menu{$submenu}{'subMenu'}} ,-1,0, [ eval($text) ] );
19 }
20 close (FILE);
21 }
22 }
23 closedir (DIR);
24 }