-
+ |
$title
-
+ |
ENDONE
return $output;
@@ -3948,6 +3964,8 @@ sub list_from_array {
# Inputs:
# An array of following structure:
# ({ categorytitle => 'Categorytitle',
+# listclass=>'class to use for tag for listed items in category (optional)
+# boxclass=>'a class to use for the div which provides the box for the category (optional),
# items => [
# {
# linktext => 'Text to be displayed',
@@ -3965,13 +3983,15 @@ sub list_from_array {
# ...
# )
#
+# if listclass is not provided, LC_ListStyleNormal will be used.
+# if box class is not provided, LC_Box will be used.
# Outputs: A scalar containing the html markup for the menu.
sub generate_menu {
my @menu = @_;
# subs for specific html elements
- my ($h3, $div, $ul, $li, $a, $img) = inittags( qw(h3 div ul li a img) );
-
+ my ($h2, $div, $ul, $li, $a, $img, $span) = inittags( qw(h2 div ul li a img span) );
+
my @categories; # each element represents the entire markup for a category
foreach my $category (@menu) {
@@ -3993,32 +4013,36 @@ sub generate_menu {
src => $src,
alt => mt(defined($$link{alttext}) ?
$$link{alttext} : $$link{linktext})
- }), {
- href => $$link{url},
- title => mt($$link{linktitle}),
- class => 'LC_menubuttons_link'
- }).
- $a->(mt($$link{linktext}), {
+ }).$span->(mt($$link{linktext}), {
+ class => "LC_menu_text",}), {
href => $$link{url},
title => mt($$link{linktitle}),
class => "LC_menubuttons_link"
}).
- (defined($$link{help}) ?
+ (defined($$link{help}) ?
Apache::loncommon::help_open_topic($$link{help}) : ''),
{class => "LC_menubuttons_inline_text"}));
}
+ my $ulclass = 'LC_ListStyleNormal';
+ if ($category->{'listclass'} ne '') {
+ $ulclass = $category->{'listclass'};
+ }
+ my $boxclass = 'LC_Box';
+ if ($category->{'boxclass'} ne '') {
+ $boxclass = $category->{'boxclass'};
+ }
- # wrap categorytitle in , concatenate with
+ # wrap categorytitle in , concatenate with
# joined and in tags wrapped @links
# and wrap everything in an enclosing and push it into
# @categories
# such that each element looks like:
- #
+ #
# the category won't be added if there aren't any links
push(@categories,
- $div->($h3->(mt($$category{categorytitle}), {class=>"LC_hcell"}).
- $ul->(join('' ,@links), {class =>"LC_ListStyleNormal" }),
- {class=>"LC_Box LC_400Box"})) if scalar(@links);
+ $div->($h2->(mt($$category{categorytitle}), {class=>'LC_hcell LC_heading_2'}).
+ $ul->(join('' ,@links), {class =>"$ulclass" }),
+ {class=>"$boxclass LC_400Box"})) if scalar(@links);
}
# wrap the joined @categories in another (column layout)
|