41 $this->tab_handling->initTabs(
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)
92 return $form->getHTML();
99 $this->
ctrl->getLinkTarget($this, self::CMD_CREATE)
101 $form->setValuesByPost();
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
121 return $form->getHTML();
128 $form->setValuesByPost();
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])) {
182 } elseif (isset($this->
http->request()->getParsedBody()[
'interruptive_items'][0])) {
183 $identifier = $this->
http->request()->getParsedBody()[
'interruptive_items'][0];
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.
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()
@noinspection PhpIncompatibleReturnTypeInspection
Class ilADNNotificationTableGUI.
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...
static http()
Fetches the global http state from ILIAS.