MDL-56607 settings: Move mobile settings to top-level

AMOS BEGIN
 MOV [mobilecssurl,core_admin],[mobilecssurl,tool_mobile]
 MOV [configmobilecssurl,core_admin],[configmobilecssurl,tool_mobile]
AMOS END

From Plugins / Web Services / Mobile to Appearance / Mobile
This commit is contained in:
Juan Leyva 2016-10-26 17:06:58 +01:00
parent 7eb34671c1
commit 0c6c86643e
5 changed files with 44 additions and 27 deletions

View File

@ -25,6 +25,7 @@
$string['autologinkeygenerationlockout'] = 'Auto-login key generation is locked out, too much requests in an hour.';
$string['autologinnotallowedtoadmins'] = 'Auto-login is not allowed to 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['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.';
@ -36,6 +37,11 @@ $string['iosappid_desc'] = 'This setting may be left as default unless you have
$string['loginintheapp'] = 'Via the app';
$string['logininthebrowser'] = 'Via a browser window (for SSO plugins)';
$string['loginintheembeddedbrowser'] = 'Via an embedded browser (for SSO plugins)';
$string['mobileapp'] = 'Mobile app';
$string['mobileappearance'] = 'Mobile appearance';
$string['mobileauthentication'] = 'Mobile authentication';
$string['mobilecssurl'] = 'CSS';
$string['mobilesettings'] = 'Mobile settings';
$string['pluginname'] = 'Moodle Mobile tools';
$string['smartappbanners'] = 'Smart App Banners (iOS only)';
$string['pluginnotenabledorconfigured'] = 'Plugin not enabled or configured.';

View File

@ -28,7 +28,9 @@ defined('MOODLE_INTERNAL') || die();
if ($hassiteconfig) {
$temp = new admin_settingpage('mobile', new lang_string('mobile', 'admin'), 'moodle/site:config', false);
$ADMIN->add('root', new admin_category('mobileapp', new lang_string('mobileapp', 'tool_mobile')), 'development');
$temp = new admin_settingpage('mobilesettings', new lang_string('mobilesettings', 'tool_mobile'), 'moodle/site:config', false);
// We should wait to the installation to finish since we depend on some configuration values that are set once
// the admin user profile is configured.
@ -41,32 +43,43 @@ if ($hassiteconfig) {
new lang_string('configenablemobilewebservice', 'admin', $enablemobiledoclink), $default));
}
$temp->add(new admin_setting_configtext('mobilecssurl', new lang_string('mobilecssurl', 'admin'),
new lang_string('configmobilecssurl', 'admin'), '', PARAM_URL));
$ADMIN->add('mobileapp', $temp);
// Type of login.
$options = array(
tool_mobile\api::LOGIN_VIA_APP => new lang_string('loginintheapp', 'tool_mobile'),
tool_mobile\api::LOGIN_VIA_BROWSER => new lang_string('logininthebrowser', 'tool_mobile'),
tool_mobile\api::LOGIN_VIA_EMBEDDED_BROWSER => new lang_string('loginintheembeddedbrowser', 'tool_mobile'),
);
$temp->add(new admin_setting_configselect('tool_mobile/typeoflogin',
new lang_string('typeoflogin', 'tool_mobile'),
new lang_string('typeoflogin_desc', 'tool_mobile'), 1, $options));
// Show only mobile settings if the mobile service is enabled.
if (!empty($CFG->enablemobilewebservice)) {
// Type of login.
$temp = new admin_settingpage('mobileauthentication', new lang_string('mobileauthentication', 'tool_mobile'));
$options = array(
tool_mobile\api::LOGIN_VIA_APP => new lang_string('loginintheapp', 'tool_mobile'),
tool_mobile\api::LOGIN_VIA_BROWSER => new lang_string('logininthebrowser', 'tool_mobile'),
tool_mobile\api::LOGIN_VIA_EMBEDDED_BROWSER => new lang_string('loginintheembeddedbrowser', 'tool_mobile'),
);
$temp->add(new admin_setting_configselect('tool_mobile/typeoflogin',
new lang_string('typeoflogin', 'tool_mobile'),
new lang_string('typeoflogin_desc', 'tool_mobile'), 1, $options));
$temp->add(new admin_setting_configtext('tool_mobile/forcedurlscheme',
new lang_string('forcedurlscheme_key', 'tool_mobile'),
new lang_string('forcedurlscheme', 'tool_mobile'), '', PARAM_NOTAGS));
$temp->add(new admin_setting_configtext('tool_mobile/forcedurlscheme',
new lang_string('forcedurlscheme_key', 'tool_mobile'),
new lang_string('forcedurlscheme', 'tool_mobile'), '', PARAM_NOTAGS));
$temp->add(new admin_setting_heading('tool_mobile/smartappbanners',
new lang_string('smartappbanners', 'tool_mobile'), ''));
$ADMIN->add('mobileapp', $temp);
$temp->add(new admin_setting_configcheckbox('tool_mobile/enablesmartappbanners',
new lang_string('enablesmartappbanners', 'tool_mobile'),
new lang_string('enablesmartappbanners_desc', 'tool_mobile'), 0));
// Appearance related settings.
$temp = new admin_settingpage('mobileappearance', new lang_string('mobileappearance', 'tool_mobile'));
$temp->add(new admin_setting_configtext('tool_mobile/iosappid', new lang_string('iosappid', 'tool_mobile'),
new lang_string('iosappid_desc', 'tool_mobile'), '633359593', PARAM_ALPHANUM));
$temp->add(new admin_setting_configtext('mobilecssurl', new lang_string('mobilecssurl', 'tool_mobile'),
new lang_string('configmobilecssurl', 'tool_mobile'), '', PARAM_URL));
$ADMIN->add('webservicesettings', $temp);
$temp->add(new admin_setting_heading('tool_mobile/smartappbanners',
new lang_string('smartappbanners', 'tool_mobile'), ''));
$temp->add(new admin_setting_configcheckbox('tool_mobile/enablesmartappbanners',
new lang_string('enablesmartappbanners', 'tool_mobile'),
new lang_string('enablesmartappbanners_desc', 'tool_mobile'), 0));
$temp->add(new admin_setting_configtext('tool_mobile/iosappid', new lang_string('iosappid', 'tool_mobile'),
new lang_string('iosappid_desc', 'tool_mobile'), '633359593', PARAM_ALPHANUM));
$ADMIN->add('mobileapp', $temp);
}
}

