ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
◀ ilDoc Overview
ltitoolregistration.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
29
require_once
'../vendor/composer/vendor/autoload.php'
;
30
require_once __DIR__ .
'/../artifacts/bootstrap_default.php'
;
31
entry_point
(
'ILIAS Legacy Initialisation Adapter'
);
32
33
ilContext::init
(
ilContext::CONTEXT_SCORM
);
34
35
global
$DIC
;
36
37
$request
=
$DIC
->http()->request();
38
$body
=
$request
->getParsedBody();
39
$parameters
= array_merge(
$request
->getQueryParams(), is_array(
$body
) ?
$body
: []);
40
41
$log
=
$DIC
->logger()->forComponent(
'lti'
);
42
[$registered, $reason] =
new
ilLTIAdvantageToolRegistration
()->
register
(
$parameters
);
43
if
(!$registered) {
44
$log
->warning(
'LTI Advantage Dynamic Registration of ILIAS failed: '
. $reason);
45
}
46
47
$lng
=
$DIC
->language();
48
$lng
->loadLanguageModule(
'lti'
);
49
$message
= htmlspecialchars(
$lng
->txt($registered ?
'lti_dyn_reg_tool_done'
:
'lti_dyn_reg_tool_failed'
), ENT_QUOTES);
50
$close
= htmlspecialchars(
$lng
->txt(
'close'
), ENT_QUOTES);
51
$page
=
'<!DOCTYPE html><html lang="'
. htmlspecialchars(
$lng
->getLangKey(), ENT_QUOTES) .
'"><head><meta charset="utf-8">'
52
.
'<title>ILIAS</title></head><body style="font-family: sans-serif"><p>'
.
$message
.
'</p>'
53
. ($registered ?
''
:
'<p>'
. htmlspecialchars($reason, ENT_QUOTES) .
'</p>'
)
54
.
'<button type="button" onclick="(window.opener || window.parent).postMessage({subject: \'org.imsglobal.lti.close\'}, \'*\');">'
55
.
$close
.
'</button></body></html>'
;
56
57
ilLTIResponse::send
($registered ? 200 : 400,
ilLTIResponse::CONTENT_TYPE_HTML
,
$page
, [
'Cache-Control'
=>
'no-store'
]);
ilContext\CONTEXT_SCORM
const CONTEXT_SCORM
Definition:
ilContext.php:42
ilContext\init
static init(string $a_type)
Init context by type.
Definition:
ilContext.php:52
ilLTIAdvantageToolRegistration
LTI Advantage Dynamic Registration of ILIAS as tool with a platform of the administration.
Definition:
class.ilLTIAdvantageToolRegistration.php:46
ilLTIAdvantageToolRegistration\register
register(array $parameters)
Registers ILIAS with the platform that opened the registration URL.
Definition:
class.ilLTIAdvantageToolRegistration.php:101
ilLTIResponse\CONTENT_TYPE_HTML
const string CONTENT_TYPE_HTML
Definition:
class.ilLTIResponse.php:33
$page
$page
Definition:
ltitoolregistration.php:51
$body
$body
Definition:
ltitoolregistration.php:38
$DIC
global $DIC
Definition:
ltitoolregistration.php:35
$close
$close
Definition:
ltitoolregistration.php:50
$lng
if(! $registered) $lng
Definition:
ltitoolregistration.php:47
$log
$log
Definition:
ltitoolregistration.php:41
$parameters
$parameters
Definition:
ltitoolregistration.php:39
$request
$request
Definition:
ltitoolregistration.php:37
$message
$message
Definition:
ltitoolregistration.php:49
entry_point
entry_point(string $name)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
result1.php:21
send
catch(ilCmiXapiException $e) send($response)
Definition:
xapitoken.php:99
components
ILIAS
LTI
resources
ltitoolregistration.php
Generated on Wed Nov 11 2026 23:08:06 for ILIAS by
1.9.4 (using
Doxyfile
)