diff --git a/admin/tool/mobile/classes/api.php b/admin/tool/mobile/classes/api.php index c6160d36f79..1136bd0af73 100644 --- a/admin/tool/mobile/classes/api.php +++ b/admin/tool/mobile/classes/api.php @@ -49,6 +49,8 @@ class api { const LOGIN_VIA_EMBEDDED_BROWSER = 3; /** @var int seconds an auto-login key will expire. */ const LOGIN_KEY_TTL = 60; + /** @var string URL of the Moodle Apps Portal */ + const MOODLE_APPS_PORTAL_URL = 'https://apps.moodle.com'; /** * Returns a list of Moodle plugins supporting the mobile app. diff --git a/admin/tool/mobile/lang/en/tool_mobile.php b/admin/tool/mobile/lang/en/tool_mobile.php index 092f7daa69d..ccc68672217 100644 --- a/admin/tool/mobile/lang/en/tool_mobile.php +++ b/admin/tool/mobile/lang/en/tool_mobile.php @@ -91,6 +91,7 @@ $string['mobilecssurl'] = 'CSS'; $string['mobilefeatures'] = 'Mobile features'; $string['mobilenotificationsdisabledwarning'] = 'Mobile notifications are not enabled. They should be enabled in Notification settings.'; $string['mobilesettings'] = 'Mobile settings'; +$string['moodleappsportalfeatureswarning'] = 'Please note that some features may be restricted depending on your Moodle app subscription. For details, visit the Moodle Apps Portal.'; $string['oauth2identityproviders'] = 'OAuth 2 identity providers'; $string['offlineuse'] = 'Offline use'; $string['pluginname'] = 'Moodle app tools'; diff --git a/admin/tool/mobile/settings.php b/admin/tool/mobile/settings.php index a9cdbcf3802..05ed4aad1b0 100644 --- a/admin/tool/mobile/settings.php +++ b/admin/tool/mobile/settings.php @@ -50,6 +50,12 @@ if ($hassiteconfig) { // Show only mobile settings if the mobile service is enabled. if (!empty($CFG->enablemobilewebservice)) { + // General notification about limited features due to app restrictions. + $notify = new \core\output\notification( + get_string('moodleappsportalfeatureswarning', 'tool_mobile', tool_mobile\api::MOODLE_APPS_PORTAL_URL), + \core\output\notification::NOTIFY_WARNING); + $featuresnotice = $OUTPUT->render($notify); + // Type of login. $temp = new admin_settingpage('mobileauthentication', new lang_string('mobileauthentication', 'tool_mobile')); $options = array( @@ -74,6 +80,8 @@ if ($hassiteconfig) { // Appearance related settings. $temp = new admin_settingpage('mobileappearance', new lang_string('mobileappearance', 'tool_mobile')); + $temp->add(new admin_setting_heading('tool_mobile/moodleappsportalfeaturesappearance', '', $featuresnotice)); + $temp->add(new admin_setting_configtext('mobilecssurl', new lang_string('mobilecssurl', 'tool_mobile'), new lang_string('configmobilecssurl', 'tool_mobile'), '', PARAM_URL)); @@ -106,6 +114,8 @@ if ($hassiteconfig) { // Features related settings. $temp = new admin_settingpage('mobilefeatures', new lang_string('mobilefeatures', 'tool_mobile')); + $temp->add(new admin_setting_heading('tool_mobile/moodleappsportalfeatures', '', $featuresnotice)); + $temp->add(new admin_setting_heading('tool_mobile/logout', new lang_string('logout'), '')); diff --git a/lang/en/admin.php b/lang/en/admin.php index 9370d23bf2b..31bcd058171 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -858,8 +858,9 @@ $string['nosupportedlogstore'] = 'No supported logstore found'; $string['maxtimelimit'] = 'Maximum time limit'; $string['maxtimelimit_desc'] = 'To restrict the maximum PHP execution time that Moodle will allow without any output being displayed, enter a value in seconds here. 0 means that Moodle default restrictions are used. If you have a front-end server with its own time limit, set this value lower to receive PHP errors in logs. Does not apply to CLI scripts.'; $string['moodleapp'] = 'Moodle app'; -$string['moodleapp_help'] = '

If you have an account on a Moodle site, you can access all your courses on your mobile devices with our free mobile app for Moodle.

-Get the Moodle app'; +$string['moodleapp_help'] = '

The free Moodle app enables users to access their courses on mobile devices. Additional app features are available with a Pro or Premium app plan.

+Get the Moodle app
+Moodle Apps Portal'; $string['moodlebrandedapp'] = 'Branded Moodle app'; $string['moodlebrandedapp_help'] = '

The Branded Moodle app has all the functionality of our free mobile app for Moodle combined with your own custom branding.

About the Branded Moodle app'; diff --git a/message/output/airnotifier/lang/en/message_airnotifier.php b/message/output/airnotifier/lang/en/message_airnotifier.php index 8ddb4695e0c..58fcabc63be 100644 --- a/message/output/airnotifier/lang/en/message_airnotifier.php +++ b/message/output/airnotifier/lang/en/message_airnotifier.php @@ -29,15 +29,16 @@ $string['airnotifierport'] = 'Airnotifier port'; $string['airnotifierurl'] = 'Airnotifier URL'; $string['configairnotifierurl'] = 'The server URL to connect to for sending push notifications.'; $string['configairnotifierport'] = 'The port to use when connecting to the airnotifier server.'; -$string['configairnotifieraccesskey'] = 'The access key to use when connecting to the airnotifier server.'; +$string['configairnotifieraccesskey'] = 'The access key for connecting to the Airnotifier server. You can obtain an access key by clicking the "Request access key" link below (registered sites only) or by creating an account on the Moodle Apps Portal.'; $string['configairnotifierappname'] = 'The app name identifier in Airnotifier.'; $string['configairnotifiermobileappname'] = 'The Mobile app unique identifier (usually something like com.moodle.moodlemobile).'; $string['deletecheckdevicename'] = 'Delete your device: {$a->name}'; $string['deletedevice'] = 'Delete the device. Note that an app can register the device again. If the device keeps reappearing, disable it.'; $string['devicetoken'] = 'Device token'; $string['enableprocessor'] = 'Enable mobile notifications'; -$string['errorretrievingkey'] = 'An error occurred while retrieving the access key. Your site must be registered to use this service. If your site is already registered, please try updating your registration.'; -$string['keyretrievedsuccessfully'] = 'Key retrieved successfully'; +$string['errorretrievingkey'] = 'An error occurred while retrieving the access key. Your site must be registered to use this service. If your site is already registered, please try updating your registration. Alternatively, you can obtain an access key by creating an account on the Moodle Apps Portal.'; +$string['keyretrievedsuccessfully'] = 'The access key was retrieved successfully. To access Moodle app usage statistics, please create an account on the Moodle Apps Portal.'; +$string['moodleappsportallimitswarning'] = 'Please note that the number of user devices allowed to receive notifications depends on your Moodle app subscription. For details, visit the Moodle Apps Portal.'; $string['nodevices'] = 'No registered devices. Devices will automatically appear after you install the Moodle app and add this site.'; $string['nopermissiontomanagedevices'] = 'You don\'t have permission to manage devices.'; $string['notconfigured'] = 'The Airnotifier server has not been configured so push notifications cannot be sent.'; @@ -59,7 +60,7 @@ $string['privacy:metadata:userid'] = 'The ID of the user who sent the message.'; $string['privacy:metadata:username'] = 'The username of the user.'; $string['privacy:metadata:usersubsystem'] = 'This plugin is connected to the user subsystem.'; $string['privacy:subcontext'] = 'Message Airnotifier'; -$string['sitemustberegistered'] = 'In order to use the public Airnotifier instance, your site must be registered with Moodle.'; +$string['sitemustberegistered'] = 'In order to use the public Airnotifier instance, your site must be registered. Alternatively, you can obtain an access key by creating an account on the Moodle Apps Portal.'; $string['showhide'] = 'Enable/disable the device.'; $string['requestaccesskey'] = 'Request access key'; $string['unknowndevice'] = 'Unknown device'; diff --git a/message/output/airnotifier/settings.php b/message/output/airnotifier/settings.php index 9206a186d29..b29a5a492e0 100644 --- a/message/output/airnotifier/settings.php +++ b/message/output/airnotifier/settings.php @@ -24,6 +24,12 @@ defined('MOODLE_INTERNAL') || die; if ($ADMIN->fulltree) { + + $notify = new \core\output\notification( + get_string('moodleappsportallimitswarning', 'message_airnotifier'), + \core\output\notification::NOTIFY_WARNING); + $settings->add(new admin_setting_heading('tool_mobile/moodleappsportalfeaturesappearance', '', $OUTPUT->render($notify))); + // The processor should be enabled by the same enable mobile setting. $settings->add(new admin_setting_configtext('airnotifierurl', get_string('airnotifierurl', 'message_airnotifier'),