#!/usr/local/bin/perl # index_top.cgi # Display the top frame using the Caldera icons and style BEGIN { push(@INC, ".."); }; use WebminCore; &init_config(); $hostname = &get_display_hostname(); $ver = &get_webmin_version(); &ReadParse(); if ($gconfig{'real_os_type'}) { $ostr = "$gconfig{'real_os_type'} $gconfig{'real_os_version'}"; } else { $ostr = "$gconfig{'os_type'} $gconfig{'os_version'}"; } # Build a list of all modules @modules = &get_visible_module_infos(); # Work out what categories exist, and which is current %cats = &list_categories(\@modules); @cats = sort { $b cmp $a } keys %cats; $cats = @cats; $per = $cats ? 100.0 / $cats : 100; if (!defined($in{'cat'})) { # Use default category if (defined($gconfig{'deftab'})) { $in{'cat'} = $gconfig{'deftab'}; } else { $in{'cat'} = $cats[0]; } } elsif (!$cats{$in{'cat'}}) { $in{'cat'} = ""; } # Display title and categories &PrintHeader(); print <

EOF foreach $c (@cats) { if ($in{'cat'} eq $c) { print "\n"; } else { print "\n"; } } $vtext =&text('main_title', $ver, $hostname, $ostr) if (!$gconfig{'nohostname'}); if ($main::session_id) { $switch = "". "$text{'main_logout'}"; } else { $switch = "". "$text{'main_switch'}"; } print <
Home | Feedback

$cats{$c}

$cats{$c}
$vtext $switch
EOF # Display icons in this category $pos = 0; foreach $m (@modules) { next if ($m->{'category'} ne $in{'cat'}); if ($pos % 3 == 0) { print "\n"; } local $lnk = $m->{'index_link'}; local $img = -r "$theme_root_directory/$m->{'dir'}/images/icon.gif" ? "/$m->{'dir'}/images/icon.gif" : "/template.gif"; print "\n"; if ($pos++ % 3 == 2) { print "\n"; } } print <
{'dir'}/$lnk'>{'dir'}/$lnk' CLASS=bodyNav>$m->{'desc'}
EOF