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

raeburn raeburn@source.lon-capa.org
Mon, 30 Aug 2010 02:55:17 -0000


raeburn		Mon Aug 30 02:55:17 2010 EDT

  Modified files:              
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  - Prevent requests for /res/adm/pages/ in cases where menu items passed to
    generate_menu() do not have associated icons (e.g., domainstatus.pm).
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.282 loncom/interface/lonhtmlcommon.pm:1.283
--- loncom/interface/lonhtmlcommon.pm:1.282	Sun Aug  8 02:00:38 2010
+++ loncom/interface/lonhtmlcommon.pm	Mon Aug 30 02:55:17 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.282 2010/08/08 02:00:38 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.283 2010/08/30 02:55:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2475,11 +2475,15 @@
             # create the markup for the current $link and push it into @links.
             # each entry consists of an image and a text optionally followed 
             # by a help link.
+            my $src;
+            if ($$link{icon} ne '') {
+                $src = '/res/adm/pages/'.$$link{icon};
+            }
             push(@links,$li->(
                         $a->(
                             $img->("", {
                                 class => "LC_noBorder LC_middle",
-                                src   => "/res/adm/pages/$$link{icon}",
+                                src   => $src,
                                 alt   => mt(defined($$link{alttext}) ?
                                 $$link{alttext} : $$link{linktext})
                             }), {