From 17fa366ab3dafa8bd8810f435c301df199b878e0 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 12 May 2016 17:11:08 +0800 Subject: [PATCH] MDL-54550 enrol_lti: show plugin description and warning - 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. --- enrol/lti/lang/en/enrol_lti.php | 3 ++- enrol/lti/settings.php | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/enrol/lti/lang/en/enrol_lti.php b/enrol/lti/lang/en/enrol_lti.php index 3780910f4ce..9d901a6f152 100644 --- a/enrol/lti/lang/en/enrol_lti.php +++ b/enrol/lti/lang/en/enrol_lti.php @@ -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'; @@ -52,7 +53,7 @@ $string['lti:config'] = 'Configure LTI enrol instances'; $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'; diff --git a/enrol/lti/settings.php b/enrol/lti/settings.php index 444ca3f5c5e..bec00c55da7 100644 --- a/enrol/lti/settings.php +++ b/enrol/lti/settings.php @@ -26,8 +26,13 @@ defined('MOODLE_INTERNAL') || die; 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'), @@ -35,6 +40,9 @@ if ($ADMIN->fulltree) { $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'));