version 1.8.4.8, 2010/10/04 18:54:46
|
version 1.8.4.11, 2010/12/05 16:39:33
|
Line 55 sub handler {
|
Line 55 sub handler {
|
|
|
my $custommenu = &Apache::loncommon::needs_gci_custom(); |
my $custommenu = &Apache::loncommon::needs_gci_custom(); |
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
my %gcicourses = ( |
|
gci_9615072b469884921gcil1 => 'review', |
my %cicourses; |
gci_1H96711d710194bfegcil1 => 'submit', |
my $udom = $env{'user.domain'}; |
gci_5422913620b814c90gcil1 => 'tutorial', |
my %allnums = &Apache::loncommon::get_faculty_cnums(); |
); |
if ($udom ne '' && ref($allnums{$udom} eq 'HASH') { |
if (($custommenu && $cid ne '' && ($gcicourses{$cid} || $env{'request.role'} !~ m{^cc\./gcitest/})) || |
foreach my $key (%{$allnums{$udom}}) { |
($env{'user.domain'} eq 'gcitest')) { |
$cicourses{$udom.'_'.$key} = $allnums{$udom}->{$key}; |
|
} |
|
} |
|
|
|
if (($custommenu && $cid ne '' && ($cicourses{$cid} || $env{'request.role'} !~ m{^cc\./\Q$udom\Etest/})) || |
|
($cid ne '' && $env{'user.domain'} =~ /^\w+citest$/)) { |
$r->internal_redirect('/adm/navmaps'); |
$r->internal_redirect('/adm/navmaps'); |
return OK; |
return OK; |
} |
} |
Line 87 ENDSCRIPT
|
Line 92 ENDSCRIPT
|
$env{'environment.remote'}='off'; |
$env{'environment.remote'}='off'; |
|
|
# Breadcrumbs |
# Breadcrumbs |
my $args; |
my ($nocrumbs,$args); |
unless ($custommenu && !$env{'request.course.id'}) { |
if ($custommenu) { |
|
if ($env{'request.course.id'}) { |
|
unless ($cicourses{$env{'request.course.id'}}) { |
|
$nocrumbs = 1; |
|
} |
|
} else { |
|
$nocrumbs = 1; |
|
} |
|
} |
|
unless ($nocrumbs) { |
my $brcrum = []; |
my $brcrum = []; |
$args = {bread_crumbs => $brcrum}; |
$args = {bread_crumbs => $brcrum}; |
} |
} |
$r->print(&Apache::loncommon::start_page('Main Menu',$script_tag,$args)); |
$r->print(&Apache::loncommon::start_page('Main Menu',$script_tag,$args)); |
|
|
my ($rolecount,$numcourses) = (0,0); |
my ($rolecount,$numcourses) = (0,0); |
unless (($custommenu) || ($env{'user.domain'} eq 'gcitest')) { |
my $now = time; |
|
unless (($custommenu) || ($env{'user.domain'} =~ /^\w+citest$/)) { |
foreach my $envkey (keys(%env)) { |
foreach my $envkey (keys(%env)) { |
next unless ($envkey =~ /^user\.role\./); |
next unless ($envkey =~ /^user\.role\./); |
$rolecount ++; |
my ($start,$end) = split(/\./,$env{$envkey}); |
|
if (($start eq '' || $start <= $now) && ($end eq '' || $end > $now)) { |
|
$rolecount ++; |
|
} |
} |
} |
} |
} |
if ($custommenu) { |
if ($custommenu) { |