--- loncom/interface/lonhtmlcommon.pm 2008/11/11 20:12:17 1.183 +++ loncom/interface/lonhtmlcommon.pm 2008/12/01 16:33:32 1.187 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.183 2008/11/11 20:12:17 droeschl Exp $ +# $Id: lonhtmlcommon.pm,v 1.187 2008/12/01 16:33:32 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1708,6 +1708,7 @@ sub email_default_row { sub submit_row { my ($title,$cmd,$submit_text,$css_class) = @_; + $submit_text = &mt($submit_text); my $output = &row_title($title,$css_class,'LC_pick_box_submit'); $output .= qq| <br /> @@ -2019,6 +2020,8 @@ END # url => 'URL the link is pointing to, i.e. /adm/site?action=dosomething', # permission => 'Contains permissions as returned from lonnet::allowed(), # must evaluate to true in order to activate the link', +# icon => 'icon filename', +# alttext => 'alt text for the icon', # help => 'Name of the corresponding helpfile', # linktitle => 'Description of the link (used for title tag)' # }, @@ -2035,19 +2038,31 @@ END # subject to change during this project. # Don't rely on its current functionality as it might be # changed or removed. +# TODO: +# check for empty values # -------------------------- sub generate_menu { my @menu = @_; - my $menu_html = ''; + my $menu_html = qq|<div class="columnSection">|; foreach my $category (@menu) { #FIXME: insert appropriate classnames for styles when they're finished. - $menu_html .='<div class=""><h3 class="">'.$category->{'categorytitle'}.'</h3><ul class="">'; - foreach my $item (@{ $category->{items} }) { - next if (! $item->{'permission'}); - $menu_html .= '<li class="">'. - qq{<a href="$item->{'url'}" title="$item->{'linktitle'}">}. - &mt($item->{'linktext'}).'</a>'; + $menu_html .='<div class="ContentBox"> + <h3 class="">'.$category->{'categorytitle'}.'</h3> + <ul class="ListStyleNormal">'; + foreach my $item ( @{ $category->{items} } ) { + next unless $item->{'permission'}; + $menu_html .= qq|<li class=""><a href="$item->{'url'}" title="$item->{'linktitle'}">|; + if($item->{'icon'}){ + $menu_html .= qq|<img class ="noBorder" src="/res/adm/pages/$item->{'icon'}" alt="|; + if($item->{'alttext'}){ + $menu_html .= qq|$item->{'alttext'}"/></a>|; + } else { #use linktext as alt text for the icon + $menu_html .= qq|$item->{'linktext'}"/></a>|; + } + } + $menu_html .= qq|<a href="$item->{'url'}" title="$item->{'linktitle'}">|; + $menu_html .= &mt($item->{'linktext'}).'</a>'; if (exists($item->{'help'})) { $menu_html .= &Apache::loncommon::help_open_topic($item->{'help'}); } @@ -2055,6 +2070,7 @@ sub generate_menu { } $menu_html .= '</div>'; } + $menu_html .= qq|</div>|; return $menu_html; }