mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
Merge branch 'MDL-55457-master' of https://github.com/xow/moodle
This commit is contained in:
commit
2ab5bbc409
1 changed files with 15 additions and 4 deletions
|
@ -152,6 +152,17 @@ class toolproxy extends \mod_lti\local\ltiservice\resource_base {
|
||||||
foreach ($resources as $resource) {
|
foreach ($resources as $resource) {
|
||||||
$found = false;
|
$found = false;
|
||||||
$tool = new \stdClass();
|
$tool = new \stdClass();
|
||||||
|
|
||||||
|
$iconinfo = null;
|
||||||
|
if (is_array($resource->icon_info)) {
|
||||||
|
$iconinfo = $resource->icon_info[0];
|
||||||
|
} else {
|
||||||
|
$iconinfo = $resource->icon_info;
|
||||||
|
}
|
||||||
|
if (isset($iconinfo) && isset($iconinfo->default_location) && isset($iconinfo->default_location->path)) {
|
||||||
|
$tool->iconpath = $iconinfo->default_location->path;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($resource->message as $message) {
|
foreach ($resource->message as $message) {
|
||||||
if ($message->message_type == 'basic-lti-launch-request') {
|
if ($message->message_type == 'basic-lti-launch-request') {
|
||||||
$found = true;
|
$found = true;
|
||||||
|
@ -197,13 +208,13 @@ class toolproxy extends \mod_lti\local\ltiservice\resource_base {
|
||||||
$type->enabledcapability = implode("\n", $tool->enabled_capability);
|
$type->enabledcapability = implode("\n", $tool->enabled_capability);
|
||||||
$type->parameter = self::lti_extract_parameters($tool->parameter);
|
$type->parameter = self::lti_extract_parameters($tool->parameter);
|
||||||
|
|
||||||
if (isset($resource->icon_info[0]->default_location->path)) {
|
if (!empty($tool->iconpath)) {
|
||||||
$iconpath = $resource->icon_info[0]->default_location->path;
|
$type->icon = "{$baseurl}{$tool->iconpath}";
|
||||||
$type->icon = "{$baseurl}{$iconpath}";
|
|
||||||
if (!empty($securebaseurl)) {
|
if (!empty($securebaseurl)) {
|
||||||
$type->secureicon = "{$securebaseurl}{$iconpath}";
|
$type->secureicon = "{$securebaseurl}{$tool->iconpath}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ok = $ok && (lti_add_type($type, $config) !== false);
|
$ok = $ok && (lti_add_type($type, $config) !== false);
|
||||||
}
|
}
|
||||||
if (isset($toolproxyjson->custom)) {
|
if (isset($toolproxyjson->custom)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue