--- loncom/interface/lonmenu.pm 2004/12/07 23:59:52 1.140 +++ loncom/interface/lonmenu.pm 2005/02/18 21:23:12 1.148 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.140 2004/12/07 23:59:52 albertel Exp $ +# $Id: lonmenu.pm,v 1.148 2005/02/18 21:23:12 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -108,8 +108,9 @@ ENDRELOAD my $utility=&utilityfunctions(); my $output=(< -// BEGIN LON-CAPA Internal + $lt{'main'} $reloadlink $navmaps
@@ -145,13 +146,25 @@ ENDMAINMENU my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain); # Do we have a NAV link? if ($ENV{'request.course.id'}) { - $navmaps=(< -$lt{'nav'} +$lt{'nav'} ENDNAV - if (($ENV{'request.noversionuri'}=~/^\/adm\//) && - ($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) && - ($ENV{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { + if ( + ($ENV{'request.noversionuri'}=~m[^/(res|public)/] && + $ENV{'request.symb'} eq '') + || + (($ENV{'request.noversionuri'}=~/^\/adm\//) && + ($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) && + ($ENV{'request.noversionuri'}!~ + m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)]) + ) + ) { my $escreload=&Apache::lonnet::escape('return:'); $reloadlink=(< @@ -165,10 +178,12 @@ ENDRELOAD } my $form=&serverform(); my $utility=&utilityfunctions(); + my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif"); return (< -// BEGIN LON-CAPA Internal + @@ -181,7 +196,7 @@ $navmaps $lt{'launch'} $form @@ -290,7 +305,7 @@ sub innerregister { my $tableend=($noremote?'
- + LON-CAPA
':'').($textinter?'':''); # ============================================================================= # ============================ This is for URLs that actually can be registered - if (($ENV{'request.noversionuri'}!~/^\/(res\/)*adm\//) || ($forcereg)) { + if (($ENV{'request.noversionuri'}!~m|^/(res/)*adm/|) || ($forcereg)) { # -- This applies to homework problems for users with grading privileges my $crs='/'.$ENV{'request.course.id'}; if ($ENV{'request.course.sec'}) { @@ -299,7 +314,8 @@ sub innerregister { $crs=~s/\_/\//g; my $hwkadd=''; - if ($ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) { + if ($ENV{'request.symb'} ne '' && + $ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) { if (&Apache::lonnet::allowed('vgr',$crs)) { $hwkadd.=&switch('','',7,1,'subm.gif','view sub-[_1]','missions[_1]', "gocmd('/adm/grades','submission')", @@ -311,7 +327,8 @@ sub innerregister { 'Modify user grades for this assessment resource'); } } - if (&Apache::lonnet::allowed('opa',$crs)) { + if ($ENV{'request.symb'} ne '' && + &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'); @@ -396,7 +413,8 @@ s&7&1&del.gif&delete[_1]&resource[_2]&go s&7&2&prt.gif&prepare[_1]&printout[_1]&gocstr('/adm/printout','/~$uname/$thisdisfn')&Prepare a printable document ENDMENUITEMS } - } elsif (defined($ENV{'request.course.id'})) { + } elsif (defined($ENV{'request.course.id'}) && + $ENV{'request.symb'} ne '') { $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 + } } - if ($const_space && $is_const_dir) { - $inlinebuttons = ''; - } $result =(< // BEGIN LON-CAPA Internal @@ -465,11 +485,12 @@ ENDREGTEXT my $cursymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'}); my $navstatus=&get_nav_status(); my $clearcstr; + if ($ENV{'user.adv'}) { $clearcstr='clearbut(6,1)'; } $result = (< -// BEGIN LON-CAPA Internal +// ENDREGTHIS } @@ -974,7 +995,8 @@ sub utilityfunctions { my $caller = shift; unless (($ENV{'browser.interface'} eq 'textual') || ($ENV{'environment.remote'} eq 'off') || ($caller eq '/adm/menu')) { return ''; } - my $currenturl=&Apache::lonenc::check_encrypt($ENV{'request.noversionuri'}); + my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$ENV{'request.noversionuri'}))[0])); + $currenturl=&Apache::lonenc::check_encrypt(&Apache::lonnet::unescape($currenturl)); my $currentsymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'}); my $nav_control=&nav_control_js(); @@ -1142,7 +1164,7 @@ sub handler { $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain); $font=&Apache::loncommon::designparm($function.'.font',$domain); my $script_tag; - if ($ENV{'environment.remote'} eq 'on') { + if ($ENV{'environment.remote'} ne 'off') { my $utility=&utilityfunctions('/adm/menu'); $script_tag=(< @@ -1155,8 +1177,10 @@ ENDSCRIPT $ENV{'browser.interface'}='faketextual'; $ENV{'environment.remote'}='off'; } + my $html=&Apache::lonxml::xmlbegin(); $r->print(< +$html + LON-CAPA Main Menu $script_tag