Merge branch 'MDL-57408-master' of git://github.com/jleyva/moodle

This commit is contained in:
Andrew Nicols 2017-01-24 13:01:45 +08:00
commit 6b8e5ce307
5 changed files with 20 additions and 1 deletions

View File

@ -47,6 +47,8 @@ class api {
const LOGIN_VIA_EMBEDDED_BROWSER = 3;
/** @var int seconds an auto-login key will expire. */
const LOGIN_KEY_TTL = 60;
/** @var str link to the custom strings documentation for the app */
const CUSTOM_STRINGS_DOC_URL = 'https://docs.moodle.org/en/Moodle_Mobile_language_strings_customisation';
/**
* Returns a list of Moodle plugins supporting the mobile app.
@ -204,6 +206,7 @@ class api {
if (empty($section) or $section == 'mobileapp') {
$settings->tool_mobile_forcelogout = get_config('tool_mobile', 'forcelogout');
$settings->tool_mobile_customlangstrings = get_config('tool_mobile', 'customlangstrings');
}
return $settings;

View File

@ -26,6 +26,13 @@ $string['autologinkeygenerationlockout'] = 'Auto-login key generation is blocked
$string['autologinnotallowedtoadmins'] = 'Auto-login is not allowed for site admins.';
$string['clickheretolaunchtheapp'] = 'Click here if the app does not open automatically.';
$string['configmobilecssurl'] = 'A CSS file to customise your mobile app interface.';
$string['customlangstrings'] = 'Custom language strings';
$string['customlangstrings_desc'] = 'Words and phrases displayed in the app can be customised here. Enter each custom language string on a new line with format: string identifier, custom language string and language code, separated by pipe characters. For example:
<pre>
mm.user.student|Learner|en
mm.user.student|Aprendiz|es
</pre>
For a complete list of string identifiers and more information, see the <a href="{$a}">documentation page</a>.';
$string['enablesmartappbanners'] = 'Enable Smart App Banners';
$string['enablesmartappbanners_desc'] = 'This will display a banner promoting the Moodle Mobile app when visiting the site in Mobile Safari.';
$string['forcedurlscheme'] = 'If you want to allow only your custom branded app to be opened via a browser window, then specify its URL scheme here; otherwise leave the field empty.';

View File

@ -92,6 +92,14 @@ if ($hassiteconfig) {
new lang_string('forcelogout', 'tool_mobile'),
new lang_string('forcelogout_desc', 'tool_mobile'), 0));
$temp->add(new admin_setting_heading('tool_mobile/language',
new lang_string('language'), ''));
$temp->add(new admin_setting_configtextarea('tool_mobile/customlangstrings',
new lang_string('customlangstrings', 'tool_mobile'),
new lang_string('customlangstrings_desc', 'tool_mobile', tool_mobile\api::CUSTOM_STRINGS_DOC_URL),
'', PARAM_RAW, '50', '10'));
$ADMIN->add('mobileapp', $temp);
}
}

View File

@ -145,6 +145,7 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
array('name' => 'disableuserimages', 'value' => $CFG->disableuserimages),
array('name' => 'mygradesurl', 'value' => user_mygrades_url()->out(false)),
array('name' => 'tool_mobile_forcelogout', 'value' => 0),
array('name' => 'tool_mobile_customlangstrings', 'value' => ''),
);
$this->assertCount(0, $result['warnings']);
$this->assertEquals($expected, $result['settings']);

View File

@ -23,7 +23,7 @@
*/
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2016120501; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2016120502; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2016112900; // Requires this Moodle version.
$plugin->component = 'tool_mobile'; // Full name of the plugin (used for diagnostics).
$plugin->dependencies = array(