--- loncom/interface/lonmenu.pm 2005/02/02 19:24:45 1.143
+++ loncom/interface/lonmenu.pm 2005/03/10 15:32:03 1.151
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.143 2005/02/02 19:24:45 albertel Exp $
+# $Id: lonmenu.pm,v 1.151 2005/03/10 15:32:03 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -60,6 +60,10 @@ sub initlittle {
return &Apache::lonlocal::texthash('ret' => 'Return to Last Location',
'nav' => 'Navigate Contents',
'main' => 'Main Menu',
+ 'roles' => ($ENV{'user.adv'}?
+ 'Roles':'Courses'),
+ 'docs' => 'Course Documents',
+ 'exit' => 'Exit',
'launch' => 'Launch Remote Control');
}
@@ -72,10 +76,12 @@ sub menubuttons {
my $titletable=shift;
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['inhibitmenu']);
- if ($ENV{'form.inhibitmenu'} eq 'yes') { return ''; }
+ if (($ENV{'form.inhibitmenu'} eq 'yes') ||
+ ($ENV{'REQUEST_URI'} eq '/adm/logout')) { return ''; }
my $navmaps='';
my $reloadlink='';
+ my $docs='';
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{'request.state'} eq 'construct') {
@@ -103,7 +109,12 @@ ENDNAV
$lt{'ret'}
ENDRELOAD
}
- }
+ if (&Apache::lonnet::allowed('mdc',$ENV{'request.course.id'})) {
+ $docs=(<$lt{'docs'}
+ENDDOCS
+ }
+ }
my $form=&serverform();
my $utility=&utilityfunctions();
my $output=(<
$lt{'main'}
-$reloadlink $navmaps
+$reloadlink $navmaps $docs
+$lt{'roles'}
+$lt{'exit'}
+
@@ -154,9 +168,22 @@ ENDMAINMENU
$lt{'nav'} |
ENDNAV
- if (($ENV{'request.noversionuri'}=~/^\/adm\//) &&
- ($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
- ($ENV{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) {
+ if (&Apache::lonnet::allowed('mdc',$ENV{'request.course.id'})) {
+ $docs=(<
+$lt{'docs'}
+ENDDOCS
+ }
+ 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=(<
@@ -170,10 +197,13 @@ ENDRELOAD
}
my $form=&serverform();
my $utility=&utilityfunctions();
+ my $logo=&Apache::loncommon::lonhttpdurl("/adm/lonIcons/minilogo.gif");
return (<
// BEGIN LON-CAPA Internal
+//
@@ -182,11 +212,18 @@ $utility
$reloadlink
$navmaps
+$docs
$lt{'launch'} |
-
+$lt{'roles'}
+ |
+
+$lt{'exit'}
+ |
+
+
LON-CAPA |
$form
@@ -286,16 +323,17 @@ sub innerregister {
}
if ($ENV{'request.state'} eq 'construct') {
$newmail = $titletable;
- }
- if ($noremote) {
- $newmail.='
';
+ } else {
+ if ($noremote) {
+ $newmail.='';
+ }
}
my $timesync=($textual?'':'swmenu.syncclock(1000*'.time.');');
my $tablestart=($noremote?'':'').($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'}) {
@@ -304,7 +342,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')",
@@ -316,7 +355,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');
@@ -401,7 +441,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
@@ -470,6 +513,7 @@ 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 = (<
ENDREGTHIS
}
@@ -1161,8 +1205,10 @@ ENDSCRIPT
$ENV{'browser.interface'}='faketextual';
$ENV{'environment.remote'}='off';
}
+ my $html=&Apache::lonxml::xmlbegin();
$r->print(<
+$html
+
LON-CAPA Main Menu
$script_tag