ILIAS
release_10 Revision v10.1-43-ga1241a92c2f
◀ ilDoc Overview
CallbackHandler.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
20
namespace
ILIAS\GlobalScreen\Client
;
21
22
use
ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher
;
23
use
ILIAS\GlobalScreen\Scope\Tool\Factory\isToolItem
;
24
use
ilInitialisation
;
25
use
ILIAS\HTTP\Wrapper\WrapperFactory
;
26
use
ILIAS\Refinery\Factory
;
27
use
ILIAS\GlobalScreen\Identification\IdentificationInterface
;
28
29
class
CallbackHandler
30
{
31
use
Hasher
;
32
33
private
const
TARGET_SCRIPT
=
"/ilias.php"
;
34
public
const
KEY_ITEM
=
'item'
;
35
36
protected
WrapperFactory
$wrapper
;
37
protected
Factory
$refinery
;
38
protected \ilCtrlInterface
$ctrl
;
39
protected \ILIAS\GlobalScreen\Services
$global_screen
;
40
41
public
function
__construct
()
42
{
43
ilInitialisation::initILIAS
();
44
global
$DIC
;
45
$this->
ctrl
= $DIC->ctrl();
46
$this->wrapper = $DIC->http()->wrapper();
47
$this->
refinery
= $DIC->refinery();
48
$this->global_screen = $DIC->globalScreen();
49
}
50
51
public
function
run
(): void
52
{
53
$this->
ctrl
->setTargetScript(self::TARGET_SCRIPT);
54
55
$this->global_screen->collector()
56
->tool()
57
->collectOnce();
58
59
$item = $this->global_screen->collector()
60
->tool()
61
->getSingleItem($this->
getIdentification
());
62
63
if
($item instanceof isToolItem) {
64
$callback = $this->
resolveCallback
($item);
65
$callback();
66
}
67
}
68
69
private
function
resolveCallback
(isToolItem $item): \
Closure
70
{
71
return
$item->hasCloseCallback()
72
? $item->getCloseCallback()
73
:
static
function
():
void
{
74
};
75
}
76
77
private
function
getIdentification
(): IdentificationInterface
78
{
79
$hashed = $this->wrapper->query()->has(self::KEY_ITEM)
80
? $this->wrapper->query()->retrieve(self::KEY_ITEM, $this->
refinery
->to()->string())
81
:
''
;
82
83
$unhashed = $this->unhash($hashed);
84
85
return
$this->global_screen->identification()->fromSerializedIdentification($unhashed);
86
}
87
}
GuzzleHttp\Client\CallbackHandler
Definition:
CallbackHandler.php:29
GuzzleHttp\Client\CallbackHandler\getIdentification
getIdentification()
Definition:
CallbackHandler.php:77
ILIAS\GlobalScreen\Client
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
callback_handler.php:3
Closure
GuzzleHttp\Client\CallbackHandler\TARGET_SCRIPT
const TARGET_SCRIPT
Definition:
CallbackHandler.php:33
Hasher
GuzzleHttp\Client\CallbackHandler\__construct
__construct()
Definition:
CallbackHandler.php:41
ILIAS\Repository\refinery
refinery()
Definition:
trait.GlobalDICDomainServices.php:76
ILIAS\Repository\ctrl
ctrl()
Definition:
trait.GlobalDICGUIServices.php:63
ilInitialisation\initILIAS
static initILIAS()
ilias initialisation
Definition:
class.ilInitialisation.php:1153
GuzzleHttp\Client\CallbackHandler\resolveCallback
resolveCallback(isToolItem $item)
Definition:
CallbackHandler.php:69
ilInitialisation
IdentificationInterface
Factory
$DIC
global $DIC
Definition:
shib_login.php:25
GuzzleHttp\Client\CallbackHandler\run
run()
Definition:
CallbackHandler.php:51
GuzzleHttp\Client\CallbackHandler\$global_screen
ILIAS GlobalScreen Services $global_screen
Definition:
CallbackHandler.php:39
GuzzleHttp\Client\CallbackHandler\KEY_ITEM
const KEY_ITEM
Definition:
CallbackHandler.php:34
isToolItem
GuzzleHttp\Client\CallbackHandler\$refinery
Factory $refinery
Definition:
CallbackHandler.php:37
Hasher
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
WrapperFactory
GuzzleHttp\Client\CallbackHandler\$ctrl
ilCtrlInterface $ctrl
Definition:
CallbackHandler.php:38
GuzzleHttp\Client\CallbackHandler\$wrapper
WrapperFactory $wrapper
Definition:
CallbackHandler.php:36
components
ILIAS
GlobalScreen
src
Client
CallbackHandler.php
Generated on Wed Sep 10 2025 15:15:40 for ILIAS by
1.8.13 (using
Doxyfile
)