--- loncom/auth/londatecheck.pm 2005/04/07 06:56:21 1.8 +++ loncom/auth/londatecheck.pm 2005/04/25 21:41:37 1.11 @@ -1,5 +1,5 @@ # Checks contentopen/close settings disable subsequent PerlHandlers if not open -# $Id: londatecheck.pm,v 1.8 2005/04/07 06:56:21 albertel Exp $ +# $Id: londatecheck.pm,v 1.11 2005/04/25 21:41:37 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,12 +36,14 @@ sub content_date_check { my $close=&Apache::lonnet::EXT('resource.0.contentclose',$symb); if ( (defined($open) && $open ne '' && time < $open) ) { return ('CLOSED',$open,$close, + '

'.&mt('Not open to be viewed').'

'. &mt("This resource currently isn't open. ". "It will be available at [_1].", &Apache::lonlocal::locallocaltime($open))); } if ( (defined($close) && $close ne '' && time > $close) ) { return ('CLOSED',$open,$close, + '

'.&mt('Not open to be viewed').'

'. &mt("This resource is no longer available to be viewed.")); } return ('OPEN',$open,$close); @@ -50,7 +52,7 @@ sub content_date_check { sub handler { my ($r)=@_; if (&Apache::lonnet::allowed('bre',$r->uri) eq 'F') { - return OK; + return DECLINED; } my ($status,$open,$close,$msg)=&content_date_check(); if ($status ne 'OPEN') { @@ -58,17 +60,14 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; return OK if $r->header_only; - $r->print(''.&mt("Not Open").''); - my $addentries=' onLoad="'.&Apache::lonmenu::loadevents(). - '" onUnload="'.&Apache::lonmenu::unloadevents().'"'; + my $html=&Apache::lonxml::xmlbegin(); + $r->print($html.''.&mt("Not Open").''); $r->print(&Apache::lonmenu::registerurl(1)); - $r->print(''. - &Apache::loncommon::bodytag('','',$addentries,'','', - undef)); - + $r->print(''.&Apache::structuretags::body_tag_start('web')); $r->print($msg); - $r->print(''); + $r->print(&Apache::lonxml::xmlend().''); + return OK; } - return OK; + return DECLINED; } 1;