Commit 6b8e5ce3 authored by Andrew Nicols's avatar Andrew Nicols
Browse files

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

parents 214eef2e af1b6043
...@@ -47,6 +47,8 @@ class api { ...@@ -47,6 +47,8 @@ class api {
const LOGIN_VIA_EMBEDDED_BROWSER = 3; const LOGIN_VIA_EMBEDDED_BROWSER = 3;
/** @var int seconds an auto-login key will expire. */ /** @var int seconds an auto-login key will expire. */
const LOGIN_KEY_TTL = 60; 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. * Returns a list of Moodle plugins supporting the mobile app.
...@@ -204,6 +206,7 @@ class api { ...@@ -204,6 +206,7 @@ class api {
if (empty($section) or $section == 'mobileapp') { if (empty($section) or $section == 'mobileapp') {
$settings->tool_mobile_forcelogout = get_config('tool_mobile', 'forcelogout'); $settings->tool_mobile_forcelogout = get_config('tool_mobile', 'forcelogout');
$settings->tool_mobile_customlangstrings = get_config('tool_mobile', 'customlangstrings');
} }
return $settings; return $settings;
......
...@@ -26,6 +26,13 @@ $string['autologinkeygenerationlockout'] = 'Auto-login key generation is blocked ...@@ -26,6 +26,13 @@ $string['autologinkeygenerationlockout'] = 'Auto-login key generation is blocked
$string['autologinnotallowedtoadmins'] = 'Auto-login is not allowed for site admins.'; $string['autologinnotallowedtoadmins'] = 'Auto-login is not allowed for site admins.';
$string['clickheretolaunchtheapp'] = 'Click here if the app does not open automatically.'; $string['clickheretolaunchtheapp'] = 'Click here if the app does not open automatically.';
$string['configmobilecssurl'] = 'A CSS file to customise your mobile app interface.'; $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'] = '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['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.'; $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.';
......
...@@ -92,6 +92,14 @@ if ($hassiteconfig) { ...@@ -92,6 +92,14 @@ if ($hassiteconfig) {
new lang_string('forcelogout', 'tool_mobile'), new lang_string('forcelogout', 'tool_mobile'),
new lang_string('forcelogout_desc', 'tool_mobile'), 0)); 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); $ADMIN->add('mobileapp', $temp);
} }
} }
...@@ -145,6 +145,7 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase { ...@@ -145,6 +145,7 @@ class tool_mobile_external_testcase extends externallib_advanced_testcase {
array('name' => 'disableuserimages', 'value' => $CFG->disableuserimages), array('name' => 'disableuserimages', 'value' => $CFG->disableuserimages),
array('name' => 'mygradesurl', 'value' => user_mygrades_url()->out(false)), array('name' => 'mygradesurl', 'value' => user_mygrades_url()->out(false)),
array('name' => 'tool_mobile_forcelogout', 'value' => 0), array('name' => 'tool_mobile_forcelogout', 'value' => 0),
array('name' => 'tool_mobile_customlangstrings', 'value' => ''),
); );
$this->assertCount(0, $result['warnings']); $this->assertCount(0, $result['warnings']);
$this->assertEquals($expected, $result['settings']); $this->assertEquals($expected, $result['settings']);
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
defined('MOODLE_INTERNAL') || die(); 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->requires = 2016112900; // Requires this Moodle version.
$plugin->component = 'tool_mobile'; // Full name of the plugin (used for diagnostics). $plugin->component = 'tool_mobile'; // Full name of the plugin (used for diagnostics).
$plugin->dependencies = array( $plugin->dependencies = array(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment