'
+ '
'
.$content
.'
'
}
@@ -4463,6 +4614,11 @@ sub bodytag {
my ($title,$function,$addentries,$bodyonly,$domain,$forcereg,
$no_nav_bar,$bgcolor,$no_inline_link,$args)=@_;
+ my $public;
+ if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public'))
+ || ($env{'user.name'} eq '') && ($env{'user.domain'} eq '')) {
+ $public = 1;
+ }
if (!$args->{'no_auto_mt_title'}) { $title = &mt($title); }
$function = &get_users_function() if (!$function);
@@ -4478,10 +4634,6 @@ sub bodytag {
'link' => &designparm($function.'.link',$domain),);
@design{keys(%$addentries)} = @$addentries{keys(%$addentries)};
- my $custommenu;
- if ($env{'environment.remote'} eq 'off') {
- $custommenu = &needs_gci_custom();
- }
# role and realm
my ($role,$realm) = split(/\./,$env{'request.role'},2);
if ($role eq 'ca') {
@@ -4491,26 +4643,14 @@ sub bodytag {
# realm
if ($env{'request.course.id'}) {
if ($env{'request.role'} !~ /^cr/) {
- if (($custommenu) && (($role eq 'cm') || ($env{'form.context'} eq 'requestcrs'))) {
- undef($role);
- } else {
- $role = &Apache::lonnet::plaintext($role,&course_type());
- }
+ $role = &Apache::lonnet::plaintext($role,&course_type());
}
- if (defined($role) && $env{'request.course.sec'}) {
+ if ($env{'request.course.sec'}) {
$role .= (' 'x2).'- '.&mt('section:').' '.$env{'request.course.sec'};
- }
- if ($env{'form.context'} eq 'requestcrs') {
- undef($realm);
- } else {
- $realm = $env{'course.'.$env{'request.course.id'}.'.description'};
- }
+ }
+ $realm = $env{'course.'.$env{'request.course.id'}.'.description'};
} else {
- if (($custommenu) && ($role eq 'cm')) {
- undef($role);
- } else {
- $role = &Apache::lonnet::plaintext($role);
- }
+ $role = &Apache::lonnet::plaintext($role);
}
if (!$realm) { $realm=' '; }
@@ -4528,12 +4668,12 @@ sub bodytag {
}
my $name = &plainname($env{'user.name'},$env{'user.domain'});
- if ($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public') {
+ if ($public) {
undef($role);
} else {
$name = &aboutmewrapper($name,$env{'user.name'},$env{'user.domain'});
}
-
+
my $titleinfo = '
'.$title.'
';
#
# Extra info if you are the DC
@@ -4549,11 +4689,11 @@ sub bodytag {
$role = '
('.$role.')' if $role;
&get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']);
- if ($env{'environment.remote'} eq 'off') {
+ if ($env{'environment.remote'} ne 'on') {
# No Remote
if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') {
- return $bodytag;
- }
+ return $bodytag;
+ }
if ($env{'request.state'} eq 'construct') { $forcereg=1; }
@@ -4561,69 +4701,7 @@ sub bodytag {
# $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls
# }
- my $role_selector;
- if (($custommenu) && !($env{'form.context'} eq 'requestcrs') &&
- ($env{'request.course.id'}) &&
- ($env{'course.'.$env{'request.course.id'}.'.domain'} eq 'gcitest')) {
- $role_selector = &Apache::lonmenu::roles_selector(
- $env{'course.' . $env{'request.course.id'} . '.domain'},
- $env{'course.' . $env{'request.course.id'} . '.num'} );
- if ($role_selector) {
- $role_selector = '
'.$role_selector;
- }
- }
- my $cid = $env{'request.course.id'};
- my %gcicourses = (
- gci_9615072b469884921gcil1 => 'review',
- gci_1H96711d710194bfegcil1 => 'submit',
- gci_5422913620b814c90gcil1 => 'tutorial',
- );
- if (($custommenu && $cid && !$gcicourses{$cid}) &&
- !($env{'form.context'} eq 'requestcrs') ||
- ($env{'user.domain'} eq 'gcitest')) {
- my $role = 'st';
- if ($custommenu) {
- $role = 'cc';
- }
- my ($switcher_js,$switcher,$formname);
- $formname = 'pickrole';
- my %courses = &existing_gcitest_courses($role);
- my $numcourses = keys(%courses);
- my $reqdcount = 0;
- if ($cid) {
- if ($courses{$cid}) {
- $reqdcount = 1;
- }
- }
- if ($numcourses > $reqdcount) {
- $switcher = &gcitest_switcher($role,$formname,%courses);
- my $current;
- if ($cid) {
- $current = $role.'./'.$env{'course.'.$cid.'.domain'}.
- '/'.$env{'course.'.$cid.'.num'};
- }
- $switcher_js = &Apache::loncommon::gcitest_switcher_js($current,$numcourses,$formname);
- if ($switcher_js) {
- $switcher_js= <<"ENDSCRIPT";
-
-ENDSCRIPT
- }
- }
- if ($switcher) {
- $switcher = $switcher_js.$switcher;
- if ($role_selector) {
- $role_selector .= ' '.$switcher;
- } else {
- $role_selector .= '
'.$switcher;
- }
- }
- }
if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) {
if ($dc_info) {
@@ -4633,19 +4711,17 @@ ENDSCRIPT
$realm $dc_info
|;
return $bodytag;
}
- if ($env{'request.noversionuri'} eq '/adm/navmaps' &&
- $env{'environment.remotenavmap'} eq 'on') {
+ if (($env{'request.noversionuri'} =~ m{^/adm/navmaps}) &&
+ ($env{'environment.remotenavmap'} eq 'on')) {
return $bodytag;
}
- if ($cid && $gcicourses{$cid} eq 'tutorial') {
- $bodytag .= '';
- }
#don't show menus for public users
- if($env{'user.name'} ne 'public' && $env{'user.domain'} ne 'public'){
- if (($custommenu) &&
- ($env{'request.role'} !~ m{^st\./gcitest/$match_courseid})) {
- $bodytag .= &Apache::lonmenu::gci_secondary_menu();
- } elsif ($env{'request.role'} ne 'cm' || &check_for_gci_dc()) {
- $bodytag .= Apache::lonmenu::secondary_menu();
- }
+ if (!$public){
+ $bodytag .= Apache::lonmenu::secondary_menu();
$bodytag .= Apache::lonmenu::serverform();
$bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
if ($env{'request.state'} eq 'construct') {
@@ -4672,28 +4740,6 @@ ENDSCRIPT
$args->{'bread_crumbs'});
} elsif ($forcereg) {
$bodytag .= &Apache::lonmenu::innerregister($forcereg);
- } elsif ($custommenu && $env{'request.course.id'} &&
- &Apache::lonnet::allowed('mdc', $env{'request.course.id'})) {
- if ((($env{'request.noversionuri'} eq '/adm/navmaps') &&
- ($env{'request.noversionuri'} ne 'on')) ||
- (($env{'request.noversionuri'} eq '/adm/coursedocs') &&
- (!($env{'form.context'} eq 'requestcrs'))) ||
- (($env{'request.noversionuri'} eq '/adm/createuser') &&
- (!($env{'form.context'} eq 'requestcrs'))) ||
- ($env{'request.noversionuri'} eq '/adm/whatsnew') ||
- ($env{'request.noversionuri'} eq '/cgi-bin/printout.pl') ||
- ($env{'request.noversionuri'} eq '/adm/printout') ||
- ($env{'request.noversionuri'} eq '/adm/statistics')) {
-
- my @advtools = &concept_test_manager();
- &Apache::lonhtmlcommon::clear_breadcrumbs();
- &Apache::lonhtmlcommon::add_breadcrumb_tool(
- 'advtools',@advtools);
- my $advlinks;
- my $legendtext = '';
- &Apache::lonhtmlcommon::render_advtools(\$advlinks,$legendtext);
- $bodytag .= $advlinks;
- }
}
}else{
# this is to seperate menu from content when there's no secondary
@@ -4739,55 +4785,9 @@ $bodytag
ENDBODY
}
-sub concept_test_manager {
- my @advtools;
- my %items = (
- docs => {
- desc => 'Edit Test',
- action => "go('/adm/coursedocs')",
- tooltip => 'Assemble or modify Concept Test'
- },
- cprv => {
- desc => 'Enrollment/Activity',
- action => "go('/adm/createuser')",
- tooltip => 'Enrollment and student activity',
- },
- new => {
- desc => "What's New?",
- action => "go('/adm/whatsnew')",
- tooltip => 'Recent events/action items in Concept Test' ,
- },
- prnt => {
- desc => 'Print Test',
- action => "go('/adm/printout');",
- tooltip => 'Prepare printable Concept Test',
- },
- chrt => {
- desc => 'Test Statistics',
- action => "go('/adm/statistics');",
- tooltip => 'Concept Test Statistics',
- },
- rcrs => {
- desc => 'Create New Test',
- action => "switchpage('createtest');",
- tooltip => 'Create new Concept Test',
- },
- );
- my @ordered = ('docs','cprv','new','prnt','chrt','rcrs');
- foreach my $item (@ordered) {
- push(@advtools,
- '');
- }
- return @advtools;
-}
-
sub dc_courseid_toggle {
my ($dc_info) = @_;
- return '