MDL-57300 lti: Rename lti2 as registration url

AMOS BEGIN
CPY [registrationurl,mod_lti],[registrationurl,enrol_lti]
AMOS END
This commit is contained in:
Ankit Agarwal 2016-12-22 11:11:23 +05:30
parent c8b5c793a1
commit 7f38d8f3ee
4 changed files with 33 additions and 21 deletions

View File

@ -69,14 +69,14 @@ class manage_table extends \table_sql {
$this->define_columns(array(
'name',
'lti1',
'lti2',
'launch',
'registration',
'edit'
));
$this->define_headers(array(
get_string('name'),
get_string('lti1', 'enrol_lti'),
get_string('lti2', 'enrol_lti'),
get_string('launchdetails', 'enrol_lti'),
get_string('registrationurl', 'enrol_lti'),
get_string('edit')
));
$this->collapsible(false);
@ -87,6 +87,11 @@ class manage_table extends \table_sql {
$this->ltienabled = enrol_is_enabled('lti');
$this->canconfig = has_capability('moodle/course:enrolconfig', \context_course::instance($courseid));
$this->courseid = $courseid;
// Set help icons.
$launchicon = new \help_icon('launchdetails', 'enrol_lti');
$regicon = new \help_icon('registrationurl', 'enrol_lti');
$this->define_help_for_headers(['1' => $launchicon, '2' => $regicon]);
}
/**
@ -102,12 +107,12 @@ class manage_table extends \table_sql {
}
/**
* Generate the LTI1 column.
* Generate the launch column.
*
* @param \stdClass $tool instance data.
* @return string
*/
public function col_lti1($tool) {
public function col_launch($tool) {
global $OUTPUT;
$url = helper::get_cartridge_url($tool);
@ -119,8 +124,8 @@ class manage_table extends \table_sql {
$data = [
"rows" => [
[ "label" => $toolurllabel, "text" => $toolurl, "id" => "toolurl" ],
[ "label" => $secretlabel, "text" => $secret, "id" => "secret" ],
[ "label" => $toolurllabel, "text" => $toolurl, "id" => "toolurl", "hidelabel" => false ],
[ "label" => $secretlabel, "text" => $secret, "id" => "secret", "hidelabel" => false ],
]
];
@ -129,22 +134,22 @@ class manage_table extends \table_sql {
}
/**
* Generate the LTI2 column.
* Generate the Registration column.
*
* @param \stdClass $tool instance data.
* @return string
*/
public function col_lti2($tool) {
public function col_registration($tool) {
global $OUTPUT;
$url = helper::get_proxy_url($tool);
$toolurllabel = get_string('toolurl', 'enrol_lti');
$toolurllabel = get_string("registrationurl", "enrol_lti");
$toolurl = $url;
$data = [
"rows" => [
[ "label" => $toolurllabel, "text" => $toolurl, "id" => "toolurl" ],
[ "label" => $toolurllabel, "text" => $toolurl, "id" => "toolurl" , "hidelabel" => true],
]
];
@ -152,7 +157,6 @@ class manage_table extends \table_sql {
return $return;
}
/**
* Generate the edit column.
*

View File

@ -99,7 +99,9 @@ if ($action) {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('toolsprovided', 'enrol_lti'));
echo "<p>" . get_string('toolsprovided_help', 'enrol_lti') . "</p>";
echo "<p>" .get_string('toolsprovided_help', 'enrol_lti') . "</p>";
echo "<p class=helplink>" . $OUTPUT->doc_link('enrol/lti/index',
get_string('morehelp')) ."</p>";
if (\enrol_lti\helper::count_lti_tools(array('courseid' => $courseid)) > 0) {
$table = new \enrol_lti\manage_table($courseid);

View File

@ -55,14 +55,16 @@ $string['membersyncmodeenrolandunenrol'] = 'Enrol new and unenrol missing users'
$string['membersyncmodeenrolnew'] = 'Enrol new users';
$string['membersyncmodeunenrolmissing'] = 'Unenrol missing users';
$string['notoolsprovided'] = 'No tools provided';
$string['lti1'] = 'LTI 1';
$string['lti2'] = 'LTI 2';
$string['launchdetails'] = 'Launch details';
$string['launchdetails_help'] = 'A tool URL (also called launch URL, cartridge URL or configuration URL) plus secret are required for configuring the tool.';
$string['lti:config'] = 'Configure \'Publish as LTI tool\' instances';
$string['lti:unenrol'] = 'Unenrol users from the course';
$string['opentool'] = 'Open tool';
$string['pluginname'] = 'Publish as LTI tool';
$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['registration'] = 'Published tool registration';
$string['registrationurl'] = 'Registration URL';
$string['registrationurl_help'] = 'If a registration URL (also called proxy URL) is used, then the tool is automatically configured.';
$string['remotesystem'] = 'Remote system';
$string['requirecompletion'] = 'Require course or activity completion prior to grade synchronisation';
$string['returnurlnotset'] = 'Return URL was not set.';
@ -77,7 +79,7 @@ $string['successfulregistration'] = 'Successful registration';
$string['tasksyncgrades'] = 'Publish as LTI tool grade sync';
$string['tasksyncmembers'] = 'Publish as LTI tool users sync';
$string['toolsprovided'] = 'Published tools';
$string['toolsprovided_help'] = 'This is the information you need to paste into any system to add these tools. In other systems the Tool URL may be referred to as a configuration URL or a web link.';
$string['toolsprovided_help'] = 'A tool may be shared with another site by providing either launch details or a registration URL.';
$string['tooltobeprovided'] = 'Tool to be published';
$string['toolurl'] = 'Tool URL';
$string['userdefaultvalues'] = 'User default values';

View File

@ -26,7 +26,7 @@
* none
Context variables required for this template:
* rows An array of objects with label, text and id
* rows An array of objects with label, hidelabel, text and id
Example context (json):
{
@ -34,19 +34,23 @@
{
"label": "Tool URL",
"text": "http://example.com/",
"id": "toolurl"
"id": "toolurl",
"hidelabel": false
},
{
"label": "Secret",
"text": "ABCDEF1234567890",
"id": "secret"
"id": "secret",
"hidelabel": true
}
]
}
}}
{{#rows}}
<div>
<label style="display: inline-block; width: 5em" {{#id}}for={{#quote}}{{{id}}}-{{{uniqid}}}{{/quote}}{{/id}}>{{label}}</label>
<label style="display: inline-block; width: 5em"
{{#id}}for={{#quote}}{{{id}}}-{{{uniqid}}}{{/quote}}{{/id}} {{#hidelabel}}
class="accesshide"{{/hidelabel}}>{{label}}</label>
<div style="display: inline-block">{{> core/copy_box }}</div>
</div>
{{/rows}}