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

droeschl lon-capa-cvs-allow@mail.lon-capa.org
Fri, 21 Nov 2008 15:22:04 -0000


droeschl		Fri Nov 21 15:22:04 2008 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  Changes related to LON-CAPA redesign project.
  
  Modified sub generate_menu to reflect the changes regarding menu style. 
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.183 loncom/interface/lonhtmlcommon.pm:1.184
--- loncom/interface/lonhtmlcommon.pm:1.183	Tue Nov 11 20:12:17 2008
+++ loncom/interface/lonhtmlcommon.pm	Fri Nov 21 15:22:04 2008
@@ -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.184 2008/11/21 15:22:04 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2019,6 +2019,7 @@
 #			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',
 #			help	    =>	'Name of the corresponding helpfile',
 #			linktitle   =>	'Description of the link (used for title tag)'
 #		    },
@@ -2035,6 +2036,10 @@
 # subject to change during this project.
 # Don't rely on its current functionality as it might be 
 # changed or removed.
+# TODO:
+# add icon field
+# add alt tag for icon
+# check for empty values
 # --------------------------
 
 sub generate_menu {
@@ -2042,15 +2047,18 @@
     my $menu_html = '';
 
     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="">';
+	$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'}">}.
-			    &mt($item->{'linktext'}).'</a>';
-	    if (exists($item->{'help'})) {
-		$menu_html .= &Apache::loncommon::help_open_topic($item->{'help'});
-	    }
+			    qq{<a href="$item->{'url'}" title="$item->{'linktitle'}">};
+            if($item->{'icon'}){
+                $menu_html .= qq{<img class = "" src="/res/adm/pages/$item->{'icon'}" alt=""/>} 
+            }
+            $menu_html .= &mt($item->{'linktext'}).'</a>';
+#	    if (exists($item->{'help'})) {
+#		$menu_html .= &Apache::loncommon::help_open_topic($item->{'help'});
+#	    }
 	    $menu_html .= '</li>';
 	}
 	$menu_html .= '</div>';