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