Skip to content

Commit

Permalink
MDL-54550 enrol_lti: show plugin description and warning
Browse files Browse the repository at this point in the history
- Updated and added plugin description to the settings page.
- Added warning when the auth_lti plugin is not enabled.
- Moved existing 'Allow frame embedding' warning above the
  'User default values' heading.
  • Loading branch information
mdjnelson committed May 16, 2016
1 parent 65cbefc commit 17fa366
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion enrol/lti/lang/en/enrol_lti.php
Expand Up @@ -23,6 +23,7 @@
*/

$string['allowframembedding'] = 'In order to avoid problems embedding this site, please enable the \'Allow frame embedding\' setting in Admin > Security > HTTP security.';
$string['authltimustbeenabled'] = 'Note: This plugin requires the LTI authentication plugin to be enabled too.';
$string['enrolenddate'] = 'End date';
$string['enrolenddate_help'] = 'If enabled, users can access until this date only.';
$string['enrolenddateerror'] = 'Enrolment end date cannot be earlier than start date';
Expand Down Expand Up @@ -52,7 +53,7 @@
$string['lti:unenrol'] = 'Unenrol users from the course';
$string['opentool'] = 'Open tool';
$string['pluginname'] = 'Shared external tool';
$string['pluginname_desc'] = 'The shared external tool plugin allows externals users to access a course or an activity via a unique link - this requires the LTI authentication plugin to be enabled.';
$string['pluginname_desc'] = 'The \'Publish as LTI tool\' plugin, together with the LTI authentication plugin, allows remote users to access selected courses and activities. In other words, Moodle functions as an LTI tool provider.';
$string['remotesystem'] = 'Remote system';
$string['requirecompletion'] = 'Require the course or activity to be completed before sending the grades';
$string['roleinstructor'] = 'Role for instructor';
Expand Down
12 changes: 10 additions & 2 deletions enrol/lti/settings.php
Expand Up @@ -26,15 +26,23 @@

if ($ADMIN->fulltree) {

$settings->add(new admin_setting_heading('enrol_lti_user_default_values',
get_string('userdefaultvalues', 'enrol_lti'), ''));
$settings->add(new admin_setting_heading('enrol_lti_settings', '', get_string('pluginname_desc', 'enrol_lti')));

if (!is_enabled_auth('lti')) {
$notify = new \core\output\notification(get_string('authltimustbeenabled', 'enrol_lti'),
\core\output\notification::NOTIFY_WARNING);
$settings->add(new admin_setting_heading('enrol_lti_enable_auth_lti', '', $OUTPUT->render($notify)));
}

if (empty($CFG->allowframembedding)) {
$notify = new \core\output\notification(get_string('allowframembedding', 'enrol_lti'),
\core\output\notification::NOTIFY_WARNING);
$settings->add(new admin_setting_heading('enrol_lti_enable_embedding', '', $OUTPUT->render($notify)));
}

$settings->add(new admin_setting_heading('enrol_lti_user_default_values',
get_string('userdefaultvalues', 'enrol_lti'), ''));

$choices = array(0 => get_string('emaildisplayno'),
1 => get_string('emaildisplayyes'),
2 => get_string('emaildisplaycourse'));
Expand Down

0 comments on commit 17fa366

Please sign in to comment.