version 1.1, 2011/01/18 00:22:02
|
version 1.5, 2024/12/31 19:28:29
|
Line 41 use Apache::lonlocal;
|
Line 41 use Apache::lonlocal;
|
use LONCAPA::lonmetadata(); |
use LONCAPA::lonmetadata(); |
use HTML::Entities(); |
use HTML::Entities(); |
use Apache::lonnavmaps; |
use Apache::lonnavmaps; |
use Apache::londocs(); |
use Apache::lonnavdisplay(); |
use Apache::lonindexer(); |
use Apache::lonindexer(); |
use LONCAPA; |
use LONCAPA; |
|
|
Line 70 sub course_index {
|
Line 70 sub course_index {
|
%alreadyseen=(); |
%alreadyseen=(); |
if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.".db", |
if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.".db", |
&GDBM_READER(),0640)) { |
&GDBM_READER(),0640)) { |
foreach (sort(keys(%hash))) { |
foreach my $key (sort(keys(%hash))) { |
if ($c->aborted()) { last; } |
last if ($c->aborted()); |
if (($_=~/^src\_(.+)$/)) { |
if ($key =~ /^src\_(.+)$/) { |
if ($hash{'randomout_'.$1} & !$env{'request.role.adv'}) { |
my $rid = $1; |
next; |
unless ($env{'request.role.adv'}) { |
|
next if ($hash{'randomout_'.$rid} || $hash{'deeplinkout_'.$rid}); |
|
if (!$env{'request.deeplink.login'} && $hash{'deeplinkonly_'.$rid}) { |
|
my ($value) = map { &unescape($_); } split(/:/,$hash{'deeplinkonly_'.$rid}); |
|
my ($state,$others,$listed) = split(/,/,$value); |
|
next if (($state eq 'only') && |
|
(($listed eq 'absent') || ($listed eq 'grades'))); |
|
} |
} |
} |
my $symb=&make_symb($1); |
my $symb=&make_symb($rid); |
my %newwords=&checkonthis($r,$1,$hash{$_},0,&Apache::lonnet::gettitle($symb), |
my %newwords=&checkonthis($r,$rid,$hash{$key},0,&Apache::lonnet::gettitle($symb), |
$symb); |
$symb); |
} |
} |
} |
} |
Line 136 sub checkonthis {
|
Line 143 sub checkonthis {
|
# Check also the dependencies of this one |
# Check also the dependencies of this one |
my $dependencies= |
my $dependencies= |
&Apache::lonnet::metadata($url,'dependencies'); |
&Apache::lonnet::metadata($url,'dependencies'); |
foreach (split(/\,/,$dependencies)) { |
foreach my $item (split(/\,/,$dependencies)) { |
if (($_=~/^\/res\//) && (!$alreadyseen{$id})) { |
if (($item =~ /^\/res\//) && (!$alreadyseen{$id})) { |
&checkonthis($r,$id,$_,$level+1,''); |
&checkonthis($r,$id,$item,$level+1,''); |
} |
} |
} |
} |
} |
} |
Line 163 sub handler {
|
Line 170 sub handler {
|
{ href => '/adm/indexcourse', |
{ href => '/adm/indexcourse', |
text => "$crstype Index"}); |
text => "$crstype Index"}); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs("$crstype Index")); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs("$crstype Index")); |
&Apache::londocs::startContentScreen($r,'courseindex'); |
&Apache::lonnavdisplay::startContentScreen($r,'courseindex'); |
&course_index($r); |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
&Apache::londocs::endContentScreen($r); |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $clientip = &Apache::lonnet::get_requestor_ip($r); |
|
my ($blocked,$blocktext) = |
|
&Apache::loncommon::blocking_status('index',$clientip,$cnum,$cdom); |
|
if ($blocked) { |
|
my $checkrole = "cm./$cdom/$cnum"; |
|
if ($env{'request.course.sec'} ne '') { |
|
$checkrole .= "/$env{'request.course.sec'}"; |
|
} |
|
if ((&Apache::lonnet::allowed('evb',undef,undef,$checkrole)) && |
|
($env{'request.role'} !~ m{^st\./$cdom/$cnum})) { |
|
undef($blocked); |
|
} |
|
} |
|
if ($blocked) { |
|
$r->print($blocktext); |
|
} else { |
|
&course_index($r); |
|
} |
|
&Apache::lonnavdisplay::endContentScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |