ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 REPLACE_SIGNAL = 'replaceSignal'
 
const CMD_ABORT = 'abortBucket'
 
const CMD_REMOVE = 'abortBucket'
 
const CMD_GET_POPOVER_CONTENT = 'getPopoverContent'
 
const CMD_USER_INTERACTION = 'userInteraction'
 
const IS_ASYNC = 'bt_task_is_async'
 
const CMD_GET_REPLACEMENT_ITEM = "getAsyncReplacementItem"
 

Protected Member Functions

 performCommand ()
 
 userInteraction ()
 
 abortBucket ()
 
 getFromURL ()
 

Detailed Description

Member Function Documentation

◆ abortBucket()

ilBTControllerGUI::abortBucket ( )
protected

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

76 {
77 $observer_id = (int) $this->http()->request()->getQueryParams()[self::OBSERVER_ID];
78 $from_url = $this->getFromURL();
79
80 $bucket = $this->dic()->backgroundTasks()->persistence()->loadBucket($observer_id);
81
82 $this->dic()->backgroundTasks()->taskManager()->quitBucket($bucket);
83 if ($this->http()->request()->getQueryParams()[self::IS_ASYNC] === "true") {
84 exit;
85 }
86 $this->ctrl()->redirectToURL($from_url);
87 }
exit
Definition: backend.php:16
static http()
Fetches the global http state from ILIAS.

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

Referenced by performCommand().

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

◆ executeCommand()

ilBTControllerGUI::executeCommand ( )

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

28 {
29 switch ($this->ctrl()->getCmdClass()) {
30 default:
31 $this->performCommand();
32 }
33 }

References performCommand().

+ Here is the call graph for this function:

◆ getFromURL()

ilBTControllerGUI::getFromURL ( )
protected
Returns
string

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

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

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

125 {
126 return base64_encode($url);
127 }
$url

References $url.

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

+ Here is the caller graph for this function:

◆ performCommand()

ilBTControllerGUI::performCommand ( )
protected

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

37 {
38 $cmd = $this->ctrl()->getCmd();
39 switch ($cmd) {
41 $this->getPopoverContent();
42 break;
44 $this->userInteraction();
45 break;
46 case self::CMD_ABORT:
48 $this->abortBucket();
49 break;
50 default:
51 break;
52 }
53 }

References abortBucket(), CMD_ABORT, CMD_GET_POPOVER_CONTENT, CMD_REMOVE, CMD_USER_INTERACTION, and userInteraction().

Referenced by executeCommand().

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

◆ unhash()

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

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

136 {
137 return base64_decode($url);
138 }

References $url.

Referenced by getFromURL().

+ Here is the caller graph for this function:

◆ userInteraction()

ilBTControllerGUI::userInteraction ( )
protected

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

57 {
58 $observer_id = (int) $this->http()->request()->getQueryParams()[self::OBSERVER_ID];
59 $selected_option = $this->http()->request()->getQueryParams()[self::SELECTED_OPTION];
60 $from_url = $this->getFromURL();
61 try {
62 $observer = $this->dic()->backgroundTasks()->persistence()->loadBucket($observer_id);
63 } catch (Throwable $t) {
64 $this->ctrl()->redirectToURL($from_url);
65 }
66 $option = new UserInteractionOption("", $selected_option);
67 $this->dic()->backgroundTasks()->taskManager()->continueTask($observer, $option);
68 if ($this->http()->request()->getQueryParams()[self::IS_ASYNC] === "true") {
69 exit;
70 }
71 $this->ctrl()->redirectToURL($from_url);
72 }

References $t, exit, getFromURL(), ILIAS\FileDelivery\http(), OBSERVER_ID, and SELECTED_OPTION.

Referenced by performCommand().

+ 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'

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

Referenced by ilBTPopOverGUI\addButton(), and performCommand().

◆ CMD_GET_POPOVER_CONTENT

const ilBTControllerGUI::CMD_GET_POPOVER_CONTENT = 'getPopoverContent'

◆ CMD_GET_REPLACEMENT_ITEM

const ilBTControllerGUI::CMD_GET_REPLACEMENT_ITEM = "getAsyncReplacementItem"

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

◆ CMD_REMOVE

const ilBTControllerGUI::CMD_REMOVE = 'abortBucket'

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

Referenced by ilBTPopOverGUI\addButton(), and performCommand().

◆ CMD_USER_INTERACTION

const ilBTControllerGUI::CMD_USER_INTERACTION = 'userInteraction'

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

Referenced by ilBTPopOverGUI\addButton(), and performCommand().

◆ FROM_URL

const ilBTControllerGUI::FROM_URL = 'from_url'

◆ IS_ASYNC

const ilBTControllerGUI::IS_ASYNC = 'bt_task_is_async'

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

◆ OBSERVER_ID

const ilBTControllerGUI::OBSERVER_ID = 'observer_id'

◆ REPLACE_SIGNAL

const ilBTControllerGUI::REPLACE_SIGNAL = 'replaceSignal'

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

Referenced by ilMainMenuGUI\renderBackgroundTasks().

◆ SELECTED_OPTION

const ilBTControllerGUI::SELECTED_OPTION = 'selected_option'

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

Referenced by ilBTPopOverGUI\addButton(), and userInteraction().


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