X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fhtml%2Fthemes%2Fipfire%2Finclude%2Ffunctions.pl;h=0c47cd456bbee33e732d848e2601304e22f133a8;hp=4d17594a47bfeb3f7d5913435b02fa9d65591b92;hb=2b6c5f257980b0f9e4d31f26ac1945092a45df6a;hpb=8ed76a233c2bc1ed31705be07d2eb2298c17f98b diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl index 4d17594a4..0c47cd456 100644 --- a/html/html/themes/ipfire/include/functions.pl +++ b/html/html/themes/ipfire/include/functions.pl @@ -18,393 +18,243 @@ # along with this program. If not, see . # # # ############################################################################### +# # +# Theme file for IPfire (based on ipfire theme) # +# Author kay-michael köhler kmk # +# # +# Version 1.0 March, 6th 2013 # +############################################################################### +# # +# Modyfied theme by a.marx@ipfire.org January 2014 # +# # +# Cleanup code, deleted unused code and rewrote the rest to get a new working # +# IPFire default theme. # +############################################################################### -sub showmenu() { - print < -
    -EOF -; - foreach my $k1 ( sort keys %$menu ) { - if (! $menu->{$k1}{'enabled'}) { - next; - } - my $link = getlink($menu->{$k1}); - if ($link eq '') { - next; - } - if (! is_menu_visible($link)) { - next; - } - if ($menu->{$k1}->{'selected'}) { - print "
  • $menu->{$k1}{'caption'}
  • "; - } else { - print "
  • $menu->{$k1}{'caption'}
  • "; - } - } - print < - -EOF -; -} +require "${General::swroot}/lang.pl"; -sub getselected($) { - my $root = shift; - if (!$root) { - return 0; - } - - foreach my $item (%$root) { - if ($root->{$item}{'selected'}) { - return $root->{$item}; - } - } +############################################################################### +# +# print menu html elements for submenu entries +# @param submenu entries +sub showsubmenu() { + my $submenus = shift; + + print "
      "; + foreach my $item (sort keys %$submenus) { + $link = getlink($submenus->{$item}); + next if (!is_menu_visible($link) or $link eq ''); + + my $subsubmenus = $submenus->{$item}->{'subMenu'}; + + if ($subsubmenus) { + print '
    • '; + } else { + print '
    • '; + } + print ''.$submenus->{$item}->{'caption'}.''; + + &showsubmenu($subsubmenus) if ($subsubmenus); + print '
    • '; + } + print "
    " } -sub showsubsection($$) { - my $root = shift; - - if (! $root) { - return; - } - my $selected = getselected($root); - if (! $selected) { - return; - } - my $submenus = $selected->{'subMenu'}; - if (! $submenus) { - return; - } - - print <Sidemenu -