From 8222b94cb19887a54ba6f692311a454fe2ef7d2e Mon Sep 17 00:00:00 2001 From: Daniel Rudolph Date: Fri, 9 Dec 2022 13:40:54 +0100 Subject: [PATCH] feat lti platform: fix rendering: when mimetype of lti_tool_node is image/jpeg a non lti module was used. for rendering with iframe use launchPresentation = iframe --- src/main/php/modules/url/mod_url.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/php/modules/url/mod_url.php b/src/main/php/modules/url/mod_url.php index b91fd4f5..6ee3d133 100644 --- a/src/main/php/modules/url/mod_url.php +++ b/src/main/php/modules/url/mod_url.php @@ -14,6 +14,8 @@ private function getEmbedding() { $type = $remoteType->getType(); if(Config::get('urlEmbedding')) { $embedding = Config::get('urlEmbedding'); + }else if ($this -> esObject -> isLti13ToolObject()){ + $embedding = $this->getLti13ToolEmbedding(); }else if ($type === RemoteObjectType::$TYPE_VIDEO) { $embedding = $this->getVideoEmbedding(); }else if ($type === RemoteObjectType::$TYPE_AUDIO) { @@ -26,8 +28,6 @@ private function getEmbedding() { $embedding = $this->getH5PEmbedding(); }else if ($type === RemoteObjectType::$TYPE_PREZI) { $embedding = $this->getPreziEmbedding(); - }else if ($this -> esObject -> isLti13ToolObject()){ - $embedding = $this->getLti13ToolEmbedding(); } else{ $embedding = ''; @@ -110,7 +110,9 @@ protected function inline() { if(Config::get('urlEmbedding')) { $embedding = Config::get('urlEmbedding') . $footer; - } else if ($type === RemoteObjectType::$TYPE_VIDEO) { + }else if ($this -> esObject -> isLti13ToolObject()){ + $embedding = $this->getLti13ToolEmbedding(); + }else if ($type === RemoteObjectType::$TYPE_VIDEO) { $embedding = $this -> getVideoEmbedding(mc_Request::fetch('width', 'INT', 600), $footer); }else if ($type === RemoteObjectType::$TYPE_VIDEO) { $embedding = $this->getAudioEmbedding($footer); @@ -122,8 +124,6 @@ protected function inline() { $embedding = $this->getH5PEmbedding($footer); }else if ($type === RemoteObjectType::$TYPE_PREZI) { $embedding = $this->getPreziEmbedding($footer); - }else if ($this -> esObject -> isLti13ToolObject()){ - $embedding = $this->getLti13ToolEmbedding(); }else { $license = $this -> esObject->getLicense(); if (!empty($license)) @@ -214,8 +214,15 @@ protected function getImageEmbedding($footer = '') protected function getLti13ToolEmbedding($footer = ''){ return '
- + ' . $footer . '
'; + + /** + * protected function getLti13ToolEmbedding($footer = ''){ + return '