--- loncom/interface/lonmenu.pm 2004/11/11 20:05:56 1.126 +++ loncom/interface/lonmenu.pm 2004/11/14 07:32:20 1.130 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.126 2004/11/11 20:05:56 albertel Exp $ +# $Id: lonmenu.pm,v 1.130 2004/11/14 07:32:20 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,6 +43,7 @@ use Apache::lonnet(); use Apache::Constants qw(:common); use Apache::lonhtmlcommon(); use Apache::loncommon(); +use Apache::lonenc(); use Apache::lonlocal; use vars qw(@desklines $readdesk); @@ -95,17 +96,19 @@ ENDNAV ENDRELOAD } } + my $form=&serverform(); my $utility=&utilityfunctions(); my $output=(< + $lt{'main'} $reloadlink $navmaps
- +$form ENDMAINMENU if ($registration) { $output.=&innerregister($forcereg,$target); } return $output."
"; @@ -136,7 +139,7 @@ ENDMAINMENU if ($ENV{'request.course.id'}) { $navmaps=(< -$lt{'nav'} +$lt{'nav'} ENDNAV if (($ENV{'request.noversionuri'}=~/^\/adm\//) && ($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) && @@ -152,9 +155,10 @@ ENDRELOAD if ($registration) { $reg=&innerregister($forcereg,$target); } + my $form=&serverform(); my $utility=&utilityfunctions(); return (< + @@ -166,15 +170,16 @@ $utility $reloadlink $navmaps - + $lt{'launch'} LON-CAPA +$form - $reg @@ -226,12 +231,7 @@ sub innerregister { my $target = shift; my $result = ''; my ($uname,$thisdisfn); - my $const_space = 0; - if ($ENV{'request.filename'} =~ /^\/home\/([^\/]+)\/public_html\/(.*)/) { - $const_space = 1; - $uname = $1; - $thisdisfn = $2; - } + my $const_space = ($ENV{'request.state'} eq 'construct'); if ($ENV{'request.noversionuri'} eq '/res/adm/pages/menu.html') { return ''; } @@ -251,38 +251,6 @@ sub innerregister { if ($noremote) { $newmail=' - - -
'; } - if ($textual && $const_space) { - my $formaction='/priv/'.$uname.'/'.$thisdisfn; - $formaction=~s/\/+/\//g; - my $titleinfo = '
'. - &Apache::lonhtmlcommon::crumbs($uname.'/'.$thisdisfn,'_top','/priv','','-1'). - &Apache::lonhtmlcommon::select_recent('construct','recent', - 'this.form.action=this.form.recent.value;this.form.submit()'). - '
'; - &Apache::lonhtmlcommon::store_recent('construct',$formaction,$formaction); - $newmail .= &constspaceform(); -# role and realm - my ($role,$realm) = &Apache::lonnet::plaintext((split(/\./,$ENV{'request.role'}))[0]); - unless ($realm) { $realm=' '; } - $newmail .= < -
-$titleinfo - - - $ENV{'environment.firstname'} - $ENV{'environment.middlename'} - $ENV{'environment.lastname'} - $ENV{'environment.generation'} -  
- $role  -
-END - } if (($textual) && ($ENV{'request.symb'}) && ($ENV{'request.course.id'})) { my ($mapurl,$rid,$resurl)=&Apache::lonnet::decode_symb($ENV{'request.symb'}); $newmail.=$ENV{'course.'.$ENV{'request.course.id'}.'.description'}; @@ -400,6 +368,8 @@ END # Prepare the rest of the buttons my $menuitems; if ($const_space) { + my ($uname,$thisdisfn) = + ($ENV{'request.filename'}=~m|^/home/([^/]+)/public_html/(.*)|); my $currdir = '/priv/'.$uname.'/'.$thisdisfn; $currdir =~ s#[^/]+$##; $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] @@ -456,7 +425,7 @@ ENDREALRES ENDINLINE } $result =(< + $timesync @@ -464,8 +433,7 @@ $newmail $tablestart $inlinebuttons $tableend -$form - @@ -478,7 +446,7 @@ ENDREGTEXT my $navstatus=&get_nav_status(); $result = (< + @@ -655,7 +623,7 @@ sub maincall() { if (($ENV{'browser.interface'} eq 'textual') || ($ENV{'environment.remote'} eq 'off')) { return ''; } return(< + ENDMAINCALL @@ -713,7 +681,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 ''; } @@ -941,7 +909,7 @@ sub close { ($ENV{'environment.remote'} eq 'off')) { return ''; } my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'}; return(< +