version 1.925.2.1, 2009/12/07 17:11:49
|
version 1.925.2.7, 2010/01/06 22:53:58
|
Line 4467 sub bodytag {
|
Line 4467 sub bodytag {
|
'link' => &designparm($function.'.link',$domain),); |
'link' => &designparm($function.'.link',$domain),); |
@design{keys(%$addentries)} = @$addentries{keys(%$addentries)}; |
@design{keys(%$addentries)} = @$addentries{keys(%$addentries)}; |
|
|
|
my $custommenu; |
|
if ($env{'environment.remote'} eq 'off') { |
|
$custommenu = &needs_gci_custom(); |
|
} |
# role and realm |
# role and realm |
my ($role,$realm) = split(/\./,$env{'request.role'},2); |
my ($role,$realm) = split(/\./,$env{'request.role'},2); |
if ($role eq 'ca') { |
if ($role eq 'ca') { |
Line 4476 sub bodytag {
|
Line 4480 sub bodytag {
|
# realm |
# realm |
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
if ($env{'request.role'} !~ /^cr/) { |
if ($env{'request.role'} !~ /^cr/) { |
$role = &Apache::lonnet::plaintext($role,&course_type()); |
if (($custommenu) && ($role eq 'cm')) { |
|
undef($role); |
|
} else { |
|
$role = &Apache::lonnet::plaintext($role,&course_type()); |
|
} |
} |
} |
if ($env{'request.course.sec'}) { |
if ($env{'request.course.sec'}) { |
$role .= (' 'x2).'- '.&mt('section:').' '.$env{'request.course.sec'}; |
$role .= (' 'x2).'- '.&mt('section:').' '.$env{'request.course.sec'}; |
} |
} |
$realm = $env{'course.'.$env{'request.course.id'}.'.description'}; |
$realm = $env{'course.'.$env{'request.course.id'}.'.description'}; |
} else { |
} else { |
$role = &Apache::lonnet::plaintext($role); |
if (($custommenu) && ($role eq 'cm')) { |
|
undef($role); |
|
} else { |
|
$role = &Apache::lonnet::plaintext($role); |
|
} |
} |
} |
|
|
if (!$realm) { $realm=' '; } |
if (!$realm) { $realm=' '; } |
Line 4534 sub bodytag {
|
Line 4546 sub bodytag {
|
# $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls |
# $titleinfo = &CSTR_pageheader(); #FIXME: Will be removed once all scripts have their own calls |
# } |
# } |
|
|
|
my $role_selector; |
|
if (($custommenu) && ($env{'request.course.id'}) && |
|
($env{'course.'.$env{'request.course.id'}.'.domain'} eq 'gcitest') && |
|
($env{'request.role'} !~ m{^st\./gcitest/$match_courseid})) { |
|
$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 = '<br />'.$role_selector; |
|
} |
|
} |
|
|
if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { |
if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) { |
if ($dc_info) { |
if ($dc_info) { |
Line 4545 sub bodytag {
|
Line 4567 sub bodytag {
|
return $bodytag; |
return $bodytag; |
} |
} |
|
|
$bodytag .= qq|<div id="LC_nav_bar">$name $role</div>|; |
$bodytag .= qq|<div id="LC_nav_bar">$name $role $role_selector</div>|; |
|
|
$bodytag .= Apache::lonhtmlcommon::scripttag( |
$bodytag .= Apache::lonhtmlcommon::scripttag( |
Apache::lonmenu::utilityfunctions(), 'start'); |
Apache::lonmenu::utilityfunctions('',$custommenu), 'start'); |
|
|
$bodytag .= Apache::lonmenu::primary_menu(); |
$bodytag .= Apache::lonmenu::primary_menu(); |
|
|
Line 4559 sub bodytag {
|
Line 4581 sub bodytag {
|
|
|
#don't show menus for public users |
#don't show menus for public users |
if($env{'user.name'} ne 'public' && $env{'user.domain'} ne 'public'){ |
if($env{'user.name'} ne 'public' && $env{'user.domain'} ne 'public'){ |
$bodytag .= Apache::lonmenu::secondary_menu(); |
if (($custommenu) && |
|
($env{'request.role'} !~ m{^st\./gcitest/$match_courseid})) { |
|
$bodytag .= &Apache::lonmenu::gci_secondary_menu(); |
|
} else { |
|
$bodytag .= Apache::lonmenu::secondary_menu(); |
|
} |
$bodytag .= Apache::lonmenu::serverform(); |
$bodytag .= Apache::lonmenu::serverform(); |
$bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); |
$bodytag .= Apache::lonhtmlcommon::scripttag('', 'end'); |
if ($env{'request.state'} eq 'construct') { |
if ($env{'request.state'} eq 'construct') { |
Line 10759 sub check_for_gci_dc {
|
Line 10786 sub check_for_gci_dc {
|
} |
} |
|
|
sub existing_gcitest_courses { |
sub existing_gcitest_courses { |
|
my ($role) = @_; |
my %courses; |
my %courses; |
my $cdom = 'gcitest'; |
my $cdom = 'gcitest'; |
my $role = 'cc'; |
|
my $now = time; |
my $now = time; |
foreach my $envkey (keys(%env)) { |
foreach my $envkey (keys(%env)) { |
my $cnum; |
my $cnum; |
Line 10770 sub existing_gcitest_courses {
|
Line 10797 sub existing_gcitest_courses {
|
} else { |
} else { |
next; |
next; |
} |
} |
my ($tstart,$tend) = split(':',$env{$envkey}); |
my ($tstart,$tend) = split('.',$env{$envkey}); |
if (((!$tstart) || ($tstart < $now)) && ((!$tend) || ($tend > $now))) { |
if (((!$tstart) || ($tstart < $now)) && ((!$tend) || ($tend > $now))) { |
my %coursehash = &Apache::lonnet::coursedescription($cdom.'/'.$cnum); |
my $descr = $env{'course.'.$cdom.'_'.$cnum.'.description'}; |
$courses{$cdom.'_'.$cnum}{'description'} = $coursehash{'description'}; |
if ($descr ne '') { |
$courses{$cdom.'_'.$cnum}{'owner'} = $coursehash{'internal.courseowner'}; |
$courses{$cdom.'_'.$cnum}{'description'} = $descr; |
if (defined($coursehash{'default_enrollment_start_date'}) ) { |
|
$courses{$cdom.'_'.$cnum}{'startaccess'} = |
|
&Apache::lonlocal::locallocaltime($coursehash{'default_enrollment_start_date'}); |
|
} |
|
if (defined($coursehash{'default_enrollment_end_date'}) ) { |
|
$courses{$cdom.'_'.$cnum}{'endaccess'} = |
|
&Apache::lonlocal::locallocaltime($coursehash{'default_enrollment_end_date'}); |
|
if ($coursehash{'default_enrollment_end_date'} == 0) { |
|
$courses{$cdom.'_'.$cnum}{'endaccess'} = &mt('No ending date'); |
|
} |
|
} |
} |
} |
} |
} |
} |