ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMMAbstractItemGUI Class Reference

Class ilMMAbstractItemGUI. More...

+ Inheritance diagram for ilMMAbstractItemGUI:
+ Collaboration diagram for ilMMAbstractItemGUI:

Public Member Functions

 __construct (ilMMTabHandling $tab_handling)
 ilMMAbstractItemGUI constructor. More...
 
 renderInterruptiveModal ()
 

Data Fields

const IDENTIFIER = 'identifier'
 
 $lng
 
 $tpl
 
 $tree
 

Protected Member Functions

 determineCommand (string $standard, string $delete)
 
 getMMItemFromRequest ()
 

Protected Attributes

 $ui
 
 $http
 
 $repository
 
 $toolbar
 
 $tab_handling
 
 $tabs
 
 $ctrl
 
 $access
 
 $gs
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMMAbstractItemGUI::__construct ( ilMMTabHandling  $tab_handling)

ilMMAbstractItemGUI constructor.

Parameters
ilMMTabHandling$tab_handling
Exceptions
Throwable

Definition at line 70 of file class.ilMMAbstractItemGUI.php.

References $DIC, $tab_handling, ILIAS\FileDelivery\http(), and repository().

71  {
72  global $DIC;
73 
74  $this->repository = new ilMMItemRepository();
75  $this->tab_handling = $tab_handling;
76  $this->tabs = $DIC['ilTabs'];
77  $this->lng = $DIC->language();
78  $this->ctrl = $DIC['ilCtrl'];
79  $this->tpl = $DIC['tpl'];
80  $this->tree = $DIC['tree'];
81  $this->toolbar = $DIC['ilToolbar'];
82  $this->http = $DIC->http();
83  $this->ui = $DIC->ui();
84  $this->access = new ilObjMainMenuAccess();
85  $this->gs = $DIC->globalScreen();
86  }
global $DIC
Definition: saml.php:7
Class ilMMItemRepository.
static http()
Fetches the global http state from ILIAS.
repository()
Definition: repository.php:5
Class ilObjMainMenuAccess.
+ Here is the call graph for this function:

Member Function Documentation

◆ determineCommand()

ilMMAbstractItemGUI::determineCommand ( string  $standard,
string  $delete 
)
protected
Parameters
string$standard
string$delete
Returns
string
Exceptions
ilException

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

References $post, $r, and ILIAS\FileDelivery\http().

Referenced by ilMMSubItemGUI\executeCommand(), and ilMMTopItemGUI\executeCommand().

96  : string
97  {
98  $this->access->checkAccessAndThrowException('visible,read');
99  $cmd = $this->ctrl->getCmd();
100  if ($cmd !== '') {
101  return $cmd;
102  }
103 
104  $r = $this->http->request();
105  $post = $r->getParsedBody();
106 
107  if ($cmd == "" && isset($post['interruptive_items'])) {
108  $cmd = $delete;
109  } else {
110  $cmd = $standard;
111  }
112 
113  return $cmd;
114  }
$r
Definition: example_031.php:79
static http()
Fetches the global http state from ILIAS.
$post
Definition: post.php:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMMItemFromRequest()

ilMMAbstractItemGUI::getMMItemFromRequest ( )
protected
Returns
ilMMItemFacadeInterface
Exceptions
Throwable

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

References $post, $r, ILIAS\FileDelivery\http(), and repository().

Referenced by ilMMSubItemGUI\confirmDelete(), ilMMTopItemGUI\confirmDelete(), ilMMSubItemGUI\delete(), ilMMTopItemGUI\delete(), ilMMSubItemGUI\edit(), ilMMTopItemGUI\edit(), ilMMSubItemGUI\executeCommand(), ilMMTopItemGUI\executeCommand(), ilMMSubItemGUI\update(), and ilMMTopItemGUI\update().

122  {
123  $r = $this->http->request();
124  $get = $r->getQueryParams();
125  $post = $r->getParsedBody();
126 
127  if (!isset($post['cmd']) && isset($post['interruptive_items'])) {
128  $string = $post['interruptive_items'][0];
129  $identification = $this->unhash($string);
130  } else {
131  $identification = $this->unhash($get[self::IDENTIFIER]);
132  }
133 
134  return $this->repository->getItemFacadeForIdentificationString($identification);
135  }
$r
Definition: example_031.php:79
static http()
Fetches the global http state from ILIAS.
repository()
Definition: repository.php:5
$post
Definition: post.php:34
Interface ilMMItemFacadeInterface.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderInterruptiveModal()

ilMMAbstractItemGUI::renderInterruptiveModal ( )

Definition at line 138 of file class.ilMMAbstractItemGUI.php.

References $f, $r, and exit.

Referenced by ilMMSubItemGUI\dispatchCommand(), and ilMMTopItemGUI\dispatchCommand().

139  {
140  $f = $this->ui->factory();
141  $r = $this->ui->renderer();
142 
143  $form_action = $this->ctrl->getFormActionByClass(self::class, self::CMD_DELETE);
144  $delete_modal = $f->modal()->interruptive(
145  $this->lng->txt("delete"),
146  $this->lng->txt(self::CMD_CONFIRM_DELETE),
147  $form_action
148  );
149 
150  echo $r->render([$delete_modal]);
151  exit;
152  }
$r
Definition: example_031.php:79
exit
Definition: backend.php:16
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilMMAbstractItemGUI::$access
protected

Definition at line 57 of file class.ilMMAbstractItemGUI.php.

◆ $ctrl

ilMMAbstractItemGUI::$ctrl
protected

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

◆ $gs

ilMMAbstractItemGUI::$gs
protected

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

◆ $http

ilMMAbstractItemGUI::$http
protected

Definition at line 21 of file class.ilMMAbstractItemGUI.php.

◆ $lng

◆ $repository

◆ $tab_handling

ilMMAbstractItemGUI::$tab_handling
protected

Definition at line 33 of file class.ilMMAbstractItemGUI.php.

Referenced by __construct().

◆ $tabs

ilMMAbstractItemGUI::$tabs
protected

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

◆ $toolbar

ilMMAbstractItemGUI::$toolbar
protected

Definition at line 29 of file class.ilMMAbstractItemGUI.php.

◆ $tpl

ilMMAbstractItemGUI::$tpl

Definition at line 49 of file class.ilMMAbstractItemGUI.php.

◆ $tree

ilMMAbstractItemGUI::$tree

Definition at line 53 of file class.ilMMAbstractItemGUI.php.

◆ $ui

ilMMAbstractItemGUI::$ui
protected

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

◆ IDENTIFIER

const ilMMAbstractItemGUI::IDENTIFIER = 'identifier'

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