--- loncom/interface/loncommon.pm 2010/11/09 00:08:06 1.925.2.17
+++ loncom/interface/loncommon.pm 2010/12/07 04:33:49 1.925.2.26
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.925.2.17 2010/11/09 00:08:06 raeburn Exp $
+# $Id: loncommon.pm,v 1.925.2.26 2010/12/07 04:33:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1980,7 +1980,7 @@ sub select_dom_form {
if ($dom ne '') {
my $domdesc;
if ($name eq 'srchdomain') {
- if ($dom eq 'gci') {
+ if ($dom =~ /^\w+ci$/) {
$domdesc = 'Faculty';
} else {
$domdesc = 'Students';
@@ -4463,6 +4463,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);
@@ -4528,7 +4533,7 @@ 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'});
@@ -4549,7 +4554,7 @@ 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;
@@ -4564,7 +4569,7 @@ sub bodytag {
my $role_selector;
if (($custommenu) && !($env{'form.context'} eq 'requestcrs') &&
($env{'request.course.id'}) &&
- ($env{'course.'.$env{'request.course.id'}.'.domain'} eq 'gcitest')) {
+ ($env{'course.'.$env{'request.course.id'}.'.domain'} =~ /^\w+citest$/)) {
$role_selector = &Apache::lonmenu::roles_selector(
$env{'course.' . $env{'request.course.id'} . '.domain'},
$env{'course.' . $env{'request.course.id'} . '.num'} );
@@ -4573,14 +4578,17 @@ sub bodytag {
}
}
my $cid = $env{'request.course.id'};
- my %gcicourses = (
- gci_9615072b469884921gcil1 => 'review',
- gci_1H96711d710194bfegcil1 => 'submit',
- gci_5422913620b814c90gcil1 => 'tutorial',
- );
- if (($custommenu && $cid && !$gcicourses{$cid}) &&
+ my %cicourses;
+ my $udom = $env{'user.domain'};
+ my %allnums = &get_faculty_cnums();
+ if (($udom ne '') && (ref($allnums{$udom}) eq 'HASH')) {
+ foreach my $key (%{$allnums{$udom}}) {
+ $cicourses{$udom.'_'.$key} = $allnums{$udom}->{$key};
+ }
+ }
+ if (($custommenu && $cid && !$cicourses{$cid}) &&
!($env{'form.context'} eq 'requestcrs') ||
- ($env{'user.domain'} eq 'gcitest')) {
+ ($env{'user.domain'} =~ /^\w+citest$/)) {
my $role = 'st';
if ($custommenu) {
$role = 'cc';
@@ -4602,7 +4610,7 @@ sub bodytag {
$current = $role.'./'.$env{'course.'.$cid.'.domain'}.
'/'.$env{'course.'.$cid.'.num'};
}
- $switcher_js = &Apache::loncommon::gcitest_switcher_js($current,$numcourses,$formname);
+ $switcher_js = &gcitest_switcher_js($current,$numcourses,$formname);
if ($switcher_js) {
$switcher_js= <<"ENDSCRIPT";