40 $this->tab_handling->initTabs(
48 case self::CMD_CREATE:
52 case self::CMD_DUPLICATE:
55 case self::CMD_UPDATE:
57 case self::CMD_DELETE:
63 case self::CMD_DEFAULT:
65 return $this->
index();
71 protected function index(): string
73 if ($this->
access->hasUserPermissionTo(
'write')) {
74 $btn_add_msg = $this->
ui->factory()->button()->standard(
75 $this->
lng->txt(
'common_add_msg'),
76 $this->
ctrl->getLinkTarget($this, self::CMD_ADD)
78 $this->
toolbar->addComponent($btn_add_msg);
84 protected function add(): string
88 $this->
ctrl->getLinkTarget($this, self::CMD_CREATE)
97 $this->
ctrl->getLinkTarget($this, self::CMD_CREATE)
100 if ($form->saveObject()) {
101 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_success_created'),
true);
102 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
104 return $form->getHTML();
109 $this->
ctrl->setParameter($this, self::IDENTIFIER, null);
110 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
113 protected function edit(): string
125 $notification->setId(0);
126 $notification->create();
127 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_success_duplicated'),
true);
136 if ($form->saveObject()) {
137 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_success_updated'),
true);
138 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
140 return $form->getHTML();
143 protected function delete():
void 146 $notification->delete();
147 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_success_deleted'),
true);
155 $notification->resetForAllUsers();
156 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_success_reset'),
true);
163 if (isset($this->
http->request()->getParsedBody()[self::IDENTIFIER])) {
164 $identifier = $this->
http->request()->getParsedBody()[self::IDENTIFIER];
165 } elseif (isset($this->
http->request()->getParsedBody()[
'interruptive_items'][0])) {
166 $identifier = $this->
http->request()->getParsedBody()[
'interruptive_items'][0];
168 $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...
static findOrFail($primary_key, array $add_constructor_args=[])
Tries to find the object and throws an Exception if object is not found, instead of returning null...
getNotificationFromRequest()
PhpIncompatibleReturnTypeInspection
static http()
Fetches the global http state from ILIAS.
Class ilADNNotificationTableGUI.