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

raeburn lon-capa-cvs@mail.lon-capa.org
Tue, 30 Nov 2004 22:44:30 -0000


raeburn		Tue Nov 30 17:44:30 2004 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  Reverse a part of the changes in v.1.116. Required javascript utility functions are now included if /adm/menu is displayed with the Remote Control ON.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.131 loncom/interface/lonmenu.pm:1.132
--- loncom/interface/lonmenu.pm:1.131	Tue Nov 30 14:08:18 2004
+++ loncom/interface/lonmenu.pm	Tue Nov 30 17:44:29 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.131 2004/11/30 19:08:18 raeburn Exp $
+# $Id: lonmenu.pm,v 1.132 2004/11/30 22:44:29 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -960,8 +960,9 @@
 }
 
 sub utilityfunctions {
+    my $caller = shift;
     unless (($ENV{'browser.interface'} eq 'textual')  ||
-        ($ENV{'environment.remote'} eq 'off')) { return ''; }
+        ($ENV{'environment.remote'} eq 'off') || ($caller eq '/adm/menu')) { return ''; }
     my $currenturl=&Apache::lonenc::check_encrypt($ENV{'request.noversionuri'});
     
     my $currentsymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'});
@@ -1102,7 +1103,16 @@
     $pgbg=&Apache::loncommon::designparm($function.'.pgbg',$domain);
     $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain);
     $font=&Apache::loncommon::designparm($function.'.font',$domain);
-# ---- Print the screen, pretent to be in text mode to generate text-based menu
+    my $script_tag;
+    if ($ENV{'environment.remote'} eq 'on') {
+        my $utility=&utilityfunctions('/adm/menu');
+        $script_tag=(<<ENDSCRIPT);
+<script type="text/javascript">
+$utility
+</script>
+ENDSCRIPT
+    }
+# ---- Print the screen, pretend to be in text mode to generate text-based menu
     unless ($ENV{'browser.interface'} eq 'textual') {
 	$ENV{'browser.interface'}='faketextual';
 	$ENV{'environment.remote'}='off';
@@ -1110,6 +1120,7 @@
     $r->print(<<ENDHEADER);
 <html><head>
 <title>LON-CAPA Main Menu</title>
+$script_tag
 </head>
 $bodytag
 ENDHEADER