ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMMSubItemGUI Class Reference

Class ilMMTopItemGUI ilMMSubItemGUI: ilObjMainMenuGUI ilMMSubItemGUI: ilMMItemTranslationGUI. More...

+ Inheritance diagram for ilMMSubItemGUI:
+ Collaboration diagram for ilMMSubItemGUI:

Public Member Functions

 executeCommand ()
 
- Public Member Functions inherited from ilMMAbstractItemGUI
 __construct (protected ilMMTabHandling $tab_handling)
 ilMMAbstractItemGUI constructor. More...
 

Data Fields

const CMD_VIEW_SUB_ITEMS = 'subtab_subitems'
 
const CMD_ADD = 'subitem_add'
 
const CMD_CREATE = 'subitem_create'
 
const CMD_CONFIRM_MOVE = 'confirm_move'
 
const CMD_MOVE = 'move'
 
const CMD_DELETE = 'delete'
 
const CMD_CONFIRM_DELETE = 'subitem_confirm_delete'
 
const CMD_EDIT = 'subitem_edit'
 
const CMD_TRANSLATE = 'subitem_translate'
 
const CMD_UPDATE = 'subitem_update'
 
const CMD_SAVE_TABLE = 'save_table'
 
const CMD_APPLY_FILTER = 'applyFilter'
 
const CMD_RESET_FILTER = 'resetFilter'
 
const CMD_RENDER_INTERRUPTIVE = 'render_interruptive_modal'
 
const CMD_CANCEL = 'cancel'
 
- Data Fields inherited from ilMMAbstractItemGUI
const IDENTIFIER = 'identifier'
 
const CMD_FLUSH = 'flush'
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 

Protected Member Functions

 cancel ()
 
- Protected Member Functions inherited from ilMMAbstractItemGUI
 determineCommand (string $standard, string $delete)
 
 getMMItemFromRequest ()
 
 flush ()
 
 cancel ()
 

Private Member Functions

 dispatchCommand (string $cmd)
 
 saveTable ()
 
 add ($DIC)
 
 create ($DIC)
 
 edit ($DIC)
 
 update ($DIC)
 
 applyFilter ()
 
 resetFilter ()
 
 index ()
 
 delete ()
 
 move ()
 

Additional Inherited Members

- Protected Attributes inherited from ilMMAbstractItemGUI
UIServices $ui
 
Services $http
 
ilMMItemRepository $repository
 
ilToolbarGUI $toolbar
 
ilTabsGUI $tabs
 
ilCtrl $ctrl
 
ilObjMainMenuAccess $access
 

Detailed Description

Member Function Documentation

◆ add()

ilMMSubItemGUI::add (   $DIC)
private
Parameters
$DIC
Returns
string
Exceptions
Throwable

Definition at line 152 of file class.ilMMSubItemGUI.php.

References $DIC, Vendor\Package\$f, ilMMAbstractItemGUI\$lng, ilMMAbstractItemGUI\$repository, and ILIAS\UI\examples\Deck\repository().

Referenced by dispatchCommand().

