MDL-77643 tool_mobile: Return location settings

This commit is contained in:
Juan Leyva 2023-03-15 16:14:21 +01:00
parent f3bf17cdfb
commit bba614a5eb
3 changed files with 11 additions and 0 deletions

View File

@ -360,6 +360,11 @@ class api {
$settings->customusermenuitems = $CFG->customusermenuitems; $settings->customusermenuitems = $CFG->customusermenuitems;
} }
if (empty($section) || $section === 'locationsettings') {
$settings->timezone = $CFG->timezone;
$settings->forcetimezone = $CFG->forcetimezone;
}
return $settings; return $settings;
} }

View File

@ -254,6 +254,8 @@ class externallib_test extends externallib_advanced_testcase {
$expected[] = ['name' => 'enabledashboard', 'value' => $CFG->enabledashboard]; $expected[] = ['name' => 'enabledashboard', 'value' => $CFG->enabledashboard];
$expected[] = ['name' => 'customusermenuitems', 'value' => $CFG->customusermenuitems]; $expected[] = ['name' => 'customusermenuitems', 'value' => $CFG->customusermenuitems];
$expected[] = ['name' => 'timezone', 'value' => $CFG->timezone];
$expected[] = ['name' => 'forcetimezone', 'value' => $CFG->forcetimezone];
$this->assertCount(0, $result['warnings']); $this->assertCount(0, $result['warnings']);
$this->assertEquals($expected, $result['settings']); $this->assertEquals($expected, $result['settings']);

View File

@ -1,6 +1,10 @@
This files describes changes in tool_mobile code. This files describes changes in tool_mobile code.
Information provided here is intended especially for developers. Information provided here is intended especially for developers.
=== 4.2 ===
* External function tool_mobile::get_config now returns the timezone and forcetimezone settings.
=== 4.1 === === 4.1 ===
* External function tool_mobile::get_config now returns the customusermenuitems setting. * External function tool_mobile::get_config now returns the customusermenuitems setting.