--- loncom/interface/lonmenu.pm 2003/11/07 23:22:21 1.98 +++ loncom/interface/lonmenu.pm 2004/06/27 16:03:57 1.108 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.98 2003/11/07 23:22:21 www Exp $ +# $Id: lonmenu.pm,v 1.108 2004/06/27 16:03:57 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,7 +43,6 @@ use Apache::lonnet; use Apache::Constants qw(:common); use Apache::lonhtmlcommon(); use Apache::loncommon; -use Apache::File; use Apache::lonlocal; use vars qw(@desklines $readdesk); @@ -76,6 +75,9 @@ sub menubuttons { if ($ENV{'browser.interface'} eq 'textual') { # Textual display only my %lt=&initlittle(); + $pgbg='#FFFFFF'; + $tabbg='#FFFFFF'; + $font='#000000'; if ($ENV{'request.course.id'}) { $navmaps=(<$lt{'nav'} @@ -148,7 +150,7 @@ ENDRELOAD - +
$lt{'main'} @@ -163,6 +165,7 @@ $navmaps LON-CAPA
+ @@ -230,7 +233,7 @@ sub innerregister { my $newmail=''; if ($noremote) { - $newmail='
'; + $newmail='
'; } if (($textual) && ($ENV{'request.symb'}) && ($ENV{'request.course.id'})) { my ($mapurl,$rid,$resurl)=&Apache::lonnet::decode_symb($ENV{'request.symb'}); @@ -251,39 +254,38 @@ sub innerregister { 'swmenu.setstatus("you have","messages");'); } if ($noremote) { - $newmail.='
'; + $newmail.='
'; } my $timesync=($textual?'':'swmenu.syncclock(1000*'.time.');'); - my $tablestart=($noremote?'':''); - my $tableend=($noremote?'
':''); + my $tablestart=($noremote?'':'').($textinter?'
'.&mt('Skip to Content').'
':''); + my $tableend=($noremote?'
':'').($textinter?'':''); # ============================================================================= # ============================ This is for URLs that actually can be registered if (($ENV{'request.noversionuri'}!~/^\/(res\/)*adm\//) || ($forcereg)) { # -- This applies to homework problems for users with grading privileges - my $hwkadd=''; - if - ($ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) { - my $crs='/'.$ENV{'request.course.id'}; - if ($ENV{'request.course.sec'}) { - $crs.='_'.$ENV{'request.course.sec'}; - } - $crs=~s/\_/\//g; + my $crs='/'.$ENV{'request.course.id'}; + if ($ENV{'request.course.sec'}) { + $crs.='_'.$ENV{'request.course.sec'}; + } + $crs=~s/\_/\//g; + my $hwkadd=''; + if ($ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) { if (&Apache::lonnet::allowed('vgr',$crs)) { - $hwkadd.=&switch('','',7,1,'subm.gif','view sub-','missions', + $hwkadd.=&switch('','',7,1,'subm.gif','view sub-[_1]','missions[_1]', "gocmd('/adm/grades','submission')", 'View user submissions for this assessment resource'); } if (&Apache::lonnet::allowed('mgr',$crs)) { - $hwkadd.=&switch('','',7,2,'pgrd.gif','problem','grades', + $hwkadd.=&switch('','',7,2,'pgrd.gif','problem[_1]','grades[_3]', "gocmd('/adm/grades','gradingmenu')", 'Modify user grades for this assessment resource'); } - if (&Apache::lonnet::allowed('opa',$crs)) { - $hwkadd.=&switch('','',7,3,'pparm.gif','problem','parms', - "gocmd('/adm/parmset','set')", - 'Modify deadlines, etc, for this assessment resource'); - } + } + if (&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'); } # -- End Homework ### @@ -334,7 +336,7 @@ sub innerregister { # Finally, turn the button on or off if ($cfile) { $editbutton=&switch - ('','',6,1,'cstr.gif','edit','resource', + ('','',6,1,'cstr.gif','edit[_1]','resource[_2]', "go('".$cfile."');","Edit this resource"); } elsif ($editbutton eq '') { $editbutton=&clear(6,1); @@ -345,20 +347,20 @@ sub innerregister { # Prepare the rest of the buttons my $menuitems=(<$inlineremote[21] $inlineremote[23] +$inlineremote[61]$inlineremote[62]$inlineremote[63] +$inlineremote[71]$inlineremote[72]$inlineremote[73] +$inlineremote[81]$inlineremote[82]$inlineremote[83] +$inlineremote[91]$inlineremote[92]$inlineremote[93] +ENDINLINE + } $result =(< // BEGIN LON-CAPA Internal @@ -429,7 +443,7 @@ var swmenu=null; swmenu.clearbut(7,3); swmenu.menucltim=swmenu.setTimeout( 'clearbut(2,1);clearbut(2,3);clearbut(8,1);clearbut(8,2);clearbut(8,3);'+ - 'clearbut(9,1);clearbut(9,2);clearbut(9,3);clearbut(6,3);clearbut(6,1)', + 'clearbut(9,1);clearbut(9,3);clearbut(6,3);clearbut(6,1)', 2000); } @@ -630,6 +644,7 @@ sub switch { $top=&mt($top); $bot=&mt($bot); $desc=&mt($desc); + $img=&mt($img); unless (($ENV{'browser.interface'} eq 'textual') || ($ENV{'environment.remote'} eq 'off')) { # Remote @@ -645,28 +660,45 @@ sub switch { ''.$text.''; } else { $inlineremote[10*$row+$col]="\n
". - ''.$desc.''; + $desc.' '.$text.''; } } else { # Inline Remote if ($nobreak==2) { return ''; } my $text=$top.' '.$bot; $text=~s/\s*\-\s*//gs; - if ($nobreak==3) { - $inlineremote[10*$row+$col]="\n". - ''. - ''.$text. - ''; - } elsif ($nobreak) { - $inlineremote[10*$row+$col]="\n". - ''. - ''.$text. - ''; + + my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'}; + if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; } + my $pic= + ''.$text.''; + if (($ENV{'browser.interface'} eq 'textual') || ($ENV{'browser.interface'} eq 'faketextual')) { +# Accessibility + if ($nobreak==3) { + $inlineremote[10*$row+$col]="\n". + ''.$text. + ''. + ''.$pic.''; + } elsif ($nobreak) { + $inlineremote[10*$row+$col]="\n". + ''. + ''.$pic. + ''.$text.''; + } else { + $inlineremote[10*$row+$col]="\n". + ''. + ''.$pic. + ''.$desc. + ''; + } } else { - $inlineremote[10*$row+$col]="\n". - ''. - ''.$desc. - ''; +# Inline Menu + $inlineremote[10*$row+$col]= + ''.$pic. + ''.$desc. + ''; } } return ''; @@ -862,11 +894,11 @@ function gocmd(url,cmd) { } function catalog_info() { - loncatinfo=window.open(window.location.pathname+'.meta',"LONcatInfo",'height=320,width=280,resizeable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'); + loncatinfo=window.open(window.location.pathname+'.meta',"LONcatInfo",'height=320,width=280,resizable=yes,scrollbars=yes,location=no,menubar=no,toolbar=no'); } function chat_win() { - lonchat=window.open('/res/adm/pages/chatroom.html',"LONchat",'height=320,width=280,resizeable=yes,location=no,menubar=no,toolbar=no'); + lonchat=window.open('/res/adm/pages/chatroom.html',"LONchat",'height=320,width=280,resizable=yes,location=no,menubar=no,toolbar=no'); } ENDUTILITY } @@ -909,7 +941,8 @@ sub handler { $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 - unless ($ENV{'brower.interface'} eq 'textual') { + unless ($ENV{'browser.interface'} eq 'textual') { + $ENV{'browser.interface'}='faketextual'; $ENV{'environment.remote'}='off'; } my $utility=&utilityfunctions(); @@ -932,15 +965,17 @@ ENDHEADER BEGIN { if (! defined($readdesk)) { { - my $config=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}. - '/mydesk.tab'); - while (my $configline=<$config>) { - $configline=(split(/\#/,$configline))[0]; - $configline=~s/^\s+//; - chomp($configline); - if ($configline) { - $desklines[$#desklines+1]=$configline; - } + my $tabfile = $Apache::lonnet::perlvar{'lonTabDir'}.'/mydesk.tab'; + if ( CORE::open( my $config,"<$tabfile") ) { + while (my $configline=<$config>) { + $configline=(split(/\#/,$configline))[0]; + $configline=~s/^\s+//; + chomp($configline); + if ($configline) { + $desklines[$#desklines+1]=$configline; + } + } + CORE::close($config); } } $readdesk='done';