Diff for /loncom/interface/lonhtmlcommon.pm between versions 1.419 and 1.422

version 1.419, 2025/03/03 22:03:02 version 1.422, 2025/03/25 01:02:59
Line 2463  sub docs_breadcrumbs { Line 2463  sub docs_breadcrumbs {
 my @row_count;  my @row_count;
   
 sub start_pick_box {  sub start_pick_box {
     my ($css_class,$id) = @_;      my ($css_class,$id,$caption,$caption_class) = @_;
     if (defined($css_class)) {      if (defined($css_class)) {
  $css_class = 'class="'.$css_class.'"';   $css_class = 'class="'.$css_class.'"';
     } else {      } else {
Line 2477  sub start_pick_box { Line 2477  sub start_pick_box {
     my $output = <<"END";      my $output = <<"END";
  <table $css_class $table_id>   <table $css_class $table_id>
 END  END
       if (defined($caption)) {
           if (defined($caption_class)) {
               $caption_class = 'class="'.$caption_class.'"';
           } else {
               $caption_class = 'class="LC_caption"';
           }
           $output .= <<"END";
    <caption $caption_class>$caption</caption>
   END
       }
     return $output;      return $output;
 }  }
   
Line 3954  sub list_from_array { Line 3964  sub list_from_array {
 # Inputs:  # Inputs:
 # An array of following structure:  # An array of following structure:
 #   ({ categorytitle => 'Categorytitle',  #   ({ categorytitle => 'Categorytitle',
   #       listclass=>'class to use for <ul> tag for listed items in category (optional)
   #       boxclass=>'a class to use for the div which provides the box for the category (optional),
 # items => [  # items => [
 #    {  #    {
 #           linktext    => 'Text to be displayed',  #           linktext    => 'Text to be displayed',
Line 3971  sub list_from_array { Line 3983  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.  # Outputs: A scalar containing the html markup for the menu.
   
 sub generate_menu {  sub generate_menu {
     my @menu = @_;      my @menu = @_;
     # subs for specific html elements      # subs for specific html elements
     my ($h2, $div, $ul, $li, $a, $img) = inittags( qw(h2 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      my @categories; # each element represents the entire markup for a category
         
     foreach my $category (@menu) {      foreach my $category (@menu) {
Line 3999  sub generate_menu { Line 4013  sub generate_menu {
                                 src   => $src,                                  src   => $src,
                                 alt   => mt(defined($$link{alttext}) ?                                  alt   => mt(defined($$link{alttext}) ?
                                 $$link{alttext} : $$link{linktext})                                  $$link{alttext} : $$link{linktext})
                             }), {                              }).$span->(mt($$link{linktext}), {
                             href  => $$link{url},                                         class => "LC_menu_text",}), {
                             title => mt($$link{linktitle}),  
                             class => 'LC_menubuttons_link'  
                             }).  
                         $a->(mt($$link{linktext}), {  
                             href  => $$link{url},                              href  => $$link{url},
                             title => mt($$link{linktitle}),                              title => mt($$link{linktitle}),
                             class => "LC_menubuttons_link"                              class => "LC_menubuttons_link"
                             }).                              }).
                          (defined($$link{help}) ?                            (defined($$link{help}) ?
                          Apache::loncommon::help_open_topic($$link{help}) : ''),                           Apache::loncommon::help_open_topic($$link{help}) : ''),
                          {class => "LC_menubuttons_inline_text"}));                           {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 <h2>, concatenate with           # wrap categorytitle in <h2>, concatenate with 
         # joined and in <ul> tags wrapped @links          # joined and in <ul> tags wrapped @links
Line 4023  sub generate_menu { Line 4041  sub generate_menu {
         # the category won't be added if there aren't any links          # the category won't be added if there aren't any links
         push(@categories,           push(@categories, 
             $div->($h2->(mt($$category{categorytitle}), {class=>'LC_hcell LC_heading_2'}).              $div->($h2->(mt($$category{categorytitle}), {class=>'LC_hcell LC_heading_2'}).
             $ul->(join('' ,@links),  {class =>"LC_ListStyleNormal" }),              $ul->(join('' ,@links),  {class =>"$ulclass" }),
             {class=>"LC_Box LC_400Box"})) if scalar(@links);              {class=>"$boxclass LC_400Box"})) if scalar(@links);
     }      }
   
     # wrap the joined @categories in another <div> (column layout)      # wrap the joined @categories in another <div> (column layout)

Removed from v.1.419  
changed lines
  Added in v.1.422


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>