<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package Webmin::Menu;
use WebminCore;

=head2 new Webmin::Menu(&amp;options, [columns])
Generates a menu of options, typically using icons.
=cut
sub new
{
my ($self, $options, $columns) = @_;
if (defined(&amp;Webmin::Theme::Menu::new)) {
        return new Webmin::Theme::Menu(@_[1..$#_]);
        }
$self = { 'columns' =&gt; 4 };
bless($self);
$self-&gt;set_options($options);
$self-&gt;set_columns($columns) if (defined($columns));
return $self;
}

=head2 html()
Returns the HTML for the table
=cut
sub html
{
my ($self) = @_;
my (@links, @titles, @icons, @hrefs);
foreach my $o (@{$self-&gt;{'options'}}) {
	push(@links, $o-&gt;{'link'});
	if ($o-&gt;{'link2'}) {
		push(@titles, "$o-&gt;{'title'}&lt;/a&gt; &lt;a href='$o-&gt;{'link2'}'&gt;$o-&gt;{'title2'}");
		}
	else {
		push(@titles, $o-&gt;{'title'});
		}
	push(@icons, $o-&gt;{'icon'});
	push(@hrefs, $o-&gt;{'href'});
	}
my $rv = &amp;capture_function_output(\&amp;icons_table,
		\@links, \@titles, \@icons, $self-&gt;get_columns(),
		\@hrefs);
return $rv;
}

=head2 add_option(&amp;option)
=cut
sub add_option
{
my ($self, $option) = @_;
push(@{$self-&gt;{'options'}}, $option);
}

sub set_options
{
my ($self, $options) = @_;
$self-&gt;{'options'} = $options;
}

sub get_options
{
my ($self) = @_;
return $self-&gt;{'options'};
}

sub set_columns
{
my ($self, $columns) = @_;
$self-&gt;{'columns'} = $columns;
}

sub get_columns
{
my ($self) = @_;
return $self-&gt;{'columns'};
}

=head2 set_page(Webmin::Page)
Called when this menu is added to a page
=cut
sub set_page
{
my ($self, $page) = @_;
$self-&gt;{'page'} = $page;
}

1;

</pre></body></html>