ILIAS  release_7 Revision v7.30-3-g800a261c036
ilMMSubItemGUI Class Reference

Class ilMMTopItemGUI @ilCtrl_IsCalledBy ilMMSubItemGUI: ilObjMainMenuGUI @ilCtrl_Calls ilMMSubItemGUI: ilMMItemTranslationGUI. More...

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

Public Member Functions

 executeCommand ()
 
- Public Member Functions inherited from ilMMAbstractItemGUI
 __construct (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'
 
 $lng
 
 $tpl
 
 $tree
 

Private Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from ilMMAbstractItemGUI
 determineCommand (string $standard, string $delete)
 
 getMMItemFromRequest ()
 
- Protected Attributes inherited from ilMMAbstractItemGUI
 $ui
 
 $http
 
 $repository
 
 $toolbar
 
 $tab_handling
 
 $tabs
 
 $ctrl
 
 $access
 

Detailed Description

Member Function Documentation

◆ add()

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

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

140 : string
141 {
142 $f = new ilMMSubitemFormGUI($DIC->ctrl(), $DIC->ui()->factory(), $DIC->ui()->renderer(), $this->lng, $this->repository->getItemFacade(), $this->repository);
143
144 return $f->getHTML();
145 }
Class ilMMSubitemFormGUI.
global $DIC
Definition: goto.php:24

References $DIC, and Vendor\Package\$f.

Referenced by dispatchCommand().

+ Here is the caller graph for this function:

◆ applyFilter()

ilMMSubItemGUI::applyFilter ( )
private

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

189 : void
190 {
191 $table = new ilMMSubItemTableGUI($this, $this->repository, $this->access);
192 $table->writeFilterToSession();
193
194 $this->cancel();
195 }
Class ilMMSubItemTableGUI.
repository()
Definition: repository.php:5

References cancel(), and repository().

Referenced by dispatchCommand().

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

◆ cancel()

ilMMSubItemGUI::cancel ( )
private

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

238 : void
239 {
240 $this->ctrl->redirectByClass(self::class, self::CMD_VIEW_SUB_ITEMS);
241 }

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

+ Here is the caller graph for this function:

◆ confirmDelete()

ilMMSubItemGUI::confirmDelete ( )
private
Returns
string
Exceptions
Throwable

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

247 : string
248 {
249 $this->ctrl->saveParameterByClass(self::class, self::IDENTIFIER);
250 $i = $this->getMMItemFromRequest();
251 $c = new ilConfirmationGUI();
252 $c->addItem(self::IDENTIFIER, $this->hash($i->getId()), $i->getDefaultTitle());
253 $c->setFormAction($this->ctrl->getFormActionByClass(self::class));
254 $c->setConfirm($this->lng->txt(self::CMD_DELETE), self::CMD_DELETE);
255 $c->setCancel($this->lng->txt(self::CMD_CANCEL), self::CMD_CANCEL);
256 $c->setHeaderText($this->lng->txt(self::CMD_CONFIRM_DELETE));
257
258 return $c->getHTML();
259 }
Confirmation screen class.
$c
Definition: cli.php:37
$i
Definition: metadata.php:24

References $c, $i, and ilMMAbstractItemGUI\getMMItemFromRequest().

Referenced by dispatchCommand().

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

◆ confirmMove()

ilMMSubItemGUI::confirmMove ( )
private
Returns
string
Exceptions
Throwable

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

265 : string
266 {
267 $this->ctrl->saveParameterByClass(self::class, self::IDENTIFIER);
268 $i = $this->getMMItemFromRequest();
269 $c = new ilConfirmationGUI();
270 $c->addItem(self::IDENTIFIER, $this->hash($i->getId()), $i->getDefaultTitle());
271 $c->setFormAction($this->ctrl->getFormActionByClass(self::class));
272 $c->setConfirm($this->lng->txt(self::CMD_MOVE), self::CMD_MOVE);
273 $c->setCancel($this->lng->txt(self::CMD_CANCEL), self::CMD_CANCEL);
274 $c->setHeaderText($this->lng->txt(self::CMD_CONFIRM_MOVE));
275
276 return $c->getHTML();
277 }

References $c, $i, and ilMMAbstractItemGUI\getMMItemFromRequest().

Referenced by dispatchCommand().

+ 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 152 of file class.ilMMSubItemGUI.php.

152 : string
153 {
154 $f = new ilMMSubitemFormGUI($DIC->ctrl(), $DIC->ui()->factory(), $DIC->ui()->renderer(), $this->lng, $this->repository->getItemFacade(), $this->repository);
155 if ($f->save()) {
156 $this->cancel();
157 }
158
159 return $f->getHTML();
160 }

References $DIC, Vendor\Package\$f, and cancel().

Referenced by dispatchCommand().

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

◆ delete()

ilMMSubItemGUI::delete ( )
private

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

227 : void
228 {
229 $item = $this->getMMItemFromRequest();
230 if ($item->isCustom()) {
231 $this->repository->deleteItem($item);
232 }
233
234 ilUtil::sendSuccess($this->lng->txt("msg_subitem_deleted"), true);
235 $this->cancel();
236 }

References cancel(), ilMMAbstractItemGUI\getMMItemFromRequest(), and repository().

+ Here is the call graph for this function:

◆ dispatchCommand()

ilMMSubItemGUI::dispatchCommand (   $cmd)
private

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

32 {
33 global $DIC;
34 switch ($cmd) {
35 case self::CMD_ADD:
36 $this->access->checkAccessAndThrowException('write');
37 $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS, true, self::class);
38
39 return $this->add($DIC);
41 $this->access->checkAccessAndThrowException('write');
42 $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS, true, self::class);
43
44 return $this->create($DIC);
45 case self::CMD_EDIT:
46 $this->access->checkAccessAndThrowException('write');
47 $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS, true, self::class);
48
49 return $this->edit($DIC);
51 $this->access->checkAccessAndThrowException('write');
52 $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS, true, self::class);
53
54 return $this->update($DIC);
56 $this->access->checkAccessAndThrowException('visible,read');
57 $this->applyFilter();
58 break;
60 $this->access->checkAccessAndThrowException('visible,read');
61 $this->resetFilter();
62 break;
64 $this->access->checkAccessAndThrowException('visible,read');
65 $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, $cmd);
66
67 return $this->index();
69 $this->access->checkAccessAndThrowException('write');
70 $this->saveTable();
71 break;
73 $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS, true, self::class);
74 $this->access->checkAccessAndThrowException('write');
75
76 return $this->confirmDelete();
78 $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, ilMMSubItemGUI::CMD_VIEW_SUB_ITEMS, true, self::class);
79 $this->access->checkAccessAndThrowException('write');
80
81 return $this->confirmMove();
82 case self::CMD_MOVE:
83 $this->access->checkAccessAndThrowException('write');
84 $this->move();
85 break;
87 $this->access->checkAccessAndThrowException('write');
88 $this->delete();
89 break;
91 $this->cancel();
92 break;
93 }
94
95 return "";
96 }

