diff --git a/admin/tool/mobile/lang/en/tool_mobile.php b/admin/tool/mobile/lang/en/tool_mobile.php
index 441a19a1f9b..c5862e7360b 100644
--- a/admin/tool/mobile/lang/en/tool_mobile.php
+++ b/admin/tool/mobile/lang/en/tool_mobile.php
@@ -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.';
diff --git a/admin/tool/mobile/settings.php b/admin/tool/mobile/settings.php
index 496557cdc75..9cc8d9088e3 100644
--- a/admin/tool/mobile/settings.php
+++ b/admin/tool/mobile/settings.php
@@ -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);
+ }
}
diff --git a/lang/en/admin.php b/lang/en/admin.php
index 3a36e9c4439..7351492e24a 100644
--- a/lang/en/admin.php
+++ b/lang/en/admin.php
@@ -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';
@@ -745,8 +744,6 @@ $string['mnetrestore_extusers_admin'] = 'Note: This backup file
$string['mnetrestore_extusers_mismatch'] = 'Note: This backup file apparently originates from a different Moodle installation and contains remote Moodle Network user accounts that may fail to restore. This operation is unsupported. If you are certain that it was created on this Moodle installation, or you can ensure that all the needed Moodle Network Hosts are configured, you may want to still try the restore.';
$string['mnetrestore_extusers_noadmin'] = 'Note: 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';
@@ -1240,3 +1237,5 @@ $string['cachesession'] = 'Session cache';
$string['cachesessionhelp'] = 'User specific cache that expires when the user\'s session ends. Designed to alleviate session bloat/strain.';
$string['cacheapplication'] = 'Application cache';
$string['cacheapplicationhelp'] = 'Cached items are shared among all users and expire by a determined time to live (ttl).';
+// Deprecated since Moodle 3.2.
+$string['mobile'] = 'Mobile';
diff --git a/lang/en/deprecated.txt b/lang/en/deprecated.txt
index 42cf26a6c9f..6733a5cb6b2 100644
--- a/lang/en/deprecated.txt
+++ b/lang/en/deprecated.txt
@@ -38,3 +38,4 @@ revealpassword,core_form
mediasettings,core_media
legacyheading,core_media
legacyheading_desc,core_media
+mobile,core_admin
diff --git a/lang/en/webservice.php b/lang/en/webservice.php
index 06cb7d15037..ebfe9384082 100644
--- a/lang/en/webservice.php
+++ b/lang/en/webservice.php
@@ -68,7 +68,6 @@ $string['editservice'] = 'Edit the service: {$a->name} (id: {$a->id})';
$string['enabled'] = 'Enabled';
$string['enabledocumentation'] = 'Enable developer documentation';
$string['enabledocumentationdescription'] = 'Detailed web services documentation is available for enabled protocols.';
-$string['enablemobilewsoverview'] = 'Go to {$a->manageservicelink} administration page, check the "{$a->enablemobileservice}" setting and Save. Everything will be setup for you and all site\'s users will be able to use the offical Moodle app. Current status: {$a->wsmobilestatus}';
$string['enableprotocols'] = 'Enable protocols';
$string['enableprotocolsdescription'] = 'At least one protocol should be enabled. For security reasons, only protocols that are to be used should be enabled.';
$string['enablews'] = 'Enable web services';
@@ -125,8 +124,6 @@ $string['missingpassword'] = 'Missing password';
$string['missingrequiredcapability'] = 'The capability {$a} is required.';
$string['missingusername'] = 'Missing username';
$string['missingversionfile'] = 'Coding error: version.php file is missing for the component {$a}';
-$string['mobilewsdisabled'] = 'Disabled';
-$string['mobilewsenabled'] = 'Enabled';
$string['nameexists'] = 'This name is already in use by another service';
$string['nocapabilitytouseparameter'] = 'The user does not have the required capability to use the parameter {$a}';
$string['nofunctions'] = 'This service has no functions.';
diff --git a/lib/adminlib.php b/lib/adminlib.php
index a59d4817ee7..c3c70fce1d1 100644
--- a/lib/adminlib.php
+++ b/lib/adminlib.php
@@ -8807,22 +8807,6 @@ class admin_setting_webservicesoverview extends admin_setting {
$return = "";
$brtag = html_writer::empty_tag('br');
- // Enable mobile web service
- $enablemobile = new admin_setting_enablemobileservice('enablemobilewebservice',
- get_string('enablemobilewebservice', 'admin'),
- get_string('configenablemobilewebservice',
- 'admin', ''), 0); //we don't want to display it but to know the ws mobile status
- $manageserviceurl = new moodle_url("/admin/settings.php?section=mobile");
- $wsmobileparam = new stdClass();
- $wsmobileparam->enablemobileservice = get_string('enablemobilewebservice', 'admin');
- $wsmobileparam->manageservicelink = html_writer::link($manageserviceurl,
- get_string('mobile', 'admin'));
- $mobilestatus = $enablemobile->get_setting()?get_string('mobilewsenabled', 'webservice'):get_string('mobilewsdisabled', 'webservice');
- $wsmobileparam->wsmobilestatus = html_writer::tag('strong', $mobilestatus);
- $return .= $OUTPUT->heading(get_string('enablemobilewebservice', 'admin'), 3, 'main');
- $return .= $brtag . get_string('enablemobilewsoverview', 'webservice', $wsmobileparam)
- . $brtag . $brtag;
-
/// One system controlling Moodle with Token
$return .= $OUTPUT->heading(get_string('onesystemcontrolling', 'webservice'), 3, 'main');
$table = new html_table();
diff --git a/webservice/externallib.php b/webservice/externallib.php
index 1d824e7484f..84b0fd4b40d 100644
--- a/webservice/externallib.php
+++ b/webservice/externallib.php
@@ -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",
diff --git a/webservice/tests/externallib_test.php b/webservice/tests/externallib_test.php
index 2fc5b3a8d77..f6d689bc3f3 100644
--- a/webservice/tests/externallib_test.php
+++ b/webservice/tests/externallib_test.php
@@ -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');