#!/usr/bin/perl
# Show the left-side menu of Virtualmin domains, plus modules
BEGIN { push(@INC, ".."); };
use WebminCore;
&init_config();
&ReadParse();
%text = &load_language($current_theme);
%gaccess = &get_module_acl(undef, "");
# Work out what modules and categories we have
@cats = &get_visible_modules_categories();
@modules = map { @{$_->{'modules'}} } @cats;
&popup_header();
print <
EOF
# Show login
print &text('left_login', $remote_user),"
\n";
if ($gconfig{"notabs_${base_remote_user}"} == 2 ||
$gconfig{"notabs_${base_remote_user}"} == 0 && $gconfig{'notabs'} ||
@modules <= 1) {
# Show all modules in one list
foreach $minfo (@modules) {
$target = $minfo->{'noframe'} ? "_top" : "right";
print "{'dir'}/>$minfo->{'desc'}
\n";
}
}
else {
# Show all modules under categories
foreach $c (@cats) {
# Show category opener, plus modules under it
&print_category_opener(
$c->{'code'},
$in{$c->{'code'}} ? 1 : 0,
$c->{'unused'} ?
"$c->{'desc'}" :
$c->{'desc'});
$cls = $in{$c->{'code'}} ? "itemshown" : "itemhidden";
print "";
foreach my $minfo (@{$c->{'modules'}}) {
&print_category_link("$minfo->{'dir'}/",
$minfo->{'desc'},
undef,
undef,
$minfo->{'noframe'} ? "_top" : "",
);
}
print "
\n";
}
}
# Show module/help search form
if (-r "$root_directory/webmin_search.cgi" &&
$gaccess{'webminsearch'}) {
print "