References $DIC, add(), applyFilter(), cancel(), CMD_ADD, CMD_APPLY_FILTER, CMD_CANCEL, CMD_CONFIRM_DELETE, CMD_CONFIRM_MOVE, CMD_CREATE, CMD_DELETE, CMD_EDIT, CMD_MOVE, CMD_RESET_FILTER, CMD_SAVE_TABLE, CMD_UPDATE, CMD_VIEW_SUB_ITEMS, confirmDelete(), confirmMove(), create(), edit(), index(), move(), resetFilter(), saveTable(), ilObjMainMenuGUI\TAB_MAIN, and update().

Referenced by executeCommand().

+ 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 167 of file class.ilMMSubItemGUI.php.

167 : string
168 {
169 $f = new ilMMSubitemFormGUI($DIC->ctrl(), $DIC->ui()->factory(), $DIC->ui()->renderer(), $this->lng, $this->getMMItemFromRequest(), $this->repository);
170
171 return $f->getHTML();
172 }

References $DIC, and Vendor\Package\$f.

Referenced by dispatchCommand().

+ Here is the caller graph for this function:

◆ executeCommand()

ilMMSubItemGUI::executeCommand ( )

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

113 : void
114 {
115 $next_class = $this->ctrl->getNextClass();
116
117 if ('' === $next_class) {
118 $cmd = $this->determineCommand(self::CMD_VIEW_SUB_ITEMS, self::CMD_DELETE);
119 $this->tpl->setContent($this->dispatchCommand($cmd));
120
121 return;
122 }
123
124 switch ($next_class) {
125 case strtolower(ilMMItemTranslationGUI::class):
126 $this->tab_handling->initTabs(ilObjMainMenuGUI::TAB_MAIN, self::CMD_VIEW_SUB_ITEMS, true, $this->ctrl->getCallHistory()[2]['class'] ? $this->ctrl->getCallHistory()[2]['class'] : "");
127 $g = new ilMMItemTranslationGUI($this->getMMItemFromRequest(), $this->repository);
128 $this->ctrl->forwardCommand($g);
129 break;
130 default:
131 break;
132 }
133 }
return true
Flag indicating whether or not HTTP headers will be sent when outputting captcha image/audio.
determineCommand(string $standard, string $delete)
Class ilMMItemTranslationGUI.
Class ilObjMainMenuGUI.

References ilMMAbstractItemGUI\determineCommand(), dispatchCommand(), ilMMAbstractItemGUI\getMMItemFromRequest(), repository(), and ilObjMainMenuGUI\TAB_MAIN.

+ Here is the call graph for this function:

◆ index()

ilMMSubItemGUI::index ( )
private
Returns
string

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

209 : string
210 {
211 // ADD NEW
212 if ($this->access->hasUserPermissionTo('write')) {
214 $b->setUrl($this->ctrl->getLinkTarget($this, ilMMSubItemGUI::CMD_ADD));
215 $b->setCaption($this->lng->txt(ilMMSubItemGUI::CMD_ADD), false);
216
217 $this->toolbar->addButtonInstance($b);
218 }
219
220 // TABLE
221 $table = new ilMMSubItemTableGUI($this, $this->repository, $this->access);
222 $table->setShowRowsSelector(false);
223
224 return $table->getHTML();
225 }
static getInstance()
Factory.

