$role = lti_get_ims_role($USER, $instance->cmid, $instance->course);
- $locale = $course->lang;
- if ( strlen($locale) < 1 ) {
- $locale = $CFG->lang;
- }
-
$requestparams = array(
'resource_link_id' => $instance->id,
'resource_link_title' => $instance->name,
'context_id' => $course->id,
'context_label' => $course->shortname,
'context_title' => $course->fullname,
- 'launch_presentation_locale' => $locale,
+ 'launch_presentation_locale' => current_language()
);
$placementsecret = $instance->servicesalt;
}
function lti_get_tool_table($tools, $id) {
- global $CFG, $USER;
+ global $CFG, $OUTPUT, $USER;
$html = '';
$typename = get_string('typename', 'lti');
$update = get_string('update', 'lti');
$delete = get_string('delete', 'lti');
- $accepthtml = "
- <a class=\"editing_accept\" href=\"{$CFG->wwwroot}/mod/lti/typessettings.php?action=accept&id={$type->id}&sesskey={$USER->sesskey}&tab={$id}\" title=\"{$accept}\">
- <img class=\"iconsmall\" alt=\"{$accept}\" src=\"{$CFG->wwwroot}/pix/t/clear.gif\"/>
- </a>
- ";
+ $baseurl = new moodle_url('/mod/lti/typessettings.php', array(
+ 'action' => 'accept',
+ 'id' => $type->id,
+ 'sesskey' => sesskey(),
+ 'tab' => $id
+ ));
+
+ $accepthtml = $OUTPUT->action_icon($baseurl,
+ new pix_icon('t/check', $accept, '', array('class' => 'iconsmall')), null,
+ array('title' => $accept, 'class' => 'editing_accept'));
$deleteaction = 'delete';
$delete = get_string('reject', 'lti');
}
+ $updateurl = clone($baseurl);
+ $updateurl->param('action', 'update');
+ $updatehtml = $OUTPUT->action_icon($updateurl,
+ new pix_icon('t/edit', $accept, '', array('class' => 'iconsmall')), null,
+ array('title' => $update, 'class' => 'editing_update'));
+
+ $deleteurl = clone($baseurl);
+ $deleteurl->param('action', $deleteaction);
+ $deletehtml = $OUTPUT->action_icon($deleteurl,
+ new pix_icon('t/delete', $accept, '', array('class' => 'iconsmall')), null,
+ array('title' => $delete, 'class' => 'editing_delete'));
$html .= "
<tr>
<td>
{$date}
</td>
<td align=\"center\">
- {$accepthtml}
- <a class=\"editing_update\" href=\"{$CFG->wwwroot}/mod/lti/typessettings.php?action=update&id={$type->id}&sesskey={$USER->sesskey}&tab={$id}\" title=\"{$update}\">
- <img class=\"iconsmall\" alt=\"{$update}\" src=\"{$CFG->wwwroot}/pix/t/edit.gif\"/>
- </a>
- <a class=\"editing_delete\" href=\"{$CFG->wwwroot}/mod/lti/typessettings.php?action={$deleteaction}&id={$type->id}&sesskey={$USER->sesskey}&tab={$id}\" title=\"{$delete}\">
- <img class=\"iconsmall\" alt=\"{$delete}\" src=\"{$CFG->wwwroot}/pix/t/delete.gif\"/>
- </a>
+ {$accepthtml}{$updatehtml}{$deletehtml}
</td>
</tr>
";
//If no cmid is passed, check if the user is a teacher in the course
//This allows other modules to programmatically "fake" a launch without
//a real LTI instance
- $coursecontext = get_context_instance(CONTEXT_COURSE, $courseid);
+ $coursecontext = context_course::instance($courseid);
if (has_capability('moodle/course:manageactivities', $coursecontext)) {
array_push($roles, 'Instructor');
array_push($roles, 'Learner');
}
} else {
- $context = get_context_instance(CONTEXT_MODULE, $cmid);
+ $context = context_module::instance($cmid);
if (has_capability('mod/lti:manage', $context)) {
array_push($roles, 'Instructor');