4 =head2 new Webmin::Menu(&options, [columns])
5 Generates a menu of options, typically using icons.
9 my ($self, $options, $columns) = @_;
10 if (defined(&Webmin::Theme::Menu::new)) {
11 return new Webmin::Theme::Menu(@_[1..$#_]);
13 $self = { 'columns' => 4 };
15 $self->set_options($options);
16 $self->set_columns($columns) if (defined($columns));
21 Returns the HTML for the table
26 my (@links, @titles, @icons, @hrefs);
27 foreach my $o (@{$self->{'options'}}) {
28 push(@links, $o->{'link'});
30 push(@titles, "$o->{'title'}</a> <a href='$o->{'link2'}'>$o->{'title2'}");
33 push(@titles, $o->{'title'});
35 push(@icons, $o->{'icon'});
36 push(@hrefs, $o->{'href'});
38 my $rv = &capture_function_output(\&icons_table,
39 \@links, \@titles, \@icons, $self->get_columns(),
44 =head2 add_option(&option)
48 my ($self, $option) = @_;
49 push(@{$self->{'options'}}, $option);
54 my ($self, $options) = @_;
55 $self->{'options'} = $options;
61 return $self->{'options'};
66 my ($self, $columns) = @_;
67 $self->{'columns'} = $columns;
73 return $self->{'columns'};
76 =head2 set_page(Webmin::Page)
77 Called when this menu is added to a page
81 my ($self, $page) = @_;
82 $self->{'page'} = $page;