mirror of
https://github.com/webmin/webmin.git
synced 2026-06-20 11:20:30 +01:00
Function to list themes that can be used
This commit is contained in:
@@ -160,6 +160,28 @@ closedir(DIR);
|
||||
return @rv;
|
||||
}
|
||||
|
||||
=head2 list_visible_themes([current-theme])
|
||||
|
||||
Lists all themes the user should be able to use, possibly including their
|
||||
current theme if one is set.
|
||||
|
||||
=cut
|
||||
sub list_visible_themes
|
||||
{
|
||||
my ($curr) = @_;
|
||||
my @rv;
|
||||
my %done;
|
||||
foreach my $theme (&list_themes()) {
|
||||
my $iscurr = $curr && $theme->{'dir'} eq $curr;
|
||||
next if (-l $root_directory."/".$theme->{'dir'} &&
|
||||
$theme->{'dir'} =~ /\d+$/ &&
|
||||
!$iscurr);
|
||||
next if ($done{$theme->{'desc'}}++ && !$iscurr);
|
||||
push(@rv, $theme);
|
||||
}
|
||||
return @rv;
|
||||
}
|
||||
|
||||
=head2 list_modules
|
||||
|
||||
Returns a list of all usermin modules installed and supported on this system.
|
||||
|
||||
Reference in New Issue
Block a user