41 $this->tab_handling->initTabs(
49 case self::CMD_CREATE:
53 case self::CMD_UPDATE:
55 case self::CMD_CONFIRM_DELETE:
57 case self::CMD_DELETE:
60 case self::CMD_CONFIRM_RESET:
65 case self::CMD_DEFAULT:
67 return $this->
index();
74 protected function index(): string
76 if ($this->
access->hasUserPermissionTo(
'write')) {
78 $button->setCaption($this->
lng->txt(
'common_add_msg'),
false);
79 $button->setUrl($this->
ctrl->getLinkTarget($this, self::CMD_ADD));
80 $this->
toolbar->addButtonInstance($button);
86 protected function add(): string
90 $this->
ctrl->getLinkTarget($this, self::CMD_CREATE)
99 $this->
ctrl->getLinkTarget($this, self::CMD_CREATE)
102 if ($form->saveObject()) {
103 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_success_created'),
true);
104 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
106 return $form->getHTML();
111 $this->
ctrl->setParameter($this, self::IDENTIFIER, null);
112 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
115 protected function edit(): string
129 if ($form->saveObject()) {
130 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_success_updated'),
true);
131 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
133 return $form->getHTML();
140 $confirmation->setFormAction($this->
ctrl->getFormAction($this));
141 $confirmation->addItem(self::IDENTIFIER, $notification->getId(), $notification->getTitle());
142 $confirmation->setCancel($this->
lng->txt(
'msg_form_button_cancel'), self::CMD_CANCEL);
143 $confirmation->setConfirm($this->
lng->txt(
'msg_form_button_delete'), self::CMD_DELETE);
145 return $confirmation->getHTML();
148 protected function delete():
void 151 $notification->delete();
152 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_success_deleted'),
true);
160 $confirmation->setFormAction($this->
ctrl->getFormAction($this));
161 $confirmation->addItem(self::IDENTIFIER, $notification->getId(), $notification->getTitle());
162 $confirmation->setCancel($this->
lng->txt(
'msg_form_button_cancel'), self::CMD_CANCEL);
163 $confirmation->setConfirm($this->
lng->txt(
'msg_form_button_reset'), self::CMD_RESET);
165 return $confirmation->getHTML();
172 $notification->resetForAllUsers();
173 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_success_reset'),
true);
180 if (isset($this->
http->request()->getParsedBody()[self::IDENTIFIER])) {
181 $identifier = $this->
http->request()->getParsedBody()[self::IDENTIFIER];
182 } elseif (isset($this->
http->request()->getParsedBody()[
'interruptive_items'][0])) {
183 $identifier = $this->
http->request()->getParsedBody()[
'interruptive_items'][0];
185 $identifier = $this->
http->request()->getQueryParams()[self::IDENTIFIER] ?? null;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getNotificationFromRequest()
PhpIncompatibleReturnTypeInspection
static http()
Fetches the global http state from ILIAS.
static findOrFail($primary_key, array $add_constructor_args=array())
Tries to find the object and throws an Exception if object is not found, instead of returning null...
Class ilADNNotificationTableGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...