if (!empty($key) && !empty($secret)) {
$parms = lti_sign_parameters($requestparams, $endpoint, "POST", $key, $secret);
+
+ $endpointurl = new moodle_url($endpoint);
+ $endpointparams = $endpointurl->params();
+
+ // Strip querystring params in endpoint url from $parms to avoid duplication.
+ if (!empty($endpointparams) && !empty($parms)) {
+ foreach (array_keys($endpointparams) as $paramname) {
+ if (isset($parms[$paramname])) {
+ unset($parms[$paramname]);
+ }
+ }
+ }
+
} else {
//If no key and secret, do the launch unsigned.
$parms = $requestparams;
$updateurl = clone($baseurl);
$updateurl->param('action', 'update');
$updatehtml = $OUTPUT->action_icon($updateurl,
- new pix_icon('t/edit', $accept, '', array('class' => 'iconsmall')), null,
+ new pix_icon('t/edit', $update, '', 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,
+ new pix_icon('t/delete', $delete, '', array('class' => 'iconsmall')), null,
array('title' => $delete, 'class' => 'editing_delete'));
$html .= "
<tr>
if ( $pos === false || $pos < 1 ) {
continue;
}
- $key = trim(textlib::substr($line, 0, $pos));
- $val = trim(textlib::substr($line, $pos+1, strlen($line)));
+ $key = trim(core_text::substr($line, 0, $pos));
+ $val = trim(core_text::substr($line, $pos+1, strlen($line)));
$key = lti_map_keyname($key);
$retval['custom_'.$key] = $val;
}
*/
function lti_map_keyname($key) {
$newkey = "";
- $key = textlib::strtolower(trim($key));
+ $key = core_text::strtolower(trim($key));
foreach (str_split($key) as $ch) {
if ( ($ch >= 'a' && $ch <= 'z') || ($ch >= '0' && $ch <= '9') ) {
$newkey .= $ch;
FROM {lti_types_config}
WHERE typeid = :typeid1
UNION ALL
- SELECT 'toolurl' AS name, baseurl AS value
+ SELECT 'toolurl' AS name, " . $DB->sql_compare_text('baseurl', 1333) . " AS value
FROM {lti_types}
WHERE id = :typeid2";
$launchcontainer = LTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS;
}
- $devicetype = get_device_type();
+ $devicetype = core_useragent::get_device_type();
//Scrolling within the object element doesn't work on iOS or Android
//Opening the popup window also had some issues in testing
//For mobile devices, always take up the entire screen to ensure the best experience
- if ($devicetype === 'mobile' || $devicetype === 'tablet' ) {
+ if ($devicetype === core_useragent::DEVICETYPE_MOBILE || $devicetype === core_useragent::DEVICETYPE_TABLET ) {
$launchcontainer = LTI_LAUNCH_CONTAINER_REPLACE_MOODLE_WINDOW;
}