ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilBTControllerGUI Class Reference

Class ilBTControllerGUI. More...

+ 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 61 of file class.ilBTControllerGUI.php.

62 {
63 $observer_id = (int) $this->http()->request()->getQueryParams()[self::OBSERVER_ID];
64 $from_url = $this->getFromURL();
65
66 $bucket = $this->dic()->backgroundTasks()->persistence()->loadBucket($observer_id);
67
68 $this->dic()->backgroundTasks()->taskManager()->quitBucket($bucket);
69 if ($this->http()->request()->getQueryParams()[self::IS_ASYNC] === "true") {
70 exit;
71 }
72 $this->ctrl()->redirectToURL($from_url);
73 }
exit
Definition: login.php:29
static http()
Fetches the global http state from ILIAS.

References exit, getFromURL(), ILIAS\FileDelivery\http(), 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 25 of file class.ilBTControllerGUI.php.

25 : void
26 {
27 $cmd = $this->ctrl()->getCmd();
28 switch ($cmd) {
31 break;
33 $this->userInteraction();
34 break;
35 case self::CMD_ABORT:
37 $this->abortBucket();
38 break;
39 default:
40 break;
41 }
42 }
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, 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 80 of file class.ilBTControllerGUI.php.

81 {
82 $observer_id = (int) $this->http()->request()->getQueryParams()[self::OBSERVER_ID];
83 $bucket = $this->dic()->backgroundTasks()->persistence()->loadBucket($observer_id);
84
85 $item_source = new ilBTPopOverGUI($this->dic());
86 $this->dic()->language()->loadLanguageModule('background_tasks');
87 $item = $item_source->getItemForObserver($bucket);
88 echo $this->dic()->ui()->renderer()->renderAsync($item);
89 exit;
90 }
Class ilBTPopOverGUI.

References exit, ILIAS\FileDelivery\http(), 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
Returns
string

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

97 {
98 $from_url = self::unhash($this->http()->request()->getQueryParams()[self::FROM_URL]);
99
100 return $from_url;
101 }

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
Returns
string

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

110 {
111 return base64_encode($url);
112 }
$url

References $url.

Referenced by ilBTPopOverGUI\addFromUrlToNextRequest(), and ilMainMenuGUI\renderBackgroundTasks().

+ Here is the caller graph for this function:

◆ unhash()

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

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

121 {
122 return base64_decode($url);
123 }

References $url.

Referenced by getFromURL().

+ Here is the caller graph for this function:

◆ userInteraction()

ilBTControllerGUI::userInteraction ( )
protected

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

45 : void
46 {
47 $observer_id = (int) $this->http()->request()->getQueryParams()[self::OBSERVER_ID];
48 $selected_option = $this->http()->request()->getQueryParams()[self::SELECTED_OPTION];
49 $from_url = $this->getFromURL();
50
51 $observer = $this->dic()->backgroundTasks()->persistence()->loadBucket($observer_id);
52 $option = new UserInteractionOption("", $selected_option);
53 $this->dic()->backgroundTasks()->taskManager()->continueTask($observer, $option);
54 if ($this->http()->request()->getQueryParams()[self::IS_ASYNC] === "true") {
55 exit;
56 }
57 $this->ctrl()->redirectToURL($from_url);
58 }

References exit, getFromURL(), ILIAS\FileDelivery\http(), 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 22 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'

◆ IS_ASYNC

const ilBTControllerGUI::IS_ASYNC = 'bt_task_is_async'

Definition at line 21 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: