ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
storeScorm.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21require_once __DIR__ . "/../vendor/composer/vendor/autoload.php";
22
25
26global $DIC;
27$packageId = $DIC->http()->wrapper()->query()->retrieve('package_id', $DIC->refinery()->kindlyTo()->int());
28
29$doUnload = false;
30if ($DIC->http()->wrapper()->query()->has('do')) {
31 if ($DIC->http()->wrapper()->query()->retrieve('do', $DIC->refinery()->kindlyTo()->string()) == "unload") {
32 $doUnload = true;
33 }
34}
35
36if ($doUnload) {
37 $p = $DIC->http()->wrapper()->query()->retrieve('p', $DIC->refinery()->kindlyTo()->int());
38 $hash = $DIC->http()->wrapper()->query()->retrieve('hash', $DIC->refinery()->kindlyTo()->int());
41} else {
42 global $ilUser;
43 $data = json_decode(file_get_contents('php://input'));
44 $ilUser->setId((int) $data->p);
47}
const CONTEXT_SCORM
static init(string $a_type)
Init context by type.
static initILIAS()
ilias initialisation
static checkIfAllowed(int $packageId, int $userId, int $hash)
$packageId
Definition: storeScorm.php:27
global $DIC
Definition: storeScorm.php:26
$data
Definition: storeScorm.php:43
$doUnload
Definition: storeScorm.php:29