50 $this->lng = $DIC->language();
51 $this->
user = $DIC->user();
63 $command = $DIC->ctrl()->getCmd(self::CMD_LAUNCH);
88 if ($this->dic->access()->checkAccess(
'read',
'', $this->object->getRefId())) {
89 if ($this->object->isLaunchMethodEmbedded()) {
90 $tpl =
new ilTemplate(
'tpl.lti_content.html',
true,
true,
'Modules/LTIConsumer');
91 $tpl->setVariable(
"EMBEDDED_IFRAME_SRC", $this->dic->ctrl()->getLinkTarget(
93 self::CMD_SHOW_EMBEDDED
95 $this->dic->ui()->mainTemplate()->setContent(
$tpl->get());
104 if ($this->object->getOfflineStatus() ||
105 $this->
object->isLaunchMethodEmbedded() ||
111 $this->object->getId(),
112 $this->
user->getId(),
113 $this->
object->getProvider()->getPrivacyIdent()
116 if ($user_ident ==
'' || $user_ident == null) {
122 $context = $ilLTIConsumerLaunch->getContext();
123 $contextType = $ilLTIConsumerLaunch::getLTIContextType($context[
"type"]);
124 $contextId = $context[
"id"];
125 $contextTitle = $context[
"title"];
128 $this->dic->user()->getId(),
129 $this->
object->getRefId(),
130 $this->
object->getId()
133 $returnUrl = !$this->
object->isLaunchMethodOwnWin() ?
'' : str_replace(
136 ILIAS_HTTP_PATH .
"/" . $this->dic->ctrl()->getLinkTarget($this,
"",
"",
false)
139 $launchParameters = $this->
object->buildLaunchParameters(
148 $target = $this->
object->getLaunchMethod() ==
"newWin" ?
"_blank" :
"_self";
149 $button =
'<input class="btn btn-default ilPre" type="button" onClick="ltilaunch()" value = "' . $this->lng->txt(
"show_content") .
'" />';
150 $output =
'<form id="lti_launch_form" name="lti_launch_form" action="' . $this->
object->getProvider()->getProviderUrl() .
'" method="post" target="' . $target .
'" encType="application/x-www-form-urlencoded">';
151 foreach ($launchParameters as $field => $value) {
152 $output .= sprintf(
'<input type="hidden" name="%s" value="%s" />', $field, $value) .
"\n";
155 $output .=
'</form>';
156 $output .=
'<span id ="lti_launched" style="display:none">' . $this->lng->txt(
"launched") .
'</span>';
157 $output .=
'<script type="text/javascript"> 158 function ltilaunch() { 159 document.lti_launch_form.submit(); 160 document.getElementById("lti_launch_form").style.display = "none"; 161 document.getElementById("lti_launched").style.display = "inline"; 169 $tpl =
new ilTemplate(
'tpl.lti_embedded.html',
true,
true,
'Modules/LTIConsumer');
172 $tpl->setCurrentBlock(
'launch_parameter');
173 $tpl->setVariable(
'LAUNCH_PARAMETER', $field);
174 $tpl->setVariable(
'LAUNCH_PARAM_VALUE', $value);
175 $tpl->parseCurrentBlock();
179 $tpl->setVariable(
"DELOS_CSS_HREF",
'templates/default/delos.css' . $v);
180 $tpl->setVariable(
"JQUERY_SRC",
'libs/bower/bower_components/jquery/dist/jquery.js' . $v);
183 $tpl->setVariable(
'LAUNCH_URL', $this->object->getProvider()->getProviderUrl());
185 #$DIC->ui()->mainTemplate()->getStandardTemplate(); 186 #$DIC->ui()->mainTemplate()->setContent($tpl->get()); 195 $launchContext = $ilLTIConsumerLaunch->
getContext();
198 $launchContextId = $launchContext[
"id"];
199 $launchContextTitle = $launchContext[
"title"];
202 $this->dic->user()->getId(),
203 $this->
object->getRefId(),
204 $this->
object->getId()
207 return $this->
object->buildLaunchParameters(
220 if ($DIC->ctrl()->getNextClass() != strtolower(self::class)) {
224 if ($DIC->ctrl()->getCmd() != self::CMD_SHOW_EMBEDDED) {
235 $this->cmixUser =
new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId(), $this->
object->getProvider()->getPrivacyIdent());
237 if ($user_ident ==
'' || $user_ident == null) {
239 $this->cmixUser->setUsrIdent($user_ident);
240 $this->cmixUser->save();
const ILIAS_VERSION_NUMERIC
static isEmbeddedLaunchRequest()
static getLTIContextType($a_type)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
__construct(ilObjLTIConsumer $object)
static fillToken($usrId, $refId, $objId, $lrsTypeId=0)
static getIdent($userIdentMode, ilObjUser $user)
getContext($a_valid_types=array('crs', 'grp', 'cat', 'root'))
get info about the context in which the link is used
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl