ILIAS  release_8 Revision v8.24
ILIAS\GlobalScreen\Client\CallbackHandler Class Reference
+ Collaboration diagram for ILIAS\GlobalScreen\Client\CallbackHandler:

Public Member Functions

 __construct ()
 
 run ()
 

Data Fields

const KEY_ITEM = 'item'
 

Protected Attributes

WrapperFactory $wrapper
 
Factory $refinery
 
ilCtrlInterface $ctrl
 
ILIAS GlobalScreen Services $global_screen
 

Private Member Functions

 resolveCallback (isToolItem $item)
 
 getIdentification ()
 

Private Attributes

const TARGET_SCRIPT = "/ilias.php"
 

Detailed Description

Definition at line 29 of file CallbackHandler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\GlobalScreen\Client\CallbackHandler::__construct ( )

Definition at line 41 of file CallbackHandler.php.

42 {
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 }
static initILIAS()
ilias initialisation
global $DIC
Definition: feed.php:28

References $DIC, ILIAS\Repository\ctrl(), ilInitialisation\initILIAS(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ getIdentification()

ILIAS\GlobalScreen\Client\CallbackHandler::getIdentification ( )
private

Definition at line 77 of file CallbackHandler.php.

77 : 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 }

References ILIAS\Repository\refinery().

Referenced by ILIAS\GlobalScreen\Client\CallbackHandler\run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resolveCallback()

ILIAS\GlobalScreen\Client\CallbackHandler::resolveCallback ( isToolItem  $item)
private

Definition at line 69 of file CallbackHandler.php.

69 : \Closure
70 {
71 return $item->hasCloseCallback()
72 ? $item->getCloseCallback()
73 : static function (): void {
74 };
75 }

References ILIAS\GlobalScreen\Scope\Tool\Factory\isToolItem\getCloseCallback(), and ILIAS\GlobalScreen\Scope\Tool\Factory\isToolItem\hasCloseCallback().

Referenced by ILIAS\GlobalScreen\Client\CallbackHandler\run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run()

ILIAS\GlobalScreen\Client\CallbackHandler::run ( )

Definition at line 51 of file CallbackHandler.php.

51 : 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 }

References ILIAS\Repository\ctrl(), ILIAS\GlobalScreen\Client\CallbackHandler\getIdentification(), and ILIAS\GlobalScreen\Client\CallbackHandler\resolveCallback().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrlInterface ILIAS\GlobalScreen\Client\CallbackHandler::$ctrl
protected

Definition at line 38 of file CallbackHandler.php.

◆ $global_screen

ILIAS GlobalScreen Services ILIAS\GlobalScreen\Client\CallbackHandler::$global_screen
protected

Definition at line 39 of file CallbackHandler.php.

◆ $refinery

Factory ILIAS\GlobalScreen\Client\CallbackHandler::$refinery
protected

Definition at line 37 of file CallbackHandler.php.

◆ $wrapper

WrapperFactory ILIAS\GlobalScreen\Client\CallbackHandler::$wrapper
protected

Definition at line 36 of file CallbackHandler.php.

◆ KEY_ITEM

const ILIAS\GlobalScreen\Client\CallbackHandler::KEY_ITEM = 'item'

Definition at line 34 of file CallbackHandler.php.

◆ TARGET_SCRIPT

const ILIAS\GlobalScreen\Client\CallbackHandler::TARGET_SCRIPT = "/ilias.php"
private

Definition at line 33 of file CallbackHandler.php.


The documentation for this class was generated from the following file: