Skip to content

Commit

Permalink
feat lti platform: fix rendering: when mimetype of lti_tool_node is i…
Browse files Browse the repository at this point in the history
…mage/jpeg a non lti module was used. for rendering with iframe use launchPresentation = iframe
  • Loading branch information
Daniel Rudolph committed Dec 9, 2022
1 parent 619d1fb commit 8222b94
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/main/php/modules/url/mod_url.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 = '';
Expand Down Expand Up @@ -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);
Expand All @@ -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))
Expand Down Expand Up @@ -214,8 +214,15 @@ protected function getImageEmbedding($footer = '')

protected function getLti13ToolEmbedding($footer = ''){
return '<div>
<iframe src="'. $this->getUrl().'&editMode=false" style="max-width: 100%;width:100%;height: 100%;"></iframe>
<iframe src="'. $this->getUrl().'&editMode=false&launchPresentation=iframe" style="max-width: 100%;width:100%;height: 100%;"></iframe>
' . $footer . '</div>';

/**
* protected function getLti13ToolEmbedding($footer = ''){
return '<div> <iframe src="'. $this->getUrl().'&editMode=false" style="max-width: 100%;width:100%;height: 100%;" onLoad="this.style.height=contentWindow.document.documentElement.scrollHeigh>
}
*/
}

protected function getVideoEmbedding($width = NULL, $footer = '') {
Expand Down

0 comments on commit 8222b94

Please sign in to comment.