25 $this->tab_handling->initTabs(
34 case self::CMD_CREATE:
38 case self::CMD_UPDATE:
40 case self::CMD_CONFIRM_DELETE:
42 case self::CMD_DELETE:
45 case self::CMD_CONFIRM_RESET:
48 return $this->
reset();
49 case self::CMD_DEFAULT:
51 return $this->
index();
58 protected function index() : string
60 if ($this->access->hasUserPermissionTo(
'write')) {
62 $button->setCaption($this->lng->txt(
'common_add_msg'),
false);
63 $button->setUrl($this->ctrl->getLinkTarget($this, self::CMD_ADD));
64 $this->toolbar->addButtonInstance($button);
68 return $notMessageTableGUI->getHTML();
71 protected function add() : string
75 $this->ctrl->getLinkTarget($this, self::CMD_CREATE)
78 return $form->getHTML();
85 $this->ctrl->getLinkTarget($this, self::CMD_CREATE)
88 if ($form->saveObject()) {
89 ilUtil::sendSuccess($this->lng->txt(
'msg_success_created'),
true);
90 $this->ctrl->redirect($this, self::CMD_DEFAULT);
92 return $form->getHTML();
97 $this->ctrl->setParameter($this, self::IDENTIFIER, null);
98 $this->ctrl->redirect($this, self::CMD_DEFAULT);
101 protected function edit() : string
108 return $form->getHTML();
116 if ($form->saveObject()) {
117 ilUtil::sendSuccess($this->lng->txt(
'msg_success_updated'),
true);
118 $this->ctrl->redirect($this, self::CMD_DEFAULT);
120 return $form->getHTML();
127 $confirmation->setFormAction($this->ctrl->getFormAction($this));
128 $confirmation->addItem(self::IDENTIFIER, $notification->getId(), $notification->getTitle());
129 $confirmation->setCancel($this->lng->txt(
'msg_form_button_cancel'), self::CMD_CANCEL);
130 $confirmation->setConfirm($this->lng->txt(
'msg_form_button_delete'), self::CMD_DELETE);
132 return $confirmation->getHTML();
135 protected function delete() :
void 138 $notification->delete();
139 ilUtil::sendSuccess($this->lng->txt(
'msg_success_deleted'),
true);
147 $confirmation->setFormAction($this->ctrl->getFormAction($this));
148 $confirmation->addItem(self::IDENTIFIER, $notification->getId(), $notification->getTitle());
149 $confirmation->setCancel($this->lng->txt(
'msg_form_button_cancel'), self::CMD_CANCEL);
150 $confirmation->setConfirm($this->lng->txt(
'msg_form_button_reset'), self::CMD_RESET);
152 return $confirmation->getHTML();
159 $notification->resetForAllUsers();
160 ilUtil::sendSuccess($this->lng->txt(
'msg_success_reset'),
true);
169 if (isset($this->
http->request()->getParsedBody()[self::IDENTIFIER])) {
170 $identifier = $this->
http->request()->getParsedBody()[self::IDENTIFIER];
171 } elseif (isset($this->
http->request()->getParsedBody()[
'interruptive_items'][0])) {
172 $identifier = $this->
http->request()->getParsedBody()[
'interruptive_items'][0];
174 $identifier = $this->
http->request()->getQueryParams()[self::IDENTIFIER];
Class ilADNNotificationGUI ilADNNotificationGUI: ilObjAdministrativeNotificationGUI ilADNNotificati...
getNotificationFromRequest()
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.
Confirmation screen class.