version 1.12, 2006/04/13 21:02:34
|
version 1.14, 2017/12/22 02:00:53
|
Line 37 sub content_date_check {
|
Line 37 sub content_date_check {
|
my $close=&Apache::lonnet::EXT('resource.0.contentclose',$symb); |
my $close=&Apache::lonnet::EXT('resource.0.contentclose',$symb); |
if ( (defined($open) && $open ne '' && time < $open) ) { |
if ( (defined($open) && $open ne '' && time < $open) ) { |
return ('CLOSED',$open,$close, |
return ('CLOSED',$open,$close, |
'<h1>'.&mt('Not open to be viewed').'</h1>'. |
'<p class="LC_warning">'.&mt('Not open to be viewed').'</p>'. |
&mt("This resource currently isn't open. ". |
&mt("This resource currently isn't open. ". |
"It will be available at [_1].", |
"It will be available at [_1].", |
&Apache::lonlocal::locallocaltime($open))); |
&Apache::lonlocal::locallocaltime($open))); |
} |
} |
if ( (defined($close) && $close ne '' && time > $close) ) { |
if ( (defined($close) && $close ne '' && time > $close) ) { |
return ('CLOSED',$open,$close, |
return ('CLOSED',$open,$close, |
'<h1>'.&mt('Not open to be viewed').'</h1>'. |
'<p class="LC_warning">'.&mt('Not open to be viewed').'</p>'. |
&mt("This resource is no longer available to be viewed.")); |
&mt("This resource is no longer available to be viewed.")); |
} |
} |
return ('OPEN',$open,$close); |
return ('OPEN',$open,$close); |
Line 55 sub handler {
|
Line 55 sub handler {
|
if (&Apache::lonnet::allowed('bre',$r->uri) eq 'F') { |
if (&Apache::lonnet::allowed('bre',$r->uri) eq 'F') { |
return DECLINED; |
return DECLINED; |
} |
} |
|
if (($r->uri =~ /ext\.tool$/) && |
|
(&Apache::lonnet::EXT('resource.0.gradable',$env{'request.symb'}) =~ /^yes$/i)) { |
|
return DECLINED; |
|
} |
my ($status,$open,$close,$msg)=&content_date_check(); |
my ($status,$open,$close,$msg)=&content_date_check(); |
if ($status ne 'OPEN') { |
if ($status ne 'OPEN') { |
$r->set_handlers('PerlHandler'=>undef); |
$r->set_handlers('PerlHandler'=>undef); |