[LON-CAPA-cvs] cvs: loncom(GCI_1) /interface lonnavmaps.pm

raeburn raeburn@source.lon-capa.org
Tue, 15 Sep 2009 00:52:39 -0000


raeburn		Tue Sep 15 00:52:39 2009 EDT

  Modified files:              (Branch: GCI_1)
    /loncom/interface	lonnavmaps.pm 
  Log:
  - lonnavmaps.pm for GCI_1 updated to 2.8.X
  - Backport 1.421, 1.422, 1.423.
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.415 loncom/interface/lonnavmaps.pm:1.415.4.1
--- loncom/interface/lonnavmaps.pm:1.415	Fri Oct 10 16:07:16 2008
+++ loncom/interface/lonnavmaps.pm	Tue Sep 15 00:52:39 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.415 2008/10/10 16:07:16 bisitz Exp $
+# $Id: lonnavmaps.pm,v 1.415.4.1 2009/09/15 00:52:39 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -236,7 +236,7 @@
         my $maxtries = $res->maxtries($part);
         my $triesString = "";
         if ($tries && $maxtries) {
-            $triesString = '<font size="-1"><i>('.&mt('[_1] of [_2] tries used',$tries,$maxtries).')</i></font>';
+            $triesString = '<font size="-1"><i>('.&mt('[_1] of [quant,_2,try,tries] used',$tries,$maxtries).')</i></font>';
             if ($maxtries > 1 && $maxtries - $tries == 1) {
                 $triesString = "<b>$triesString</b>";
             }
@@ -1182,7 +1182,7 @@
         if (!defined($navmap)) {
             $navmap = Apache::lonnavmaps::navmap->new();
 	    if (!defined($navmap)) {
-		# no londer in course
+		# no longer in course
 		return '<span class="LC_error">'.&mt('No course selected').'</span><br />
                         <a href="/adm/roles">'.&mt('Select a course').'</a><br />';
 	    }
@@ -1250,6 +1250,11 @@
         # Step 1: Check to see if we have a navmap
         if (!defined($navmap)) {
             $navmap = Apache::lonnavmaps::navmap->new();
+            if (!defined($navmap)) {
+                # no longer in course
+                return '<span class="LC_error">'.&mt('No course selected').'</span><br />
+                        <a href="/adm/roles">'.&mt('Select a course').'</a><br />';
+            }
         }
 
         # See if we're being passed a specific map
@@ -1741,7 +1746,7 @@
     $result.='}
               </script>
                    <form name="linkitems" method="post">
-                       <nobr><select name="toplink">'."\n";
+                       <span class="LC_nobreak"><select name="toplink">'."\n";
     foreach my $link (@linkorder) {
 	if (defined($linkitems->{$link})) {
 	    if ($linkitems->{$link}{'text'} ne '') {
@@ -1752,7 +1757,7 @@
     }
     $result .= '</select>&nbsp;<input type="button" name="chgnav"
                    value="Go" onClick="javascript:changeNavDisplay()" />
-                </nobr></form></td>'."\n";
+                </span></form></td>'."\n";
 	
     return $result;
 }