--- loncom/interface/lonmenu.pm 2004/07/23 19:09:27 1.111 +++ loncom/interface/lonmenu.pm 2004/11/13 21:07:19 1.129 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.111 2004/07/23 19:09:27 albertel Exp $ +# $Id: lonmenu.pm,v 1.129 2004/11/13 21:07:19 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,10 +39,11 @@ package Apache::lonmenu; use strict; -use Apache::lonnet; +use Apache::lonnet(); use Apache::Constants qw(:common); use Apache::lonhtmlcommon(); -use Apache::loncommon; +use Apache::loncommon(); +use Apache::lonenc(); use Apache::lonlocal; use vars qw(@desklines $readdesk); @@ -68,10 +69,14 @@ sub menubuttons { my $forcereg=shift; my $target =shift; my $registration=shift; + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['inhibitmenu']); + if ($ENV{'form.inhibitmenu'} eq 'yes') { return ''; } + my $navmaps=''; my $reloadlink=''; - my $escurl=&Apache::lonnet::escape($ENV{'request.noversionuri'}); - my $escsymb=&Apache::lonnet::escape($ENV{'request.symb'}); + my $escurl=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($ENV{'request.noversionuri'})); + my $escsymb=&Apache::lonnet::escape(&Apache::lonenc::check_encrypt($ENV{'request.symb'})); if ($ENV{'browser.interface'} eq 'textual') { # Textual display only my %lt=&initlittle(); @@ -91,13 +96,15 @@ ENDNAV ENDRELOAD } } + my $utility=&utilityfunctions(); my $output=(< + $lt{'main'} $reloadlink $navmaps
- ENDMAINMENU @@ -128,11 +135,11 @@ ENDMAINMENU my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain); # Do we have a NAV link? if ($ENV{'request.course.id'}) { - $navmaps=(< -$lt{'nav'} -ENDNAVREM - if (($ENV{'request.noversionuri'}=~/^\/adm\//) && +$lt{'nav'} +ENDNAV + if (($ENV{'request.noversionuri'}=~/^\/adm\//) && ($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) && ($ENV{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) { my $escreload=&Apache::lonnet::escape('return:'); @@ -146,9 +153,11 @@ ENDRELOAD if ($registration) { $reg=&innerregister($forcereg,$target); } + my $utility=&utilityfunctions(); return (< + @@ -158,7 +167,7 @@ ENDRELOAD $reloadlink $navmaps
- + $lt{'launch'} @@ -166,7 +175,7 @@ $navmaps
- $reg @@ -217,6 +226,9 @@ sub innerregister { my $forcereg=shift; my $target = shift; my $result = ''; + my ($uname,$thisdisfn); + my $const_space = ($ENV{'request.state'} eq 'construct'); + if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; } $Apache::lonxml::registered=1; @@ -339,7 +351,7 @@ sub innerregister { } } # Finally, turn the button on or off - if ($cfile) { + if ($cfile && !$const_space) { $editbutton=&switch ('','',6,1,'cstr.gif','edit[_1]','resource[_2]', "go('".$cfile."');","Edit this resource"); @@ -350,7 +362,21 @@ sub innerregister { ### ### # Prepare the rest of the buttons - my $menuitems=(<$inlineremote[21] $inlineremote[23] +$inlineremote[21] $inlineremote[23] $inlineremote[61]$inlineremote[62]$inlineremote[63] $inlineremote[71]$inlineremote[72]$inlineremote[73] $inlineremote[81]$inlineremote[82]$inlineremote[83] @@ -396,9 +422,8 @@ ENDREALRES ENDINLINE } $result =(< + $timesync $newmail @@ -406,7 +431,7 @@ $tablestart $inlinebuttons $tableend $form - @@ -414,10 +439,12 @@ ENDREGTEXT # Registered, graphical output } else { my $requri=(split(/\?/,$ENV{'request.noversionuri'}))[0]; - $requri=&Apache::lonnet::unescape($requri); + $requri=&Apache::lonenc::check_encrypt(&Apache::lonnet::unescape($requri)); + my $cursymb=&Apache::lonenc::check_encrypt($ENV{'request.symb'}); + my $navstatus=&get_nav_status(); $result = (< + @@ -584,11 +621,30 @@ sub maincall() { if (($ENV{'browser.interface'} eq 'textual') || ($ENV{'environment.remote'} eq 'off')) { return ''; } return(< + ENDMAINCALL } + +sub load_remote_msg { + my ($lowerurl)=@_; + + if (($ENV{'browser.interface'} eq 'textual') || + ($ENV{'environment.remote'} eq 'off')) { return ''; } + + my $esclowerurl=&Apache::lonnet::escape($lowerurl); + my $link=&mt('Continue on in Inline Menu mode', + "/adm/remote?action=collapse?url=$esclowerurl"); + return(< +
+ +
+

+

$link

+ENDREMOTEFORM +} # ================================================================= Reopen menu sub reopenmenu { @@ -623,7 +679,7 @@ var menu=window.open("/res/adm/pages/men "height=350,width=150,scrollbars=no,menubar=no,top=5,left=5,screenX=5,screenY=5"); self.name='loncapaclient'; ENDOPEN - return ''; + return ''; } @@ -796,6 +852,11 @@ sub rawconfig { if ($ENV{'request.course.fn'}) { $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc); } + } elsif ($pro =~ /^courseenv_(.*)$/) { + my $key = $1; + if ($ENV{'course.'.$ENV{'request.course.id'}.'.'.$key}) { + $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc); + } } elsif ($pro =~ /^course_(.*)$/) { # Check for permissions inside of a course if (($ENV{'request.course.id'}) && @@ -831,7 +892,11 @@ sub rawconfig { unless (($ENV{'browser.interface'} eq 'textual') || ($ENV{'environment.remote'} eq 'off')) { $output.="\nwindow.status='Synchronizing Time';swmenu.syncclock(1000*".time.");\nwindow.status='Remote Control Configured.';"; + if (&Apache::lonmsg::newmail()) { + $output.='swmenu.setstatus("you have","messages");'; + } } + return $output; } @@ -842,7 +907,7 @@ sub close { ($ENV{'environment.remote'} eq 'off')) { return ''; } my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'}; return(< + $bodytag ENDHEADER