ILIAS  release_8 Revision v8.24
ilADNNotificationGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilADNNotificationGUI:
+ Collaboration diagram for ilADNNotificationGUI:

Data Fields

const TAB_TABLE = 'notifications'
 
const CMD_DEFAULT = 'index'
 
const CMD_ADD = 'add'
 
const CMD_CREATE = 'save'
 
const CMD_UPDATE = 'update'
 
const CMD_EDIT = 'edit'
 
const CMD_CANCEL = 'cancel'
 
const CMD_DELETE = 'delete'
 
const CMD_CONFIRM_DELETE = 'confirmDelete'
 
const CMD_CONFIRM_RESET = 'confirmReset'
 
const CMD_RESET = 'reset'
 
- Data Fields inherited from ilADNAbstractGUI
const IDENTIFIER = 'identifier'
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 

Protected Member Functions

 dispatchCommand ($cmd)
 
 index ()
 
 add ()
 
 create ()
 
 cancel ()
 
 edit ()
 
 update ()
 
 confirmDelete ()
 
 delete ()
 
 confirmReset ()
 
 reset ()
 
 getNotificationFromRequest ()
 @noinspection PhpIncompatibleReturnTypeInspection More...
 
- Protected Member Functions inherited from ilADNAbstractGUI
 determineCommand (?string $standard=null)
 
 dispatchCommand (string $cmd)
 

Additional Inherited Members

- Public Member Functions inherited from ilADNAbstractGUI
 __construct (ilADNTabHandling $tab_handling)
 ilADNAbstractGUI constructor. More...
 
 executeCommand ()
 
- Protected Attributes inherited from ilADNAbstractGUI
ILIAS DI UIServices $ui
 
ILIAS HTTP Services $http
 
ilToolbarGUI $toolbar
 
ilADNTabHandling $tab_handling
 
ilTabsGUI $tabs
 
ilCtrl $ctrl
 
ilObjAdministrativeNotificationAccess $access
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilADNNotificationGUI @ilCtrl_IsCalledBy ilADNNotificationGUI: ilObjAdministrativeNotificationGUI @ilCtrl_IsCalledBy ilADNNotificationGUI: ilObjAdministrativeNotificationGUI

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 25 of file class.ilADNNotificationGUI.php.

Member Function Documentation

◆ add()

ilADNNotificationGUI::add ( )
protected

Definition at line 86 of file class.ilADNNotificationGUI.php.

86 : string
87 {
90 $this->ctrl->getLinkTarget($this, self::CMD_CREATE)
91 );
92 return $form->getHTML();
93 }
Class ilADNNotificationUIFormGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl().

Referenced by dispatchCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilADNNotificationGUI::cancel ( )
protected

Definition at line 109 of file class.ilADNNotificationGUI.php.

109 : void
110 {
111 $this->ctrl->setParameter($this, self::IDENTIFIER, null);
112 $this->ctrl->redirect($this, self::CMD_DEFAULT);
113 }

References ILIAS\Repository\ctrl().

Referenced by delete(), and reset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDelete()

ilADNNotificationGUI::confirmDelete ( )
protected

Definition at line 136 of file class.ilADNNotificationGUI.php.

136 : string
137 {
138 $notification = $this->getNotificationFromRequest();
139 $confirmation = new ilConfirmationGUI();
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);
144
145 return $confirmation->getHTML();
146 }
getNotificationFromRequest()
@noinspection PhpIncompatibleReturnTypeInspection
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), getNotificationFromRequest(), and ILIAS\Repository\lng().

Referenced by dispatchCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmReset()

ilADNNotificationGUI::confirmReset ( )
protected

Definition at line 156 of file class.ilADNNotificationGUI.php.

156 : string
157 {
158 $notification = $this->getNotificationFromRequest();
159 $confirmation = new ilConfirmationGUI();
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);
164
165 return $confirmation->getHTML();
166 }

References ILIAS\Repository\ctrl(), getNotificationFromRequest(), and ILIAS\Repository\lng().

Referenced by dispatchCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilADNNotificationGUI::create ( )
protected

Definition at line 95 of file class.ilADNNotificationGUI.php.

95 : string
96 {
99 $this->ctrl->getLinkTarget($this, self::CMD_CREATE)
100 );
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);
105 }
106 return $form->getHTML();
107 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by dispatchCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilADNNotificationGUI::delete ( )
protected

Definition at line 148 of file class.ilADNNotificationGUI.php.

148 : void
149 {
150 $notification = $this->getNotificationFromRequest();
151 $notification->delete();
152 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_success_deleted'), true);
153 $this->cancel();
154 }

