function CourseObjectAccessTiming::isReleased in Course 7
Same name and namespace in other branches
- 6 plugins/course/access/timing.inc \CourseObjectAccessTiming::isReleased()
- 7.2 plugins/course_object_access/timing.inc \CourseObjectAccessTiming::isReleased()
2 calls to CourseObjectAccessTiming::isReleased()
- CourseObjectAccessTiming::see in plugins/
course_object_access/ timing.inc - CourseObjectAccessTiming::take in plugins/
course_object_access/ timing.inc
File
- plugins/
course_object_access/ timing.inc, line 120
Class
Code
function isReleased() {
$release_date = strtotime($this
->getOption('release'));
if (REQUEST_TIME <= $release_date) {
$release_date_formatted = format_date($release_date, 'long');
$this
->getCourseObject()
->setAccessMessage('not-open', t('%title will be available on %release.', array(
'%title' => $this
->getCourseObject()
->getTitle(),
'%release' => $release_date_formatted,
)));
return FALSE;
}
else {
return TRUE;
}
}