3declare(strict_types=1);
21use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
57 $this->
access->checkAccessAndThrowException(
"visible,read");
60 return $this->
index();
62 $this->
access->checkAccessAndThrowException(
'write');
65 return $this->
add($DIC);
67 $this->
access->checkAccessAndThrowException(
'write');
70 return $this->
create($DIC);
72 $this->
access->checkAccessAndThrowException(
'write');
75 return $this->
edit($DIC);
77 $this->
access->checkAccessAndThrowException(
'write');
80 return $this->
update($DIC);
82 $this->
access->checkAccessAndThrowException(
'write');
88 $this->
access->checkAccessAndThrowException(
'write');
92 $this->
access->checkAccessAndThrowException(
'write');
100 $this->
access->checkAccessAndThrowException(
'write');
103 $this->
access->checkAccessAndThrowException(
'write');
109 $this->
access->checkAccessAndThrowException(
'write');
112 $this->
access->checkAccessAndThrowException(
'write');
116 $this->
access->checkAccessAndThrowException(
'write');
119 $this->
access->checkAccessAndThrowException(
'write');
130 $r =
$DIC->http()->request()->getParsedBody();
131 foreach ($r[self::IDENTIFIER] as $identification_string =>
$data) {
132 $item = $this->
repository->getItemFacadeForIdentificationString($this->unhash($identification_string));
133 $item->setPosition((
int) (
$data[
'position'] ?? 999));
134 $item->setActiveStatus((
bool) (
$data[
'active'] ??
false));
142 $next_class = $this->
ctrl->getNextClass();
144 if ($next_class ===
'') {
151 switch ($next_class) {
152 case strtolower(ilMMItemTranslationGUI::class):
155 $this->
ctrl->forwardCommand($g);
167 if ($this->
access->hasUserPermissionTo(
'write')) {
170 $b->setCaption($this->
lng->txt(self::CMD_ADD),
false);
171 $b->setUrl($this->
ctrl->getLinkTarget($this, self::CMD_ADD));
176 $b->setCaption($this->
lng->txt(self::CMD_RESTORE),
false);
177 $b->setUrl($this->
ctrl->getLinkTarget($this, self::CMD_CONFIRM_RESTORE));
183 $b->setUrl($this->
ctrl->getLinkTarget($this, self::CMD_FLUSH));
184 $b->setCaption($this->
lng->txt(self::CMD_FLUSH),
false);
191 $table->setShowRowsSelector(
false);
193 return $table->getHTML();
198 $this->
ctrl->redirectByClass(self::class, self::CMD_VIEW_TOP_ITEMS);
203 $this->
ctrl->redirectByClass(self::class, self::CMD_CANCEL);
215 return $f->getHTML();
230 return $f->getHTML();
242 return $f->getHTML();
253 if ($item->isEditable()) {
259 return $f->getHTML();
265 private function delete():
void
268 if ($item->isDeletable()) {
271 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_topitem_deleted"),
true);
281 $this->
ctrl->saveParameterByClass(self::class, self::IDENTIFIER);
284 $c->addItem(self::IDENTIFIER, $this->hash(
$i->getId()),
$i->getDefaultTitle());
285 $c->setFormAction($this->
ctrl->getFormActionByClass(self::class));
286 $c->setConfirm($this->
lng->txt(self::CMD_DELETE), self::CMD_DELETE);
287 $c->setCancel($this->
lng->txt(self::CMD_CANCEL), self::CMD_CANCEL);
288 $c->setHeaderText($this->
lng->txt(self::CMD_CONFIRM_DELETE));
290 return $c->getHTML();
296 $c->setFormAction($this->
ctrl->getFormActionByClass(self::class));
297 $c->setConfirm($this->
lng->txt(self::CMD_DELETE), self::CMD_RESTORE);
298 $c->setCancel($this->
lng->txt(self::CMD_CANCEL), self::CMD_CANCEL);
299 $c->setHeaderText($this->
lng->txt(
'msg_restore_confirm'));
301 return $c->getHTML();
312 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_restored'),
true);
321 return $this->
ui->renderer()->render($form);
327 $form = $form->withRequest($this->
http->request());
331 $data = $form->getData();
332 if ($item->isInterchangeable() && isset(
$data[0])) {
334 $item->setParent(
$data[0]);
336 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_moved'),
true);
338 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_not_moved'),
true);
349 $this->
ctrl->saveParameter($this, self::IDENTIFIER);
350 $f = $this->
ui->factory();
352 $parent =
$f->input()->field()->select($this->
lng->txt(
'select_parent'), $this->repository->getPossibleParentsForFormAndTable())->withRequired(
true);
354 return $f->input()->container()->form()->standard($this->
ctrl->getFormAction($this, self::CMD_MOVE), [$parent]);
static flushDB()
@depracated never use in ILIAS Core, Plugins only
Customizing of pimple-DIC for ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilMMAbstractItemGUI.
determineCommand(string $standard, string $delete)
Class ilMMItemRepository.
Class ilMMItemTranslationGUI.
Class ilMMTopItemGUI @ilCtrl_IsCalledBy ilMMTopItemGUI: ilObjMainMenuGUI @ilCtrl_Calls ilMMTopItemGUI...
dispatchCommand(string $cmd)
const CMD_CONFIRM_RESTORE
const CMD_RENDER_INTERRUPTIVE
Class ilMMTopItemTableGUI.
static http()
Fetches the global http state from ILIAS.