passed in as hash references.
See htmltag() for more details.
=back
+
+returns: XHTML list as String.
-returns: XHTML list as String.
-
-=cut
+=cut
# \@items, {listattr => { class => 'abc', id => 'xyx' }, itemattr => {class => 'abc', id => 'xyx'}}
sub list_from_array {
my ($items, $args) = @_;
+ return unless (ref($items) eq 'ARRAY');
return unless scalar @$items;
my ($ul, $li) = inittags( qw(ul li) );
my $listitems = join '', map { $li->($_, $args->{itemattr}) } @$items;
@@ -2410,7 +3381,8 @@ sub generate_menu {
$$link{alttext} : $$link{linktext})
}), {
href => $$link{url},
- title => mt($$link{linktitle})
+ title => mt($$link{linktitle}),
+ class => 'LC_menubuttons_link'
}).
$a->(mt($$link{linktext}), {
href => $$link{url},
@@ -2444,7 +3416,7 @@ sub generate_menu {
=pod
-=item &start_funclist
+=item &start_funclist()
Start list of available functions
@@ -2484,7 +3456,7 @@ sub start_funclist {
=pod
-=item &add_item_funclist
+=item &add_item_funclist()
Adds an item to the list of available functions
@@ -2510,7 +3482,7 @@ sub add_item_funclist {
=pod
-=item &end_funclist
+=item &end_funclist()
End list of available functions
@@ -2531,11 +3503,11 @@ sub end_funclist {
=pod
-=item funclist_from_array( \@array, {legend => 'text for legend'} )
+=item &funclist_from_array( \@array, {legend => 'text for legend'} )
Constructs a XHTML list from \@array with the first item being visually
highlighted and set to the value of legend or 'Functions' if legend is
-empty.
+empty.
=over
@@ -2549,18 +3521,53 @@ A string that's used as visually highlig
it's value evaluates to false.
=back
-
-returns: XHTML list as string.
+
+returns: XHTML list as string.
=back
-=cut
+=cut
sub funclist_from_array {
my ($items, $args) = @_;
+ return unless(ref($items) eq 'ARRAY');
$args->{legend} ||= mt('Functions');
- return list_from_array( [$args->{legend}, @$items],
+ return list_from_array( [$args->{legend}, @$items],
{ listattr => {class => 'LC_funclist'} });
+}
+
+=pod
+
+=item &actionbox( \@array )
+
+Constructs a XHTML list from \@array with the first item being visually
+highlighted and set to the value 'Actions'. The list is wrapped in a division.
+
+The actionlist is used to offer contextual actions, mostly at the bottom
+of a page, on which the outcome of an processed action is shown,
+e.g. a file operation in Construction Space.
+
+=over
+
+=item \@array
+
+A reference to the array containing text. Details: sub funclist_from_array
+
+=back
+
+Returns: XHTML div as string.
+
+=back
+
+=cut
+
+sub actionbox {
+ my ($items) = @_;
+ return unless(ref($items) eq 'ARRAY');
+ return
+ ''
+ .&funclist_from_array($items, {legend => &mt('Actions')})
+ .'
';
}
1;