19 declare(strict_types=1);
54 $this->
access->checkAccessAndThrowException(
'write');
57 return $this->
add($DIC);
58 case self::CMD_CREATE:
59 $this->
access->checkAccessAndThrowException(
'write');
62 return $this->
create($DIC);
64 $this->
access->checkAccessAndThrowException(
'write');
67 return $this->
edit($DIC);
68 case self::CMD_UPDATE:
69 $this->
access->checkAccessAndThrowException(
'write');
72 return $this->
update($DIC);
73 case self::CMD_APPLY_FILTER:
74 $this->
access->checkAccessAndThrowException(
'visible,read');
77 case self::CMD_RESET_FILTER:
78 $this->
access->checkAccessAndThrowException(
'visible,read');
81 case self::CMD_VIEW_SUB_ITEMS:
82 $this->
access->checkAccessAndThrowException(
'visible,read');
85 return $this->
index();
86 case self::CMD_SAVE_TABLE:
87 $this->
access->checkAccessAndThrowException(
'write');
90 case self::CMD_CONFIRM_DELETE:
92 $this->
access->checkAccessAndThrowException(
'write');
95 case self::CMD_CONFIRM_MOVE:
97 $this->
access->checkAccessAndThrowException(
'write');
101 $this->
access->checkAccessAndThrowException(
'write');
104 case self::CMD_DELETE:
105 $this->
access->checkAccessAndThrowException(
'write');
108 case self::CMD_CANCEL:
111 case self::CMD_FLUSH:
112 $this->
access->checkAccessAndThrowException(
'write');
123 $r = $DIC->http()->request()->getParsedBody();
124 foreach ($r[self::IDENTIFIER] as $identification_string =>
$data) {
125 $item = $this->
repository->getItemFacadeForIdentificationString($this->unhash($identification_string));
126 $position = (
int)
$data[
'position'];
127 $item->setPosition($position);
128 $item->setActiveStatus(isset(
$data[
'active']) &&
$data[
'active']);
129 $item->setParent($this->unhash((
string)
$data[
'parent']));
137 $next_class = $this->
ctrl->getNextClass();
139 if (
'' === $next_class) {
146 switch ($next_class) {
147 case strtolower(ilMMItemTranslationGUI::class):
150 $this->
ctrl->forwardCommand($g);
166 return $f->getHTML();
181 return $f->getHTML();
193 return $f->getHTML();
208 return $f->getHTML();
214 $table->writeFilterToSession();
222 $table->resetFilter();
223 $table->resetOffset();
234 if ($this->
access->hasUserPermissionTo(
'write')) {
244 $b->setUrl($this->
ctrl->getLinkTarget($this, self::CMD_FLUSH));
245 $b->setCaption($this->
lng->txt(self::CMD_FLUSH),
false);
252 $table->setShowRowsSelector(
false);
254 return $table->getHTML();
257 private function delete():
void 260 if ($item->isDeletable()) {
264 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_subitem_deleted"),
true);
270 $this->
ctrl->redirectByClass(self::class, self::CMD_VIEW_SUB_ITEMS);
279 $this->
ctrl->saveParameterByClass(self::class, self::IDENTIFIER);
282 $c->addItem(self::IDENTIFIER, $this->
hash(
$i->getId()),
$i->getDefaultTitle());
283 $c->setFormAction($this->
ctrl->getFormActionByClass(self::class));
284 $c->setConfirm($this->
lng->txt(self::CMD_DELETE), self::CMD_DELETE);
285 $c->setCancel($this->
lng->txt(self::CMD_CANCEL), self::CMD_CANCEL);
286 $c->setHeaderText($this->
lng->txt(self::CMD_CONFIRM_DELETE));
288 return $c->getHTML();
297 $this->
ctrl->saveParameterByClass(self::class, self::IDENTIFIER);
300 $c->addItem(self::IDENTIFIER, $this->
hash(
$i->getId()),
$i->getDefaultTitle());
301 $c->setFormAction($this->
ctrl->getFormActionByClass(self::class));
302 $c->setConfirm($this->
lng->txt(self::CMD_MOVE), self::CMD_MOVE);
303 $c->setCancel($this->
lng->txt(self::CMD_CANCEL), self::CMD_CANCEL);
304 $c->setHeaderText($this->
lng->txt(self::CMD_CONFIRM_MOVE));
306 return $c->getHTML();
312 if ($item->isInterchangeable()) {
313 $item->setParent(
'');
317 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_moved"),
true);
Class ilMMAbstractItemGUI.
const CMD_RENDER_INTERRUPTIVE
Class ilMMSubItemTableGUI.
Class ilMMTopItemGUI ilMMSubItemGUI: ilObjMainMenuGUI ilMMSubItemGUI: ilMMItemTranslationGUI.
Class ilMMItemTranslationGUI.
ilMMItemRepository $repository
dispatchCommand(string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
determineCommand(string $standard, string $delete)