[LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm

droeschl droeschl@source.lon-capa.org
Mon, 01 Dec 2008 16:33:33 -0000


droeschl		Mon Dec  1 16:33:33 2008 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  Some coding on generate_menu.
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.186 loncom/interface/lonhtmlcommon.pm:1.187
--- loncom/interface/lonhtmlcommon.pm:1.186	Wed Nov 26 23:20:56 2008
+++ loncom/interface/lonhtmlcommon.pm	Mon Dec  1 16:33:32 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.186 2008/11/26 23:20:56 droeschl Exp $
+# $Id: lonhtmlcommon.pm,v 1.187 2008/12/01 16:33:32 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2044,22 +2044,24 @@
 
 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="DivContentBox"><h3 class="">'.$category->{'categorytitle'}.'</h3><ul class="ListStyleNormal">';
-	foreach my $item (@{ $category->{items} }) {
-	    next if (! $item->{'permission'});
-	    $menu_html .= '<li class="">'.
-			    qq{<a href="$item->{'url'}" title="$item->{'linktitle'}">};
+	$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 = "" src="/res/adm/pages/$item->{'icon'}" alt="};
+                $menu_html .= qq|<img class ="noBorder" src="/res/adm/pages/$item->{'icon'}" alt="|;
 		if($item->{'alttext'}){
-		    $menu_html .= qq{$item->{'alttext'}"/>};
+		    $menu_html .= qq|$item->{'alttext'}"/></a>|;
 		} else { #use linktext as alt text for the icon
-		    $menu_html .= qq{$item->{'linktext'}"/>};
+		    $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'});
@@ -2068,6 +2070,7 @@
 	}
 	$menu_html .= '</div>';
     }
+    $menu_html .= qq|</div>|;
     return $menu_html;
 }