ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilBTControllerGUI Class Reference

Class ilBTControllerGUI. More...

+ Inheritance diagram for ilBTControllerGUI:
+ Collaboration diagram for ilBTControllerGUI:

Public Member Functions

 executeCommand ()
 

Static Public Member Functions

static hash ($url)
 
static unhash ($url)
 

Data Fields

const FROM_URL = 'from_url'
 
const OBSERVER_ID = 'observer_id'
 
const SELECTED_OPTION = 'selected_option'
 
const CMD_ABORT = 'abortBucket'
 
const CMD_REMOVE = 'abortBucket'
 
const CMD_USER_INTERACTION = 'userInteraction'
 
const IS_ASYNC = 'bt_task_is_async'
 
const CMD_GET_REPLACEMENT_ITEM = "getAsyncReplacementItem"
 

Protected Member Functions

 userInteraction ()
 
 abortBucket ()
 
 getAsyncReplacementItem ()
 Loads one single aggregate notification item representing a button async to replace an existing one. More...
 
 getFromURL ()
 

Detailed Description

Member Function Documentation

◆ abortBucket()

ilBTControllerGUI::abortBucket ( )
protected

Definition at line 80 of file class.ilBTControllerGUI.php.

80 : void
81 {
82 $observer_id = (int) $this->http()->request()->getQueryParams()[self::OBSERVER_ID];
83 $from_url = $this->getFromURL();
84
85 $bucket = $this->dic()->backgroundTasks()->persistence()->loadBucket($observer_id);
86
87 $this->dic()->backgroundTasks()->taskManager()->quitBucket($bucket);
88 if ($this->http()->request()->getQueryParams()[self::IS_ASYNC] === "true") {
89 exit;
90 }
91 $this->ctrl()->redirectToURL($from_url);
92 }
exit
static http()
Fetches the global http state from ILIAS.

References ILIAS\Repository\ctrl(), exit, getFromURL(), ILIAS\FileDelivery\http(), ILIAS\Repository\int(), and OBSERVER_ID.

Referenced by executeCommand().

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

◆ executeCommand()

ilBTControllerGUI::executeCommand ( )

Definition at line 41 of file class.ilBTControllerGUI.php.

41 : void
42 {
43 $cmd = $this->ctrl()->getCmd();
44 switch ($cmd) {
47 break;
49 $this->userInteraction();
50 break;
51 case self::CMD_ABORT:
53 $this->abortBucket();
54 break;
55 default:
56 break;
57 }
58 }
getAsyncReplacementItem()
Loads one single aggregate notification item representing a button async to replace an existing one.

References abortBucket(), CMD_ABORT, CMD_GET_REPLACEMENT_ITEM, CMD_REMOVE, CMD_USER_INTERACTION, ILIAS\Repository\ctrl(), getAsyncReplacementItem(), and userInteraction().

+ Here is the call graph for this function:

◆ getAsyncReplacementItem()

ilBTControllerGUI::getAsyncReplacementItem ( )
protected

Loads one single aggregate notification item representing a button async to replace an existing one.

Definition at line 99 of file class.ilBTControllerGUI.php.

99 : void
100 {
101 $observer_id = (int) $this->http()->request()->getQueryParams()[self::OBSERVER_ID];
102 $bucket = $this->dic()->backgroundTasks()->persistence()->loadBucket($observer_id);
103
104 $item_source = new ilBTPopOverGUI($this->dic());
105 $this->dic()->language()->loadLanguageModule('background_tasks');
106 $item = $item_source->getItemForObserver($bucket);
107 echo $this->dic()->ui()->renderer()->renderAsync($item);
108 exit;
109 }
Class ilBTPopOverGUI.

References exit, ILIAS\FileDelivery\http(), ILIAS\Repository\int(), and OBSERVER_ID.

Referenced by executeCommand().

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

◆ getFromURL()

ilBTControllerGUI::getFromURL ( )
protected

Definition at line 112 of file class.ilBTControllerGUI.php.

112 : string
113 {
114 return self::unhash($this->http()->request()->getQueryParams()[self::FROM_URL]);
115 }

References ILIAS\FileDelivery\http(), and unhash().

Referenced by abortBucket(), and userInteraction().

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

◆ hash()

static ilBTControllerGUI::hash (   $url)
static
Parameters
$url

Definition at line 121 of file class.ilBTControllerGUI.php.

121 : string
122 {
123 return base64_encode((string) $url);
124 }
$url
Definition: shib_logout.php:68

References $url.

Referenced by ilBTPopOverGUI\addFromUrlToNextRequest().

+ Here is the caller graph for this function:

◆ unhash()

static ilBTControllerGUI::unhash (   $url)
static
Parameters
$url

Definition at line 130 of file class.ilBTControllerGUI.php.

130 : string
131 {
132 return base64_decode((string) $url);
133 }

References $url.

Referenced by getFromURL().

+ Here is the caller graph for this function:

◆ userInteraction()

ilBTControllerGUI::userInteraction ( )
protected

Definition at line 61 of file class.ilBTControllerGUI.php.

61 : void
62 {
63 $observer_id = (int) $this->http()->request()->getQueryParams()[self::OBSERVER_ID];
64 $selected_option = $this->http()->request()->getQueryParams()[self::SELECTED_OPTION];
65 $from_url = $this->getFromURL();
66
67 $observer = $this->dic()->backgroundTasks()->persistence()->loadBucket($observer_id);
68 if ($observer->getUserId() !== $this->user()->getId()) {
69 return;
70 }
71 $option = new UserInteractionOption("", $selected_option);
72 $this->dic()->backgroundTasks()->taskManager()->continueTask($observer, $option);
73 if ($this->http()->request()->getQueryParams()[self::IS_ASYNC] === "true") {
74 $this->http()->close();
75 }
76 $this->ctrl()->redirectToURL($from_url);
77 }

References ILIAS\Repository\ctrl(), getFromURL(), ILIAS\FileDelivery\http(), ILIAS\Repository\int(), OBSERVER_ID, and SELECTED_OPTION.

Referenced by executeCommand().

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

Field Documentation

◆ CMD_ABORT

const ilBTControllerGUI::CMD_ABORT = 'abortBucket'

◆ CMD_GET_REPLACEMENT_ITEM

const ilBTControllerGUI::CMD_GET_REPLACEMENT_ITEM = "getAsyncReplacementItem"

Definition at line 38 of file class.ilBTControllerGUI.php.

Referenced by executeCommand(), and ilBTPopOverGUI\getRefreshUrl().

◆ CMD_REMOVE

const ilBTControllerGUI::CMD_REMOVE = 'abortBucket'

◆ CMD_USER_INTERACTION

const ilBTControllerGUI::CMD_USER_INTERACTION = 'userInteraction'

◆ FROM_URL

const ilBTControllerGUI::FROM_URL = 'from_url'

Definition at line 31 of file class.ilBTControllerGUI.php.

Referenced by ilBTPopOverGUI\addFromUrlToNextRequest().

◆ IS_ASYNC

const ilBTControllerGUI::IS_ASYNC = 'bt_task_is_async'

Definition at line 37 of file class.ilBTControllerGUI.php.

Referenced by ilBTPopOverGUI\getCloseButtonAction().

◆ OBSERVER_ID

const ilBTControllerGUI::OBSERVER_ID = 'observer_id'

◆ SELECTED_OPTION

const ilBTControllerGUI::SELECTED_OPTION = 'selected_option'

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