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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Tue, 30 Oct 2007 23:46:04 -0000


albertel		Tue Oct 30 19:46:04 2007 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  - IE doesn't like non-word characters in window names
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.229 loncom/interface/lonmenu.pm:1.230
--- loncom/interface/lonmenu.pm:1.229	Thu Oct 11 18:52:53 2007
+++ loncom/interface/lonmenu.pm	Tue Oct 30 19:46:02 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.229 2007/10/11 22:52:53 albertel Exp $
+# $Id: lonmenu.pm,v 1.230 2007/10/30 23:46:02 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -795,12 +795,19 @@
 <p>$link</p>
 ENDREMOTEFORM
 }
+
+sub get_menu_name {
+    my $hostid = $Apache::lonnet::perlvar{'lonHostID'};
+    $hostid =~ s/\W//g;
+    return 'LCmenu'.$hostid;
+}
+
 # ================================================================= Reopen menu
 
 sub reopenmenu {
    if (($env{'browser.interface'} eq 'textual') ||
        ($env{'environment.remote'} eq 'off')) { return ''; }
-   my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
+   my $menuname = &get_menu_name();
    my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
    return('window.open('.$nothing.',"'.$menuname.'","",false);');
 } 
@@ -813,7 +820,7 @@
         ($env{'environment.remote'} eq 'off')) { 
 	return '<script type="text/javascript">self.name="loncapaclient";</script>';
     }
-    my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
+    my $menuname = &get_menu_name();
     
 #    unless (shift eq 'unix') {
 # resizing does not work on linux because of virtual desktop sizes
@@ -941,7 +948,7 @@
 }
 
 sub openmenu {
-    my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
+    my $menuname = &get_menu_name();
     if (($env{'browser.interface'} eq 'textual') ||
         ($env{'environment.remote'} eq 'off')) { return ''; }
     my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
@@ -1091,7 +1098,7 @@
 sub close {
     if (($env{'browser.interface'} eq 'textual') ||
         ($env{'environment.remote'} eq 'off')) { return ''; }
-    my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
+    my $menuname = &get_menu_name();
     return(<<ENDCLOSE);
 <script type="text/javascript">
 window.status='Accessing Remote Control';