152  : string
153  {
154  $f = new ilMMSubitemFormGUI($DIC->ctrl(), $DIC->ui()->factory(), $DIC->ui()->renderer(), $this->lng, $this->repository->getItemFacade(), $this->repository);
155 
156  return $f->getHTML();
157  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
global $DIC
Definition: shib_login.php:22
Class ilMMSubitemFormGUI.
ilMMItemRepository $repository
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyFilter()

ilMMSubItemGUI::applyFilter ( )
private

Definition at line 201 of file class.ilMMSubItemGUI.php.

References ILIAS\Repository\access(), cancel(), and ILIAS\UI\examples\Deck\repository().

Referenced by dispatchCommand().

201  : void
202  {
203  $table = new ilMMSubItemTableGUI($this, $this->repository, $this->access);
204  $table->writeFilterToSession();
205 
206  $this->cancel();
207  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
Class ilMMSubItemTableGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilMMSubItemGUI::cancel ( )
protected

Definition at line 259 of file class.ilMMSubItemGUI.php.

References ILIAS\Repository\ctrl().

Referenced by applyFilter(), create(), delete(), dispatchCommand(), move(), resetFilter(), saveTable(), and update().

259  : void
260  {
261  $this->ctrl->redirectByClass(self::class, self::CMD_VIEW_SUB_ITEMS);
262  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilMMSubItemGUI::create (   $DIC)
private
Parameters
$DIC
Returns
string
Exceptions
Throwable

Definition at line 164 of file class.ilMMSubItemGUI.php.

References $DIC, Vendor\Package\$f, ilMMAbstractItemGUI\$lng, ilMMAbstractItemGUI\$repository, cancel(), and ILIAS\UI\examples\Deck\repository().

Referenced by dispatchCommand().

164  : string
165  {
166  $f = new ilMMSubitemFormGUI($DIC->ctrl(), $DIC->ui()->factory(), $DIC->ui()->renderer(), $this->lng, $this->repository->getItemFacade(), $this->repository);
167  if ($f->save()) {
168  $this->cancel();
169  }
170 
171  return $f->getHTML();
172  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
global $DIC
Definition: shib_login.php:22
Class ilMMSubitemFormGUI.
ilMMItemRepository $repository
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilMMSubItemGUI::delete ( )
private

Definition at line 248 of file class.ilMMSubItemGUI.php.

References cancel(), ilMMAbstractItemGUI\getMMItemFromRequest(), ILIAS\Repository\lng(), and ILIAS\UI\examples\Deck\repository().

248  : void
249  {
250  $item = $this->getMMItemFromRequest();
251  if ($item->isDeletable()) {
252  $this->repository->deleteItem($item);
253  }
254 
255  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_subitem_deleted"), true);
256  $this->cancel();
257  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ dispatchCommand()

ilMMSubItemGUI::dispatchCommand ( string  $cmd)
private

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

References $DIC, ILIAS\Repository\access(), add(), applyFilter(), cancel(), CMD_VIEW_SUB_ITEMS, create(), edit(), ilMMAbstractItemGUI\flush(), index(), move(), resetFilter(), saveTable(), ilObjMainMenuGUI\TAB_MAIN, and update().

Referenced by executeCommand().

49  : string
50  {
51  global $DIC;
52  switch ($cmd) {
53  case self::CMD_ADD:
54  $this->access->checkAccessAndThrowException('write');
55  $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS, true, self::class);
56 
57  return $this->add($DIC);
58  case self::CMD_CREATE:
59  $this->access->checkAccessAndThrowException('write');
60  $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS, true, self::class);
61 
62  return $this->create($DIC);
63  case self::CMD_EDIT:
64  $this->access->checkAccessAndThrowException('write');
65  $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS, true, self::class);
66 
67  return $this->edit($DIC);
68  case self::CMD_UPDATE:
69  $this->access->checkAccessAndThrowException('write');
70  $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS, true, self::class);
71 
72  return $this->update($DIC);
73  case self::CMD_APPLY_FILTER:
74  $this->access->checkAccessAndThrowException('visible,read');
75  $this->applyFilter();
76  break;
77  case self::CMD_RESET_FILTER:
78  $this->access->checkAccessAndThrowException('visible,read');
79  $this->resetFilter();
80  break;
81  case self::CMD_VIEW_SUB_ITEMS:
82  $this->access->checkAccessAndThrowException('visible,read');
83  $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, $cmd);
84 
85  return $this->index();
86  case self::CMD_SAVE_TABLE:
87  $this->access->checkAccessAndThrowException('write');
88  $this->saveTable();
89  break;
90  case self::CMD_MOVE:
91  $this->access->checkAccessAndThrowException('write');
92  $this->move();
93  break;
94  case self::CMD_DELETE:
95  $this->access->checkAccessAndThrowException('write');
96  $this->delete();
97  break;
98  case self::CMD_CANCEL:
99  $this->cancel();
100  break;
101  case self::CMD_FLUSH:
102  $this->access->checkAccessAndThrowException('write');
103  $this->flush();
104  break;
105  }
106 
107  return "";
108  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ edit()

ilMMSubItemGUI::edit (   $DIC)
private
Parameters
$DIC
Returns
string
Exceptions
Throwable

Definition at line 179 of file class.ilMMSubItemGUI.php.

References $DIC, Vendor\Package\$f, ilMMAbstractItemGUI\$lng, ilMMAbstractItemGUI\$repository, and ilMMAbstractItemGUI\getMMItemFromRequest().

Referenced by dispatchCommand().

179  : string
180  {
181  $f = new ilMMSubitemFormGUI($DIC->ctrl(), $DIC->ui()->factory(), $DIC->ui()->renderer(), $this->lng, $this->getMMItemFromRequest(), $this->repository);
182 
183  return $f->getHTML();
184  }
global $DIC
Definition: shib_login.php:22
Class ilMMSubitemFormGUI.
ilMMItemRepository $repository
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilMMSubItemGUI::executeCommand ( )

Definition at line 125 of file class.ilMMSubItemGUI.php.

References ILIAS\Repository\ctrl(), ilMMAbstractItemGUI\determineCommand(), dispatchCommand(), ilMMAbstractItemGUI\getMMItemFromRequest(), ilCtrlInterface\PARAM_CMD_CLASS, ILIAS\UI\examples\Deck\repository(), and ilObjMainMenuGUI\TAB_MAIN.

125  : void
126  {
127  $next_class = $this->ctrl->getNextClass();
128 
129  if ('' === $next_class) {
130  $cmd = $this->determineCommand(self::CMD_VIEW_SUB_ITEMS, self::CMD_DELETE);
131  $this->tpl->setContent($this->dispatchCommand($cmd));
132 
133  return;
134  }
135 
136  switch ($next_class) {
137  case strtolower(ilMMItemTranslationGUI::class):
138  $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, self::CMD_VIEW_SUB_ITEMS, true, $this->ctrl->getCallHistory()[2][ilCtrlInterface::PARAM_CMD_CLASS] ?? '');
139  $g = new ilMMItemTranslationGUI($this->getMMItemFromRequest(), $this->repository);
140  $this->ctrl->forwardCommand($g);
141  break;
142  default:
143  break;
144  }
145  }
Class ilObjMainMenuGUI ilObjMainMenuGUI: ilAdministrationGUI ilObjMainMenuGUI: ilPermissionGUI.
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
Class ilMMItemTranslationGUI.
dispatchCommand(string $cmd)
determineCommand(string $standard, string $delete)
+ Here is the call graph for this function:

