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

www lon-capa-cvs@mail.lon-capa.org
Thu, 13 Feb 2003 18:11:26 -0000


www		Thu Feb 13 13:11:26 2003 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
    /loncom/interface	loncommon.pm lonmenu.pm 
  Log:
  Steps towards server side menu for handicapper access.
  Get activated when logging in with "Accessibility Option"
  If not using that entrance, Remote should remain exactly the same pain as it
  always was.
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.51 loncom/auth/lonroles.pm:1.52
--- loncom/auth/lonroles.pm:1.51	Tue Feb  4 11:25:37 2003
+++ loncom/auth/lonroles.pm	Thu Feb 13 13:11:26 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.51 2003/02/04 16:25:37 www Exp $
+# $Id: lonroles.pm,v 1.52 2003/02/13 18:11:26 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -115,7 +115,7 @@
 	                 $r->content_type('text/html');
                          &Apache::loncommon::no_cache($r);
                          $r->send_http_header;
-                         my $swinfo=&Apache::lonmenu::rawconfig($r);
+                         my $swinfo=&Apache::lonmenu::rawconfig();
                          my $bodytag=&Apache::loncommon::bodytag('Switching Role');
                          print (<<ENDREDIR);
 <head><title>Entering Course</title>
@@ -146,10 +146,10 @@
     $r->send_http_header;
     return OK if $r->header_only;
 
-    my $swinfo=&Apache::lonmenu::rawconfig($r);
+    my $swinfo=&Apache::lonmenu::rawconfig();
     my $bodytag=&Apache::loncommon::bodytag('User Roles');
     my $helptag=&Apache::loncommon::help_open_topic
-     ("General_Intro","<font size='+1'><b>CLICK HERE FOR HELP</b></font>");
+     ("General_Intro","Click here for help");
     $r->print(<<ENDHEADER);
 <html>
 <head>
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.78 loncom/interface/loncommon.pm:1.79
--- loncom/interface/loncommon.pm:1.78	Wed Feb 12 12:57:27 2003
+++ loncom/interface/loncommon.pm	Thu Feb 13 13:11:26 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.78 2003/02/12 17:57:27 www Exp $
+# $Id: loncommon.pm,v 1.79 2003/02/13 18:11:26 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -518,6 +518,9 @@
     my ($topic, $text, $stayOnPage, $width, $height) = @_;
     $text = "" if (not defined $text);
     $stayOnPage = 0 if (not defined $stayOnPage);
+    if ($ENV{'browser.interface'} eq 'textual') {
+	$stayOnPage=1;
+    }
     $width = 350 if (not defined $width);
     $height = 400 if (not defined $height);
     my $filename = $topic;
@@ -1444,6 +1447,9 @@
 END
     if ($bodyonly) {
         return $bodytag;
+    } elsif ($ENV{'browser.interface'} eq 'textual') {
+        return $bodytag.'<h1>LON-CAPA: '.$title.
+         '</h1><a href="/adm/menu">Main Menu</a><hr />';
     } else {
         return(<<ENDBODY);
 $bodytag
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.33 loncom/interface/lonmenu.pm:1.34
--- loncom/interface/lonmenu.pm:1.33	Thu Feb 13 10:52:53 2003
+++ loncom/interface/lonmenu.pm	Thu Feb 13 13:11:26 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.33 2003/02/13 15:52:53 www Exp $
+# $Id: lonmenu.pm,v 1.34 2003/02/13 18:11:26 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -45,6 +45,9 @@
 
 sub startupremote {
     my ($lowerurl)=@_;
+    if ($ENV{'browser.interface'} eq 'textual') {
+     return ('<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url='.$lowerurl.'" />');
+    }
     my $configmenu=&rawconfig();
     return(<<ENDREMOTESTARTUP);
 <script>
@@ -84,6 +87,7 @@
 }
 
 sub maincall() {
+    if ($ENV{'browser.interface'} eq 'textual') { return ''; }
     return(<<ENDMAINCALL);
 <script>
     main();
@@ -94,6 +98,7 @@
 
 sub reopenmenu {
    my $nothing='';
+   if ($ENV{'browser.interface'} eq 'textual') { return ''; }
    my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
    if ($ENV{'browser.type'} eq 'explorer') { $nothing='javascript:void(0);'; }
    return('window.open("'.$nothing.'","'.$menuname.'","",false);');
@@ -103,6 +108,7 @@
 
 sub open {
     my $returnval='';
+    if ($ENV{'browser.interface'} eq 'textual') { return ''; }
     my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
     unless (shift eq 'unix') {
 # resizing does not work on linux because of virtual desktop sizes
@@ -124,6 +130,7 @@
 
 sub switchmenu {
     my ($row,$col,$imgsrc,$texttop,$textbot,$action,$description)=@_;
+    if ($ENV{'browser.interface'} eq 'textual') { return ''; }
     my $openwin=&openmenu();
     return(<<ENDSMENU);
 <script>
@@ -137,7 +144,9 @@
 
 sub clear {
     my ($row,$col)=@_;
-    return qq(swmenu.clearbut($row,$col););
+    unless ($ENV{'browser.interface'} eq 'textual') {
+       return qq(swmenu.clearbut($row,$col););
+   } else { return ''; }
 }
 
 # Switch acts on the javascript that is executed when a button is clicked.  
@@ -146,8 +155,14 @@
     my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc)=@_;
     $act=~s/\$uname/$uname/g;
     $act=~s/\$udom/$udom/g;
-    return "\n".
+    unless ($ENV{'browser.interface'} eq 'textual') {
+       return "\n".
  qq(swmenu.switchbutton($row,$col,"$img","$top","$bot","$act","$desc"););
+   } else {
+       my $text=$top.' '.$bot;
+       $text=~s/\- //;
+       return '<br /><a href="'.$act.'">'.$text.'</a> '.$desc;
+   }
 }
 
 sub secondlevel {
@@ -166,6 +181,7 @@
 
 sub openmenu {
     my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
+    if ($ENV{'browser.interface'} eq 'textual') { return ''; }
     if ($ENV{'browser.type'} eq 'explorer') {
        return "window.open('javascript:void(0);','".$menuname."');";
    } else {
@@ -174,7 +190,13 @@
 }
 
 sub rawconfig {
-    my $output="var swmenu=".&openmenu();
+    my $textualoverride=shift;
+    my $output='';
+    unless ($ENV{'browser.interface'} eq 'textual') {
+       $output.="var swmenu=".&openmenu();
+    } else {
+       unless ($textualoverride) { return ''; }
+    }
     my $uname=$ENV{'user.name'};
     my $udom=$ENV{'user.domain'};
     my $adv=$ENV{'user.adv'};
@@ -241,7 +263,9 @@
             }
         }
     }
-    $output.="swmenu.syncclock(1000*".time.");";
+    unless ($ENV{'browser.interface'} eq 'textual') {
+       $output.="swmenu.syncclock(1000*".time.");";
+    }
     return $output;
 }
 
@@ -274,10 +298,10 @@
     $r->send_http_header;
     return OK if $r->header_only;
 
+    my $bodytag=&Apache::loncommon::bodytag('Main Menu');
 # ------------------------------------------------------------ Print the screen
-    $r->print('<html><head><title>LON-CAPA Main Menu</title></head>');
-    $r->print('<body bgcolor="#FFFFFF">');
-    $r->print('<h1>LON-CAPA Main Menu</h1>');
+    $r->print('<html><head><title>LON-CAPA Main Menu</title></head>'.$bodytag);
+    $r->print(&rawconfig(1));
     $r->print('</body></html>');
     return OK;
 }