[LON-CAPA-cvs] cvs: loncom(version_2_10_X) /interface lonmenu.pm

raeburn raeburn@source.lon-capa.org
Sun, 15 May 2011 23:55:51 -0000


raeburn		Sun May 15 23:55:51 2011 EDT

  Modified files:              (Branch: version_2_10_X)
    /loncom/interface	lonmenu.pm 
  Log:
  - For 2.10, similar idea to lonmenu.pm rev 1.344 
    text for the six icons on the far right of the inline menu.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.315.2.9 loncom/interface/lonmenu.pm:1.315.2.10
--- loncom/interface/lonmenu.pm:1.315.2.9	Sat Mar  5 16:34:50 2011
+++ loncom/interface/lonmenu.pm	Sun May 15 23:55:51 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.315.2.9 2011/03/05 16:34:50 raeburn Exp $
+# $Id: lonmenu.pm,v 1.315.2.10 2011/05/15 23:55:51 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -724,6 +724,18 @@
 # We are in a course and looking at a registred URL
 # Should probably be in mydesk.tab
 #
+
+            my %icon_text;
+            if ($noremote) {
+                %icon_text = (
+                               annotate => 'Notes',
+                               bookmark => 'Bookmark',
+                               catalog  => 'Info',
+                               evaluate => 'Evaluate',
+                               feedback => 'Communicate',
+                               printout => 'Print',
+                             );
+            }
 	    $menuitems=(<<ENDMENUITEMS);
 c&3&1
 s&2&1&back.gif&backward[_1]&&gopost('/adm/flip','back:'+currentURL)&Go to the previous resource in the course sequence&&1
@@ -731,8 +743,8 @@
 c&6&3
 c&8&1
 c&8&2
-s&8&3&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document
-s&9&1&sbkm.gif&set[_1]&bookmark[_2]&set_bookmark()&Set a bookmark for this resource&&1
+s&8&3&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document&&&$icon_text{'printout'}
+s&9&1&sbkm.gif&set[_1]&bookmark[_2]&set_bookmark()&Set a bookmark for this resource&&1&$icon_text{'bookmark'}
 ENDMENUITEMS
 
 my $currentURL = &Apache::loncommon::get_symb();
@@ -745,7 +757,7 @@
 	$menuitems.="anot.gif";
 }
 $menuitems.="&anno-[_1]&tations[_1]&annotate()&";
-$menuitems.="Make notes and annotations about this resource&&1\n";
+$menuitems.="Make notes and annotations about this resource&&1&$icon_text{'annotate'}\n";
 
             unless ($noremote) { 
                 my $showreqcrs = &check_for_rcrs();
@@ -756,19 +768,23 @@
             }
             unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) {
 		if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/})) {
+                    my $tail;
+                    unless ($env{'request.state'} eq 'construct') {
+                        $tail = '&&&'.$icon_text{'catalog'};
+                    }
 		    $menuitems.=(<<ENDREALRES);
-s&6&3&catalog.gif&catalog[_2]&info[_1]&catalog_info()&Show Metadata
+s&6&3&catalog.gif&catalog[_2]&info[_1]&catalog_info()&Show Metadata$tail
 ENDREALRES
                 }
 	        $menuitems.=(<<ENDREALRES);
-s&8&1&eval.gif&evaluate[_1]&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource
-s&8&2&fdbk.gif&feedback[_1]&discuss[_1]&gopost('/adm/feedback',currentURL,1)&Provide feedback messages or contribute to the course discussion about this resource
+s&8&1&eval.gif&evaluate[_1]&this[_1]&gopost('/adm/evaluate',currentURL,1)&Provide my evaluation of this resource&&&$icon_text{'evaluate'}
+s&8&2&fdbk.gif&feedback[_1]&discuss[_1]&gopost('/adm/feedback',currentURL,1)&Provide feedback messages or contribute to the course discussion about this resource&&&$icon_text{'feedback'}
 ENDREALRES
 	    }
         }
 	if ($env{'request.uri'} =~ /^\/res/) {
 	    $menuitems .= (<<ENDMENUITEMS);
-s&8&3&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document
+s&8&3&prt.gif&prepare[_1]&printout[_1]&gopost('/adm/printout',currentURL)&Prepare a printable document&&&Print
 ENDMENUITEMS
 	}
         my $buttons='';
@@ -1194,7 +1210,7 @@
 # The javascript is usually similar to "go('/adm/roles')" or "cstrgo(..)".
 
 sub switch {
-    my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat,$nobreak)=@_;
+    my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat,$nobreak,$inlinetools)=@_;
     $act=~s/\$uname/$uname/g;
     $act=~s/\$udom/$udom/g;
     $top=&mt($top);
@@ -1204,7 +1220,9 @@
        $img=&mt($img);
     }
     my $idx=10*$row+$col;
-    $category_members{$cat}.=':'.$idx;
+    if ($cat ne '') {
+        $category_members{$cat}.=':'.$idx;
+    }
 
     unless ($env{'environment.remote'} eq 'off') {
        if (($row<1) || ($row>13)) { return ''; }
@@ -1248,9 +1266,13 @@
            if ($env{'environment.icons'} eq 'iconsonly') {
               $inlineremote[$idx]='<a title="'.$desc.'" href="javascript:'.$act.';">'.$pic.'</a>';
            } else {
+              my $icon_text = $desc;
+              if ($inlinetools) {
+                  $icon_text = $inlinetools.'&nbsp;';
+              }
 	      $inlineremote[$idx]=
 		   '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.
-		   '<span class="LC_menubuttons_inline_text">'.$desc.'</span></a>';
+		   '<span class="LC_menubuttons_inline_text">'.$icon_text.'&nbsp;</span></a>';
            }
        }
    }