◆ index()

ilMMSubItemGUI::index ( )
private
Returns
string

Definition at line 221 of file class.ilMMSubItemGUI.php.

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\UI\examples\Deck\repository(), ILIAS\Repository\toolbar(), and ILIAS\Repository\ui().

Referenced by dispatchCommand().

221  : string
222  {
223  // ADD NEW
224  if ($this->access->hasUserPermissionTo('write')) {
225  $btn_add = $this->ui->factory()->button()->standard(
226  $this->lng->txt(self::CMD_ADD),
227  $this->ctrl->getLinkTarget($this, self::CMD_ADD)
228  );
229  $this->toolbar->addComponent($btn_add);
230 
231  // REMOVE LOST ITEMS
232  if ($this->repository->hasLostItems()) {
233  $btn_flush = $this->ui->factory()->button()->standard(
234  $this->lng->txt(self::CMD_FLUSH),
235  $this->ctrl->getLinkTarget($this, self::CMD_FLUSH)
236  );
237  $this->toolbar->addComponent($btn_flush);
238  }
239  }
240 
241  // TABLE
242  $table = new ilMMSubItemTableGUI($this, $this->repository, $this->access);
243  $table->setShowRowsSelector(false);
244 
245  return $table->getHTML();
246  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
Class ilMMSubItemTableGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move()

ilMMSubItemGUI::move ( )
private

Definition at line 264 of file class.ilMMSubItemGUI.php.

References cancel(), ilMMAbstractItemGUI\getMMItemFromRequest(), ILIAS\Repository\lng(), and ILIAS\UI\examples\Deck\repository().

Referenced by dispatchCommand().

264  : void
265  {
266  $item = $this->getMMItemFromRequest();
267  if ($item->isInterchangeable()) {
268  $item->setParent('');
269  $this->repository->updateItem($item);
270  }
271 
272  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_moved"), true);
273  $this->cancel();
274  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetFilter()

ilMMSubItemGUI::resetFilter ( )
private

Definition at line 209 of file class.ilMMSubItemGUI.php.

References ILIAS\Repository\access(), cancel(), and ILIAS\UI\examples\Deck\repository().

Referenced by dispatchCommand().

209  : void
210  {
211  $table = new ilMMSubItemTableGUI($this, $this->repository, $this->access);
212  $table->resetFilter();
213  $table->resetOffset();
214 
215  $this->cancel();
216  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
Class ilMMSubItemTableGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveTable()

ilMMSubItemGUI::saveTable ( )
private

Definition at line 110 of file class.ilMMSubItemGUI.php.

References $data, $DIC, $r, cancel(), ILIAS\Repository\int(), and ILIAS\UI\examples\Deck\repository().

Referenced by dispatchCommand().

110  : void
111  {
112  global $DIC;
113  $r = $DIC->http()->request()->getParsedBody();
114  foreach ($r[self::IDENTIFIER] as $identification_string => $data) {
115  $item = $this->repository->getItemFacadeForIdentificationString($this->unhash($identification_string));
116  $position = (int) $data['position'];
117  $item->setPosition($position);
118  $item->setActiveStatus(isset($data['active']) && $data['active']);
119  $item->setParent($this->unhash((string) $data['parent']));
120  $this->repository->updateItem($item);
121  }
122  $this->cancel();
123  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
global $DIC
Definition: shib_login.php:22
$r
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilMMSubItemGUI::update (   $DIC)
private
Parameters
$DIC
Returns
string
Exceptions
Throwable

Definition at line 191 of file class.ilMMSubItemGUI.php.

References $DIC, Vendor\Package\$f, ilMMAbstractItemGUI\$lng, ilMMAbstractItemGUI\$repository, cancel(), and ilMMAbstractItemGUI\getMMItemFromRequest().

Referenced by dispatchCommand().

191  : string
192  {
193  $f = new ilMMSubitemFormGUI($DIC->ctrl(), $DIC->ui()->factory(), $DIC->ui()->renderer(), $this->lng, $this->getMMItemFromRequest(), $this->repository);
194  if ($f->save()) {
195  $this->cancel();
196  }
197 
198  return $f->getHTML();
199  }
global $DIC
Definition: shib_login.php:22
Class ilMMSubitemFormGUI.
ilMMItemRepository $repository
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ CMD_ADD

const ilMMSubItemGUI::CMD_ADD = 'subitem_add'

Definition at line 34 of file class.ilMMSubItemGUI.php.

Referenced by ilMMSubitemFormGUI\initForm().

◆ CMD_APPLY_FILTER

const ilMMSubItemGUI::CMD_APPLY_FILTER = 'applyFilter'

Definition at line 44 of file class.ilMMSubItemGUI.php.

◆ CMD_CANCEL

const ilMMSubItemGUI::CMD_CANCEL = 'cancel'

Definition at line 47 of file class.ilMMSubItemGUI.php.

◆ CMD_CONFIRM_DELETE

const ilMMSubItemGUI::CMD_CONFIRM_DELETE = 'subitem_confirm_delete'

Definition at line 39 of file class.ilMMSubItemGUI.php.

Referenced by ilMMSubItemTableGUI\initColumns().

◆ CMD_CONFIRM_MOVE

const ilMMSubItemGUI::CMD_CONFIRM_MOVE = 'confirm_move'

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

Referenced by ilMMSubItemTableGUI\initColumns().

◆ CMD_CREATE

const ilMMSubItemGUI::CMD_CREATE = 'subitem_create'

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

Referenced by ilMMSubitemFormGUI\initForm().

◆ CMD_DELETE

const ilMMSubItemGUI::CMD_DELETE = 'delete'

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

Referenced by ilMMSubItemTableGUI\initColumns().

◆ CMD_EDIT

const ilMMSubItemGUI::CMD_EDIT = 'subitem_edit'

◆ CMD_MOVE

const ilMMSubItemGUI::CMD_MOVE = 'move'

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

Referenced by ilMMSubItemTableGUI\initColumns().

◆ CMD_RENDER_INTERRUPTIVE

const ilMMSubItemGUI::CMD_RENDER_INTERRUPTIVE = 'render_interruptive_modal'

Definition at line 46 of file class.ilMMSubItemGUI.php.

◆ CMD_RESET_FILTER

const ilMMSubItemGUI::CMD_RESET_FILTER = 'resetFilter'

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

◆ CMD_SAVE_TABLE

const ilMMSubItemGUI::CMD_SAVE_TABLE = 'save_table'

Definition at line 43 of file class.ilMMSubItemGUI.php.

Referenced by ilMMSubItemTableGUI\__construct().

◆ CMD_TRANSLATE

const ilMMSubItemGUI::CMD_TRANSLATE = 'subitem_translate'

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

◆ CMD_UPDATE

const ilMMSubItemGUI::CMD_UPDATE = 'subitem_update'

Definition at line 42 of file class.ilMMSubItemGUI.php.

Referenced by ilMMSubitemFormGUI\initForm().

◆ CMD_VIEW_SUB_ITEMS

const ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS = 'subtab_subitems'

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