MDL-66775 tool_mobile: Return additional app data

We need this information for creating a link to the app store listing for updating.
This commit is contained in:
Juan Leyva 2019-10-02 15:39:27 +02:00
parent 4bf08f5b4d
commit 12a289c7a4
3 changed files with 11 additions and 0 deletions

View File

@ -178,6 +178,9 @@ class api {
'langlist' => $CFG->langlist,
'locale' => $CFG->locale,
'tool_mobile_minimumversion' => get_config('tool_mobile', 'minimumversion'),
'tool_mobile_iosappid' => get_config('tool_mobile', 'iosappid'),
'tool_mobile_androidappid' => get_config('tool_mobile', 'androidappid'),
'tool_mobile_setuplink' => clean_param(get_config('tool_mobile', 'setuplink'), PARAM_URL),
);
$typeoflogin = get_config('tool_mobile', 'typeoflogin');

View File

@ -181,6 +181,11 @@ class external extends external_api {
'locale' => new external_value(PARAM_RAW, 'Sitewide locale.', VALUE_OPTIONAL),
'tool_mobile_minimumversion' => new external_value(PARAM_NOTAGS, 'Minimum required version to access.',
VALUE_OPTIONAL),
'tool_mobile_iosappid' => new external_value(PARAM_ALPHANUM, 'iOS app\'s unique identifier.',
VALUE_OPTIONAL),
'tool_mobile_androidappid' => new external_value(PARAM_NOTAGS, 'Android app\'s unique identifier.',
VALUE_OPTIONAL),
'tool_mobile_setuplink' => new external_value(PARAM_URL, 'App download page.', VALUE_OPTIONAL),
'warnings' => new external_warnings(),
)
);

View File

@ -96,6 +96,9 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
'langlist' => $CFG->langlist,
'locale' => $CFG->locale,
'tool_mobile_minimumversion' => '',
'tool_mobile_iosappid' => get_config('tool_mobile', 'iosappid'),
'tool_mobile_androidappid' => get_config('tool_mobile', 'androidappid'),
'tool_mobile_setuplink' => get_config('tool_mobile', 'setuplink'),
'warnings' => array()
);
$this->assertEquals($expected, $result);