mirror of
https://github.com/moodle/moodle.git
synced 2025-08-11 11:56:40 +02:00
MDL-81172 Administration: Add recommended custom check
Add support for custom environment checks to have a recommended option in addition to required an optional.
This commit is contained in:
parent
5d74f366a0
commit
66349bad3a
4 changed files with 14 additions and 6 deletions
|
@ -1251,7 +1251,7 @@ class environment_results {
|
|||
*/
|
||||
var $error_code;
|
||||
/**
|
||||
* @var string required/optional
|
||||
* @var string required/optional/recommended.
|
||||
*/
|
||||
var $level;
|
||||
/**
|
||||
|
@ -1548,8 +1548,9 @@ function get_level($element) {
|
|||
$level = 'required';
|
||||
if (isset($element['@']['level'])) {
|
||||
$level = $element['@']['level'];
|
||||
if (!in_array($level, array('required', 'optional'))) {
|
||||
debugging('The level of a check in the environment.xml file must be "required" or "optional".', DEBUG_DEVELOPER);
|
||||
if (!in_array($level, ['required', 'optional', 'recommended'])) {
|
||||
debugging('The level of a check in the environment.xml file must be "required", "optional" or "recommended".',
|
||||
DEBUG_DEVELOPER);
|
||||
$level = 'required';
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue