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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 08 Feb 2005 00:01:33 -0000


albertel		Mon Feb  7 19:01:33 2005 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  - BUG#3904, don't pout up the remote's controls when inline and looking at a non-symbed resource in a course 
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.144 loncom/interface/lonmenu.pm:1.145
--- loncom/interface/lonmenu.pm:1.144	Mon Feb  7 18:37:45 2005
+++ loncom/interface/lonmenu.pm	Mon Feb  7 19:01:32 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.144 2005/02/07 23:37:45 albertel Exp $
+# $Id: lonmenu.pm,v 1.145 2005/02/08 00:01:32 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -156,7 +156,7 @@
 ENDNAV
 	    if (
 		($ENV{'request.noversionuri'}=~m[^/(res|public)/] &&
-		 $ENV{'request.symb'} ne '')
+		 $ENV{'request.symb'} eq '')
 		||
 		(($ENV{'request.noversionuri'}=~/^\/adm\//) &&
 		 ($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
@@ -302,7 +302,7 @@
     my $tableend=($noremote?'</table></font>':'').($textinter?'<a name="content" />':'');
 # =============================================================================
 # ============================ This is for URLs that actually can be registered
-    if (($ENV{'request.noversionuri'}!~/^\/(res\/)*adm\//) || ($forcereg)) {
+    if (($ENV{'request.noversionuri'}!~m|^/(res/)*adm/|) || ($forcereg)) {
 # -- This applies to homework problems for users with grading privileges
 	my $crs='/'.$ENV{'request.course.id'};
 	if ($ENV{'request.course.sec'}) {
@@ -311,7 +311,8 @@
 	$crs=~s/\_/\//g;
 
         my $hwkadd='';
-        if ($ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) {
+        if ($ENV{'request.symb'} ne '' &&
+	    $ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) {
 	    if (&Apache::lonnet::allowed('vgr',$crs)) {
 		$hwkadd.=&switch('','',7,1,'subm.gif','view sub-[_1]','missions[_1]',
                        "gocmd('/adm/grades','submission')",
@@ -323,7 +324,8 @@
                        'Modify user grades for this assessment resource');
             }
 	}
-	if (&Apache::lonnet::allowed('opa',$crs)) {
+	if ($ENV{'request.symb'} ne '' &&
+	    &Apache::lonnet::allowed('opa',$crs)) {
 	    $hwkadd.=&switch('','',7,3,'pparm.gif','problem[_2]','parms[_2]',
 			     "gocmd('/adm/parmset','set')",
 			     'Modify deadlines, etc, for this resource');
@@ -408,7 +410,8 @@
 s&7&2&prt.gif&prepare[_1]&printout[_1]&gocstr('/adm/printout','/~$uname/$thisdisfn')&Prepare a printable document
 ENDMENUITEMS
             }
-        } elsif (defined($ENV{'request.course.id'})) {
+        } elsif (defined($ENV{'request.course.id'}) && 
+		 $ENV{'request.symb'} ne '') {
 	    $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
@@ -437,7 +440,9 @@
                 $buttons.=&clear(@rest);
             }
         }
-        if ($textual) {
+	my $addremote=0;
+	foreach (@inlineremote) { if ($_ ne '') { $addremote=1; } }
+        if ($textual && $addremote) {
 # Registered, textual output
 	    my $inlinebuttons='';