Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
availability_grouping\frontend Class Reference

Front-end class. More...

Inheritance diagram for availability_grouping\frontend:
core_availability\frontend

Static Public Member Functions

static include_all_javascript ($course, cm_info $cm=null, section_info $section=null)
 Includes JavaScript for the main system and all plugins. More...
 
static report_validation_errors (array $data, array &$errors)
 For use within forms, reports any validation errors from the availability field. More...
 

Protected Member Functions

 allow_add ($course, cm_info $cm=null, section_info $section=null)
 Decides whether this plugin should be available in a given course. More...
 
 get_all_groupings ($courseid)
 Gets all the groupings on the course. More...
 
 get_component ()
 Gets the Frankenstyle component name for this plugin. More...
 
 get_javascript_init_params ($course, cm_info $cm=null, section_info $section=null)
 Gets additional parameters for the plugin's initInner function. More...
 
 get_javascript_strings ()
 Gets a list of string identifiers (in the plugin's language file) that are required in JavaScript for this plugin. More...
 

Static Protected Member Functions

static convert_associative_array_for_js (array $inarray, $keyname, $valuename)
 Converts an associative array into an array of objects with two fields. More...
 

Protected Attributes

array $allgroupings
 Array of grouping info for course.
 
int $allgroupingscourseid
 Course id that $allgroupings is for.
 

Detailed Description

Front-end class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ allow_add()

availability_grouping\frontend::allow_add (   $course,
cm_info  $cm = null,
section_info  $section = null 
)
protected

Decides whether this plugin should be available in a given course.

The plugin can do this depending on course or system settings.

Default returns true.

Parameters
stdClass$courseCourse object
cm_info$cmCourse-module currently being edited (null if none)
section_info$sectionSection currently being edited (null if none)

Reimplemented from core_availability\frontend.

◆ convert_associative_array_for_js()

static core_availability\frontend::convert_associative_array_for_js ( array  $inarray,
  $keyname,
  $valuename 
)
staticprotectedinherited

Converts an associative array into an array of objects with two fields.

This is necessary because JavaScript associative arrays/objects are not ordered (at least officially according to the language specification).

Parameters
array$inarrayAssociative array key => value
string$keynameName to use for key in resulting array objects
string$valuenameName to use for value in resulting array objects
Return values
arrayNon-associative (numeric) array

◆ get_all_groupings()

availability_grouping\frontend::get_all_groupings (   $courseid)
protected

Gets all the groupings on the course.

Parameters
int$courseidCourse id
Return values
arrayArray of grouping objects

◆ get_component()

core_availability\frontend::get_component ( )
protectedinherited

Gets the Frankenstyle component name for this plugin.

Return values
stringThe component name for this plugin

◆ get_javascript_init_params()

availability_grouping\frontend::get_javascript_init_params (   $course,
cm_info  $cm = null,
section_info  $section = null 
)
protected

Gets additional parameters for the plugin's initInner function.

Default returns no parameters.

Parameters
stdClass$courseCourse object
cm_info$cmCourse-module currently being edited (null if none)
section_info$sectionSection currently being edited (null if none)
Return values
arrayArray of parameters for the JavaScript function

Reimplemented from core_availability\frontend.

◆ get_javascript_strings()

core_availability\frontend::get_javascript_strings ( )
protectedinherited

Gets a list of string identifiers (in the plugin's language file) that are required in JavaScript for this plugin.

The default returns nothing.

You do not need to include the 'title' string (which is used by core) as this is automatically added.

Return values
arrayArray of required string identifiers

Reimplemented in availability_profile\frontend, availability_group\frontend, availability_grade\frontend, availability_date\frontend, and availability_completion\frontend.

◆ include_all_javascript()

static core_availability\frontend::include_all_javascript (   $course,
cm_info  $cm = null,
section_info  $section = null 
)
staticinherited

Includes JavaScript for the main system and all plugins.

Parameters
stdClass$courseCourse object
cm_info$cmCourse-module currently being edited (null if none)
section_info$sectionSection currently being edited (null if none)

◆ report_validation_errors()

static core_availability\frontend::report_validation_errors ( array  $data,
array &  $errors 
)
staticinherited

For use within forms, reports any validation errors from the availability field.

Parameters
array$dataForm data fields
array$errorsError array

The documentation for this class was generated from the following file: