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

foxr lon-capa-cvs@mail.lon-capa.org
Mon, 14 Aug 2006 09:11:58 -0000


foxr		Mon Aug 14 05:11:58 2006 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  Enable printing from resource space.. but still need to do lonprintout.pm's
  part in this.
  (BUG 4039)
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.202 loncom/interface/lonmenu.pm:1.203
--- loncom/interface/lonmenu.pm:1.202	Fri Aug  4 14:56:19 2006
+++ loncom/interface/lonmenu.pm	Mon Aug 14 05:11:55 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.202 2006/08/04 18:56:19 albertel Exp $
+# $Id: lonmenu.pm,v 1.203 2006/08/14 09:11:55 foxr Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -52,6 +52,8 @@
 
 my @inlineremote;
 
+
+
 # ================================================================ Little texts
 
 sub initlittle {
@@ -471,8 +473,8 @@
 s&7&2&prt.gif&prepare[_1]&printout[_1]&gocstr('/adm/printout','/~$uname/$cleandisfn')&Prepare a printable document
 ENDMENUITEMS
             }
-        } elsif (defined($env{'request.course.id'}) && 
-		 $env{'request.symb'} ne '') {
+        } 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
@@ -492,6 +494,12 @@
 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
+ENDMENUITEMS
+	}
+        &Apache::lonnet::logthis("Menu items:\n$menuitems\n");
         my $buttons='';
         foreach (split(/\n/,$menuitems)) {
 	    my ($command,@rest)=split(/\&/,$_);
@@ -501,6 +509,7 @@
                 $buttons.=&clear(@rest);
             }
         }
+	&Apache::lonnet::logthis("buttons = $buttons");
 
         if ($textual) {
 	    my $addremote=0;
@@ -522,6 +531,7 @@
 ENDINLINE
                 }
 	    }
+	    &Apache::lonnet::logthis("Inline:\n $inlinebuttons \n");
 	    $result =(<<ENDREGTEXT);
 <script type="text/javascript">
 // BEGIN LON-CAPA Internal