You are here

function CourseObjectAccessTiming::isExpired in Course 7.2

Same name and namespace in other branches
  1. 6 plugins/course/access/timing.inc \CourseObjectAccessTiming::isExpired()
  2. 7 plugins/course_object_access/timing.inc \CourseObjectAccessTiming::isExpired()
2 calls to CourseObjectAccessTiming::isExpired()
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 132

Class

CourseObjectAccessTiming

Code

function isExpired() {
  $expiration_date = strtotime($this
    ->getOption('expiration'));
  if ($this
    ->getOption('expiration') && REQUEST_TIME > $expiration_date) {
    $expiration_date_formatted = format_date($expiration_date, 'long');
    $this
      ->getCourseObject()
      ->setAccessMessage('closed', t('%title closed on %expiration.', array(
      '%title' => $this
        ->getCourseObject()
        ->getTitle(),
      '%expiration' => $expiration_date_formatted,
    )));
    return TRUE;
  }
  else {
    return FALSE;
  }
}