Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 403]

Contains the default activity availability information.

Copyright: 2020 Ferran Recio <ferran@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 162 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

availability:: (4 methods):
  __construct()
  get_info()
  user_availability_info()
  conditional_availability_info()


Class: availability  - X-Ref

Base class to render a course module availability inside a course format.

__construct(course_format $format, section_info $section, cm_info $mod, array $displayoptions = [])   X-Ref
Constructor.

param: course_format $format the course format
param: section_info $section the section info
param: cm_info $mod the course module ionfo
param: array $displayoptions optional extra display options

get_info(\renderer_base $output)   X-Ref
Get the availability data to be used as the context for a mustache template.

param: \renderer_base $output typically, the renderer that's calling this function
return: array the availability data.

user_availability_info(\renderer_base $output)   X-Ref
Get the current user availability data.

This is a student who is not allowed to see the module but might be allowed
to see availability info (i.e. "Available from ...").

param: \renderer_base $output typically, the renderer that's calling this function
return: array the availability data.

conditional_availability_info(\renderer_base $output)   X-Ref
Get the activity availability data to display.

param: \renderer_base $output typically, the renderer that's calling this function
return: array the availability data.