--- loncom/interface/lonmenu.pm 2003/09/25 17:52:26 1.95 +++ loncom/interface/lonmenu.pm 2003/11/11 20:27:15 1.102 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.95 2003/09/25 17:52:26 bowersj2 Exp $ +# $Id: lonmenu.pm,v 1.102 2003/11/11 20:27:15 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -66,24 +66,26 @@ sub initlittle { # ============================= This gets called at the top of the body section sub menubuttons { - &Apache::lonlocal::reroutetrans(); my $forcereg=shift; my $target =shift; my $registration=shift; my $navmaps=''; my $reloadlink=''; - my $escurl=&Apache::lonnet::escape($ENV{'REQUEST_URI'}); + my $escurl=&Apache::lonnet::escape($ENV{'request.noversionuri'}); my $escsymb=&Apache::lonnet::escape($ENV{'request.symb'}); 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'} ENDNAV - if (($ENV{'REQUEST_URI'}=~/^\/adm\//) && - ($ENV{'REQUEST_URI'}!~/^\/adm\/wrapper\//) && - ($ENV{'REQUEST_URI'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { + if (($ENV{'request.noversionuri'}=~/^\/adm\//) && + ($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) && + ($ENV{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { my $escreload=&Apache::lonnet::escape('return:'); $reloadlink=(<$lt{'ret'} @@ -114,7 +116,7 @@ ENDMAINMENU $function='admin'; } if (($ENV{'request.role'}=~/^(au|ca)/) || - ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) { + ($ENV{'request.noversionuri'}=~/^(\/priv|\~)/)) { $function='author'; } my $domain=&Apache::loncommon::determinedomain(); @@ -131,9 +133,9 @@ ENDMAINMENU $lt{'nav'} ENDNAVREM - if (($ENV{'REQUEST_URI'}=~/^\/adm\//) && - ($ENV{'REQUEST_URI'}!~/^\/adm\/wrapper\//) && - ($ENV{'REQUEST_URI'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { + if (($ENV{'request.noversionuri'}=~/^\/adm\//) && + ($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) && + ($ENV{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { my $escreload=&Apache::lonnet::escape('return:'); $reloadlink=(< @@ -149,7 +151,7 @@ ENDRELOAD - +
$lt{'main'} @@ -164,6 +166,7 @@ $navmaps LON-CAPA
+ @@ -177,11 +180,10 @@ ENDINLINEMENU # ====================================== This gets called in the header section sub registerurl { - &Apache::lonlocal::reroutetrans(); my $forcereg=shift; my $target = shift; my $result = ''; - if ($ENV{'REQUEST_URI'} eq '/res/adm/pages/menu.html') { return ''; } + if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; } my $force_title=''; if ($ENV{'request.state'} eq 'construct') { $force_title=&Apache::lonxml::display_title(); @@ -196,14 +198,16 @@ sub registerurl { ($ENV{'environment.remote'} eq 'off') || ((($ENV{'request.publicaccess'}) || (!&Apache::lonnet::is_on_map( - &Apache::lonnet::unescape($ENV{'REQUEST_URI'})))) && + &Apache::lonnet::unescape($ENV{'request.noversionuri'})))) && (!$forcereg))) { return $result. ''.$force_title; } # Graphical display after login only if ($Apache::lonxml::registered && !$forcereg) { return ''; } - $result.=&innerregister($forcereg,$target); + if ($target ne 'edit') { + $result.=&innerregister($forcereg,$target); + } return $result.$force_title; } @@ -211,11 +215,10 @@ sub registerurl { # =========== and in the body of the document sub innerregister { - &Apache::lonlocal::reroutetrans(); my $forcereg=shift; my $target = shift; my $result = ''; - if ($ENV{'REQUEST_URI'} eq '/res/adm/pages/menu.html') { return ''; } + if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; } $Apache::lonxml::registered=1; @@ -231,7 +234,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'}); @@ -252,14 +255,14 @@ 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_URI'}!~/^\/(res\/)*adm\//) || ($forcereg)) { + if (($ENV{'request.noversionuri'}!~/^\/(res\/)*adm\//) || ($forcereg)) { # -- This applies to homework problems for users with grading privileges my $hwkadd=''; if @@ -355,7 +358,7 @@ s&8&3&prt.gif&prepare&printout&gopost('/ s&9&1&sbkm.gif&set&bookmark&set_bookmark()&Set a bookmark for this resource&2 s&9&3&anot.gif&anno-&tations&annotate()&Make notes and annotations about this resource&2 ENDMENUITEMS - unless ($ENV{'REQUEST_URI'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) { + unless ($ENV{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) { $menuitems.=(<'.$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; + my $pic= + ''.$text.''; if ($nobreak==3) { $inlineremote[10*$row+$col]="\n". - ''. - ''.$text. - ''; + ''.$text. + ''. + ''.$pic.''; } elsif ($nobreak) { $inlineremote[10*$row+$col]="\n". - ''. - ''.$text. - ''; + ''. + ''.$pic. + ''.$text.''; } else { $inlineremote[10*$row+$col]="\n". - ''. - ''.$desc. - ''; + ''. + ''.$pic. + ''.$desc. + ''; } } return ''; @@ -824,7 +830,7 @@ sub footer { sub utilityfunctions { unless (($ENV{'browser.interface'} eq 'textual') || ($ENV{'environment.remote'} eq 'off')) { return ''; } - my $currenturl=$ENV{'REQUEST_URI'}; + my $currenturl=$ENV{'request.noversionuri'}; my $currentsymb=$ENV{'request.symb'}; return (<send_http_header; return OK if $r->header_only; - &Apache::lonlocal::clearreroutetrans(); - my $form=&serverform(); my $bodytag=&Apache::loncommon::bodytag('Main Menu'); my $function='student'; @@ -904,7 +908,7 @@ sub handler { $function='admin'; } if (($ENV{'request.role'}=~/^(au|ca)/) || - ($ENV{'REQUEST_URI'}=~/^(\/priv|\~)/)) { + ($ENV{'request.noversionuri'}=~/^(\/priv|\~)/)) { $function='author'; } my $domain=&Apache::loncommon::determinedomain(); @@ -926,7 +930,6 @@ $utility $bodytag ENDHEADER $r->print(''.&inlinemenu().'
'.$form); - $r->print(&Apache::lonlocal::endreroutetrans()); $r->print(''); return OK; }