Skip to content

Commit

Permalink
MDL-68293 mobile: Update language strings to mention new app plans
Browse files Browse the repository at this point in the history
We need to update different language strings to let our site admins know about the new app restrictions
(for both features and user devices able to receive notifications)
  • Loading branch information
jleyva committed Apr 16, 2020
1 parent 49f07dc commit dcc4bfa
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
2 changes: 2 additions & 0 deletions admin/tool/mobile/classes/api.php
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions admin/tool/mobile/lang/en/tool_mobile.php
Expand Up @@ -91,6 +91,7 @@
$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 <a href="{$a}" target="_blank">Moodle Apps Portal</a>.';
$string['oauth2identityproviders'] = 'OAuth 2 identity providers';
$string['offlineuse'] = 'Offline use';
$string['pluginname'] = 'Moodle app tools';
Expand Down
10 changes: 10 additions & 0 deletions admin/tool/mobile/settings.php
Expand Up @@ -50,6 +50,12 @@

// 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(
Expand All @@ -74,6 +80,8 @@
// 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));

Expand Down Expand Up @@ -106,6 +114,8 @@
// 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'), ''));

Expand Down
5 changes: 3 additions & 2 deletions lang/en/admin.php
Expand Up @@ -849,8 +849,9 @@
$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'] = '<p>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.</p>
<a href="https://moodle.com/mobile-app">Get the Moodle app</a>';
$string['moodleapp_help'] = '<p>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.</p>
<a href="https://moodle.com/mobile-app">Get the Moodle app</a><br />
<a href="https://apps.moodle.com">Moodle Apps Portal</a>';
$string['moodlebrandedapp'] = 'Branded Moodle app';
$string['moodlebrandedapp_help'] = '<p>The Branded Moodle app has all the functionality of our free mobile app for Moodle combined with your own custom branding.</p>
<a href="https://moodle.com/branded-app">About the Branded Moodle app</a>';
Expand Down
9 changes: 5 additions & 4 deletions message/output/airnotifier/lang/en/message_airnotifier.php
Expand Up @@ -29,14 +29,15 @@
$string['airnotifierurl'] = 'Airnotifier URL';
$string['configairnotifierurl'] = 'The server url to connect to to send 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 <a href="https://apps.moodle.com">Moodle Apps Portal</a>.';
$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['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 <a href="https://apps.moodle.com">Moodle Apps Portal</a>.';
$string['keyretrievedsuccessfully'] = 'The access key was retrieved successfully. To access Moodle app usage statistics, please create an account on the <a href="https://apps.moodle.com">Moodle Apps Portal</a>.';
$string['moodleappsportallimitswarning'] = 'Please note that the number of user devices allowed to receive notifications depends on your Moodle app subscription. For details, visit the <a href="{$a}" target="_blank">Moodle Apps Portal</a>.';
$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 hasn\'t been configured so Airnotifier messages cannot be sent';
Expand All @@ -58,7 +59,7 @@
$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 <a href="https://apps.moodle.com">Moodle Apps Portal</a>.';
$string['showhide'] = 'Enable/disable the device.';
$string['requestaccesskey'] = 'Request access key';
$string['unknowndevice'] = 'Unknown device';
Expand Down
6 changes: 6 additions & 0 deletions message/output/airnotifier/settings.php
Expand Up @@ -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'),
Expand Down

0 comments on commit dcc4bfa

Please sign in to comment.