Front-end class.
More...
|
static | get_fields_from_time ($time) |
| Given a timestamp, obtains corresponding field values.
|
|
static | get_time_from_fields ($year, $month, $day, $hour, $minute) |
| Given field values, obtains the corresponding timestamp.
|
|
static | include_all_javascript ($course, cm_info $cm=null, section_info $section=null) |
| Includes JavaScript for the main system and all plugins.
|
|
static | report_validation_errors (array $data, array &$errors) |
| For use within forms, reports any validation errors from the availability field.
|
|
|
bool const | DATE_SELECTOR_SUPPORTED = false |
| The date selector popup is not currently supported because the date selector is in a messy state (about to be replaced with a new YUI3 implementation) and MDL-44814 was rejected.
|
|
Front-end class.
- Copyright
- 2014 The Open University
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ allow_add()
core_availability\frontend::allow_add |
( |
| $course, |
|
|
cm_info | $cm = null, |
|
|
section_info | $section = null ) |
|
protectedinherited |
◆ 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 | $inarray | Associative array key => value |
string | $keyname | Name to use for key in resulting array objects |
string | $valuename | Name to use for value in resulting array objects |
- Return values
-
array | Non-associative (numeric) array |
◆ get_component()
core_availability\frontend::get_component |
( |
| ) |
|
|
protectedinherited |
Gets the Frankenstyle component name for this plugin.
- Return values
-
string | The component name for this plugin |
◆ get_fields_from_time()
static availability_date\frontend::get_fields_from_time |
( |
| $time | ) |
|
|
static |
Given a timestamp, obtains corresponding field values.
- Parameters
-
- Return values
-
stdClass | Object with fields for year, month, day, hour, minute |
◆ get_javascript_init_params()
availability_date\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 | $course | Course object |
cm_info | $cm | Course-module currently being edited (null if none) |
section_info | $section | Section currently being edited (null if none) |
- Return values
-
array | Array of parameters for the JavaScript function |
Reimplemented from core_availability\frontend.
◆ get_javascript_strings()
availability_date\frontend::get_javascript_strings |
( |
| ) |
|
|
protected |
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
-
array | Array of required string identifiers |
Reimplemented from core_availability\frontend.
◆ get_time_from_fields()
static availability_date\frontend::get_time_from_fields |
( |
| $year, |
|
|
| $month, |
|
|
| $day, |
|
|
| $hour, |
|
|
| $minute ) |
|
static |
Given field values, obtains the corresponding timestamp.
- Parameters
-
int | $year | Year |
int | $month | Month |
int | $day | Day |
int | $hour | Hour |
int | $minute | Minute |
- Return values
-
◆ 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 | $course | Course object |
cm_info | $cm | Course-module currently being edited (null if none) |
section_info | $section | Section 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 | $data | Form data fields |
array | $errors | Error array |
◆ DATE_SELECTOR_SUPPORTED
bool const availability_date\frontend::DATE_SELECTOR_SUPPORTED = false |
The date selector popup is not currently supported because the date selector is in a messy state (about to be replaced with a new YUI3 implementation) and MDL-44814 was rejected.
I have left the code in place, but disabled. When the date selector situation is finalised, then this constant should be removed (either applying MDL-44814 if old selector is still in use, or modifying the JavaScript code to support the new date selector if it has landed).
The documentation for this class was generated from the following file:
- availability/condition/date/classes/frontend.php