References cancel(), getNotificationFromRequest(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ dispatchCommand()

ilADNNotificationGUI::dispatchCommand (   $cmd)
protected

Definition at line 39 of file class.ilADNNotificationGUI.php.

39 : string
40 {
41 $this->tab_handling->initTabs(
44 true
45 );
46 switch ($cmd) {
47 case self::CMD_ADD:
48 return $this->add();
50 return $this->create();
51 case self::CMD_EDIT:
52 return $this->edit();
54 return $this->update();
56 return $this->confirmDelete();
58 $this->delete();
59 break;
61 return $this->confirmReset();
62 case self::CMD_RESET:
63 $this->reset();
64 break;
66 default:
67 return $this->index();
68
69 }
70
71 return "";
72 }

References add(), CMD_ADD, CMD_CONFIRM_DELETE, CMD_CONFIRM_RESET, CMD_CREATE, CMD_DEFAULT, CMD_DELETE, CMD_EDIT, CMD_RESET, CMD_UPDATE, ilMMSubItemGUI\CMD_VIEW_SUB_ITEMS, confirmDelete(), confirmReset(), create(), edit(), index(), reset(), ilObjAdministrativeNotificationGUI\TAB_MAIN, and update().

+ Here is the call graph for this function:

◆ edit()

ilADNNotificationGUI::edit ( )
protected

Definition at line 115 of file class.ilADNNotificationGUI.php.

115 : string
116 {
117 $notification = $this->getNotificationFromRequest();
118 $this->ctrl->setParameter($this, ilADNAbstractGUI::IDENTIFIER, $notification->getId());
119
120 $form = new ilADNNotificationUIFormGUI($notification, $this->ctrl->getLinkTarget($this, self::CMD_UPDATE));
121 return $form->getHTML();
122 }

References ILIAS\Repository\ctrl(), getNotificationFromRequest(), and ilADNAbstractGUI\IDENTIFIER.

Referenced by dispatchCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNotificationFromRequest()

ilADNNotificationGUI::getNotificationFromRequest ( )
protected

@noinspection PhpIncompatibleReturnTypeInspection

Definition at line 178 of file class.ilADNNotificationGUI.php.

179 {
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];
184 } else {
185 $identifier = $this->http->request()->getQueryParams()[self::IDENTIFIER] ?? null;
186 }
187
188 return ilADNNotification::findOrFail($identifier);
189 }
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.
static http()
Fetches the global http state from ILIAS.

References ActiveRecord\findOrFail(), ILIAS\FileDelivery\http(), and ilADNAbstractGUI\IDENTIFIER.

Referenced by confirmDelete(), confirmReset(), delete(), edit(), reset(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index()

ilADNNotificationGUI::index ( )
protected

Definition at line 74 of file class.ilADNNotificationGUI.php.

74 : string
75 {
76 if ($this->access->hasUserPermissionTo('write')) {
77 $button = ilLinkButton::getInstance();
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);
81 }
82
83 return (new ilADNNotificationTableGUI($this, self::CMD_DEFAULT))->getHTML();
84 }
Class ilADNNotificationTableGUI.

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilLinkButton\getInstance(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

Referenced by dispatchCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset()

ilADNNotificationGUI::reset ( )
protected

Definition at line 168 of file class.ilADNNotificationGUI.php.

168 : void
169 {
170 $notification = $this->getNotificationFromRequest();
171
172 $notification->resetForAllUsers();
173 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_success_reset'), true);
174 $this->cancel();
175 }

References cancel(), getNotificationFromRequest(), and ILIAS\Repository\lng().

Referenced by dispatchCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilADNNotificationGUI::update ( )
protected

Definition at line 124 of file class.ilADNNotificationGUI.php.

124 : string
125 {
126 $notification = $this->getNotificationFromRequest();
127 $form = new ilADNNotificationUIFormGUI($notification, $this->ctrl->getLinkTarget($this, self::CMD_UPDATE));
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);
132 }
133 return $form->getHTML();
134 }

References ILIAS\Repository\ctrl(), getNotificationFromRequest(), and ILIAS\Repository\lng().

Referenced by dispatchCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ CMD_ADD

const ilADNNotificationGUI::CMD_ADD = 'add'

Definition at line 29 of file class.ilADNNotificationGUI.php.

Referenced by dispatchCommand().

◆ CMD_CANCEL

const ilADNNotificationGUI::CMD_CANCEL = 'cancel'

Definition at line 33 of file class.ilADNNotificationGUI.php.

◆ CMD_CONFIRM_DELETE

const ilADNNotificationGUI::CMD_CONFIRM_DELETE = 'confirmDelete'

Definition at line 35 of file class.ilADNNotificationGUI.php.

Referenced by dispatchCommand().

◆ CMD_CONFIRM_RESET

const ilADNNotificationGUI::CMD_CONFIRM_RESET = 'confirmReset'

Definition at line 36 of file class.ilADNNotificationGUI.php.

Referenced by dispatchCommand().

◆ CMD_CREATE

const ilADNNotificationGUI::CMD_CREATE = 'save'

Definition at line 30 of file class.ilADNNotificationGUI.php.

Referenced by dispatchCommand().

◆ CMD_DEFAULT

const ilADNNotificationGUI::CMD_DEFAULT = 'index'

Definition at line 28 of file class.ilADNNotificationGUI.php.

Referenced by dispatchCommand().

◆ CMD_DELETE

const ilADNNotificationGUI::CMD_DELETE = 'delete'

Definition at line 34 of file class.ilADNNotificationGUI.php.

Referenced by dispatchCommand().

◆ CMD_EDIT

const ilADNNotificationGUI::CMD_EDIT = 'edit'

Definition at line 32 of file class.ilADNNotificationGUI.php.

Referenced by dispatchCommand().

◆ CMD_RESET

const ilADNNotificationGUI::CMD_RESET = 'reset'

Definition at line 37 of file class.ilADNNotificationGUI.php.

Referenced by dispatchCommand().

◆ CMD_UPDATE

const ilADNNotificationGUI::CMD_UPDATE = 'update'

Definition at line 31 of file class.ilADNNotificationGUI.php.

Referenced by dispatchCommand().

◆ TAB_TABLE

const ilADNNotificationGUI::TAB_TABLE = 'notifications'

Definition at line 27 of file class.ilADNNotificationGUI.php.

Referenced by ilADNAbstractGUI\executeCommand().


The documentation for this class was generated from the following file: