You are here

function CourseObjectAccessTiming::isReleased in Course 7.2

Same name and namespace in other branches
  1. 6 plugins/course/access/timing.inc \CourseObjectAccessTiming::isReleased()
  2. 7 plugins/course_object_access/timing.inc \CourseObjectAccessTiming::isReleased()
2 calls to CourseObjectAccessTiming::isReleased()
CourseObjectAccessTiming::see in plugins/course_object_access/timing.inc
Can the user see the object in the outline?
CourseObjectAccessTiming::take in plugins/course_object_access/timing.inc
Can the user take the object?

File

plugins/course_object_access/timing.inc, line 120

Class

CourseObjectAccessTiming

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;
  }
}