| Línea 54... |
Línea 54... |
| 54 |
* @param bool $includedetails If the details should be included in the response.
|
54 |
* @param bool $includedetails If the details should be included in the response.
|
| 55 |
* @param admin_root|null $admintree Root of admin tree to use (for unit testing)
|
55 |
* @param admin_root|null $admintree Root of admin tree to use (for unit testing)
|
| 56 |
* @return array returned data
|
56 |
* @return array returned data
|
| 57 |
*/
|
57 |
*/
|
| 58 |
public static function execute(string $admintreeid, string $settingname, bool $includedetails,
|
58 |
public static function execute(string $admintreeid, string $settingname, bool $includedetails,
|
| 59 |
admin_root $admintree = null): array {
|
59 |
?admin_root $admintree = null): array {
|
| 60 |
global $OUTPUT, $CFG;
|
60 |
global $OUTPUT, $CFG;
|
| Línea 61... |
Línea 61... |
| 61 |
|
61 |
|
| 62 |
// Validate parameters.
|
62 |
// Validate parameters.
|
| 63 |
self::validate_parameters(self::execute_parameters(), [
|
63 |
self::validate_parameters(self::execute_parameters(), [
|
| Línea 103... |
Línea 103... |
| 103 |
*
|
103 |
*
|
| 104 |
* @param string $settingid ID of the adming_setting
|
104 |
* @param string $settingid ID of the adming_setting
|
| 105 |
* @param string $settingname Name of the admin_setting
|
105 |
* @param string $settingname Name of the admin_setting
|
| 106 |
* @param admin_root|null $tree Admin tree to use (for unit testing). Null will default to the admin_get_root()
|
106 |
* @param admin_root|null $tree Admin tree to use (for unit testing). Null will default to the admin_get_root()
|
| 107 |
*/
|
107 |
*/
|
| 108 |
private static function get_check_from_setting(string $settingid, string $settingname, admin_root $tree = null) {
|
108 |
private static function get_check_from_setting(string $settingid, string $settingname, ?admin_root $tree = null) {
|
| 109 |
// Since settings do not know exactly who their parents are in the tree, we must search for the setting.
|
109 |
// Since settings do not know exactly who their parents are in the tree, we must search for the setting.
|
| 110 |
if (empty($tree)) {
|
110 |
if (empty($tree)) {
|
| 111 |
$tree = \admin_get_root();
|
111 |
$tree = \admin_get_root();
|
| 112 |
}
|
112 |
}
|