View File

@ -271,7 +271,6 @@ $string['configminpasswordlength'] = 'Passwords must be at least these many char
$string['configminpasswordlower'] = 'Passwords must have at least these many lower case letters.';
$string['configminpasswordnonalphanum'] = 'Passwords must have at least these many non-alphanumeric characters.';
$string['configminpasswordupper'] = 'Passwords must have at least these many upper case letters.';
$string['configmobilecssurl'] = 'A CSS file to customise your mobile app interface.';
$string['configmodchooserdefault'] = 'Should the activity chooser be presented to users by default?';
$string['configmycoursesperpage'] = 'Maximum number of courses to display in any list of a user\'s own courses';
$string['configmymoodleredirect'] = 'This setting forces redirects to /my on login for non-admins and replaces the top level site navigation with /my';
@ -741,7 +740,6 @@ $string['mnetrestore_extusers_mismatch'] = '<strong>Note:</strong> This backup f
$string['mnetrestore_extusers_noadmin'] = '<strong>Note:</strong> This backup file seems to come from a different Moodle installation and contains remote Moodle Network user accounts. You are not allowed to execute this type of restore. Contact the administrator of the site or, alternatively, restore this course without any user information (modules, files...)';
$string['mnetrestore_extusers_switchuserauth'] = 'Remote Moodle Network user {$a->username} (coming from {$a->mnethosturl}) switched to local {$a->auth} authenticated user.';
$string['mobile'] = 'Mobile';
$string['mobilecssurl'] = 'CSS';
$string['modchooserdefault'] = 'Activity chooser default';
$string['modeditdefaults'] = 'Default values for activity settings';
$string['modsettings'] = 'Manage activities';

View File

@ -163,7 +163,7 @@ class core_webservice_external extends external_api {
$siteinfo['functions'] = $availablefunctions;
// Mobile CSS theme and alternative login url.
$siteinfo['mobilecssurl'] = $CFG->mobilecssurl;
$siteinfo['mobilecssurl'] = !empty($CFG->mobilecssurl) ? $CFG->mobilecssurl : '';
// Retrieve some advanced features. Only enable/disable ones (bool).
$advancedfeatures = array("usecomments", "usetags", "enablenotes", "messaging", "enableblogs",

View File

@ -99,7 +99,7 @@ class core_webservice_externallib_testcase extends externallib_advanced_testcase
$this->assertEquals(true, $siteinfo['downloadfiles']);
$this->assertEquals($CFG->release, $siteinfo['release']);
$this->assertEquals($CFG->version, $siteinfo['version']);
$this->assertEquals($CFG->mobilecssurl, $siteinfo['mobilecssurl']);
$this->assertEquals('', $siteinfo['mobilecssurl']);
$this->assertEquals(count($siteinfo['functions']), 1);
$function = array_pop($siteinfo['functions']);
$this->assertEquals($function['name'], 'core_course_get_contents');