References Vendor\Package\$b, CMD_ADD, ilLinkButton\getInstance(), and repository().

Referenced by dispatchCommand().

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

◆ move()

ilMMSubItemGUI::move ( )
private

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

279 : void
280 {
281 $item = $this->getMMItemFromRequest();
282 if ($item->isInterchangeable()) {
283 $item->setParent('');
284 $this->repository->updateItem($item);
285 }
286
287 ilUtil::sendSuccess($this->lng->txt("msg_moved"), true);
288 $this->cancel();
289 }

References cancel(), ilMMAbstractItemGUI\getMMItemFromRequest(), and repository().

Referenced by dispatchCommand().

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

◆ resetFilter()

ilMMSubItemGUI::resetFilter ( )
private

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

197 : void
198 {
199 $table = new ilMMSubItemTableGUI($this, $this->repository, $this->access);
200 $table->resetFilter();
201 $table->resetOffset();
202
203 $this->cancel();
204 }

References cancel(), and repository().

Referenced by dispatchCommand().

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

◆ saveTable()

ilMMSubItemGUI::saveTable ( )
private

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

98 : void
99 {
100 global $DIC;
101 $r = $DIC->http()->request()->getParsedBody();
102 foreach ($r[self::IDENTIFIER] as $identification_string => $data) {
103 $item = $this->repository->getItemFacadeForIdentificationString($this->unhash($identification_string));
104 $position = (int) $data['position'];
105 $item->setPosition($position);
106 $item->setActiveStatus(isset($data['active']) && (bool) $data['active']);
107 $item->setParent($this->unhash((string) $data['parent']));
108 $this->repository->updateItem($item);
109 }
110 $this->cancel();
111 }
$data
Definition: storeScorm.php:23

References $data, $DIC, cancel(), and repository().

Referenced by dispatchCommand().

+ 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 179 of file class.ilMMSubItemGUI.php.

179 : string
180 {
181 $f = new ilMMSubitemFormGUI($DIC->ctrl(), $DIC->ui()->factory(), $DIC->ui()->renderer(), $this->lng, $this->getMMItemFromRequest(), $this->repository);
182 if ($f->save()) {
183 $this->cancel();
184 }
185
186 return $f->getHTML();
187 }

References $DIC, Vendor\Package\$f, and cancel().

Referenced by dispatchCommand().

+ 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 16 of file class.ilMMSubItemGUI.php.

Referenced by dispatchCommand(), index(), and ilMMSubitemFormGUI\initForm().

◆ CMD_APPLY_FILTER

const ilMMSubItemGUI::CMD_APPLY_FILTER = 'applyFilter'

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

Referenced by dispatchCommand().

◆ CMD_CANCEL

const ilMMSubItemGUI::CMD_CANCEL = 'cancel'

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

Referenced by dispatchCommand().

◆ CMD_CONFIRM_DELETE

const ilMMSubItemGUI::CMD_CONFIRM_DELETE = 'subitem_confirm_delete'

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

Referenced by dispatchCommand().

◆ CMD_CONFIRM_MOVE

const ilMMSubItemGUI::CMD_CONFIRM_MOVE = 'confirm_move'

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

Referenced by dispatchCommand().

◆ CMD_CREATE

const ilMMSubItemGUI::CMD_CREATE = 'subitem_create'

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

Referenced by dispatchCommand(), and ilMMSubitemFormGUI\initForm().

◆ CMD_DELETE

const ilMMSubItemGUI::CMD_DELETE = 'delete'

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

Referenced by dispatchCommand(), and ilMMTopItemTableGUI\fillRow().

◆ CMD_EDIT

const ilMMSubItemGUI::CMD_EDIT = 'subitem_edit'

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

Referenced by dispatchCommand(), and ilMMSubitemFormGUI\initForm().

◆ CMD_MOVE

const ilMMSubItemGUI::CMD_MOVE = 'move'

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

Referenced by dispatchCommand().

◆ CMD_RENDER_INTERRUPTIVE

const ilMMSubItemGUI::CMD_RENDER_INTERRUPTIVE = 'render_interruptive_modal'

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

◆ CMD_RESET_FILTER

const ilMMSubItemGUI::CMD_RESET_FILTER = 'resetFilter'

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

Referenced by dispatchCommand().

◆ CMD_SAVE_TABLE

const ilMMSubItemGUI::CMD_SAVE_TABLE = 'save_table'

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

Referenced by ilMMSubItemTableGUI\__construct(), and dispatchCommand().

◆ CMD_TRANSLATE

const ilMMSubItemGUI::CMD_TRANSLATE = 'subitem_translate'

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

◆ CMD_UPDATE

const ilMMSubItemGUI::CMD_UPDATE = 'subitem_update'

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

Referenced by dispatchCommand(), and 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: