ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

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

Referenced by executeCommand().

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
Definition: login.php:28
static http()
Fetches the global http state from ILIAS.
+ 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.

References abortBucket(), ILIAS\Repository\ctrl(), getAsyncReplacementItem(), and userInteraction().

41  : void
42  {
43  $cmd = $this->ctrl()->getCmd();
44  switch ($cmd) {
45  case self::CMD_GET_REPLACEMENT_ITEM:
46  $this->getAsyncReplacementItem();
47  break;
48  case self::CMD_USER_INTERACTION:
49  $this->userInteraction();
50  break;
51  case self::CMD_ABORT:
52  case self::CMD_REMOVE:
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...
+ 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.

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

Referenced by executeCommand().

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  }
exit
Definition: login.php:28
static http()
Fetches the global http state from ILIAS.
+ 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.

References ILIAS\FileDelivery\http().

Referenced by abortBucket(), and userInteraction().

112  : string
113  {
114  return self::unhash($this->http()->request()->getQueryParams()[self::FROM_URL]);
115  }
static http()
Fetches the global http state from ILIAS.
+ 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.

References $url.

Referenced by ilBTPopOverGUI\addFromUrlToNextRequest(), and ilBTPopOverGUI\getDefaultCardContent().

121  : string
122  {
123  return base64_encode($url);
124  }
$url
+ 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.

References $url.

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

◆ userInteraction()

ilBTControllerGUI::userInteraction ( )
protected

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

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

Referenced by executeCommand().

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  }
static http()
Fetches the global http state from ILIAS.
+ 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 34 of file class.ilBTControllerGUI.php.

Referenced by ilBTPopOverGUI\getCloseButtonAction().

◆ CMD_GET_REPLACEMENT_ITEM

const ilBTControllerGUI::CMD_GET_REPLACEMENT_ITEM = "getAsyncReplacementItem"

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

Referenced by ilBTPopOverGUI\getRefreshUrl().

◆ CMD_REMOVE

const ilBTControllerGUI::CMD_REMOVE = 'abortBucket'

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

Referenced by ilBTPopOverGUI\getCloseButtonAction().

◆ 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 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: