ILIAS  release_7 Revision v7.30-3-g800a261c036
ilADNNotificationGUI Class Reference

Class ilADNNotificationGUI @ilCtrl_IsCalledBy ilADNNotificationGUI: ilObjAdministrativeNotificationGUI @ilCtrl_IsCalledBy ilADNNotificationGUI: ilObjAdministrativeNotificationGUI. 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'
 
 $lng
 
 $tpl
 
 $tree
 

Protected Member Functions

 dispatchCommand ($cmd)
 
 index ()
 
 add ()
 
 create ()
 
 cancel ()
 
 edit ()
 
 update ()
 
 confirmDelete ()
 
 delete ()
 
 confirmReset ()
 
 reset ()
 
 getNotificationFromRequest ()
 
- 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
 $ui
 
 $http
 
 $toolbar
 
 $tab_handling
 
 $tabs
 
 $ctrl
 
 $access
 

Detailed Description

Member Function Documentation

◆ add()

ilADNNotificationGUI::add ( )
protected

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

71 : string
72 {
75 $this->ctrl->getLinkTarget($this, self::CMD_CREATE)
76 );
77 $form->fillForm();
78 return $form->getHTML();
79 }
Class ilADNNotificationUIFormGUI.

Referenced by dispatchCommand().

+ Here is the caller graph for this function:

◆ cancel()

ilADNNotificationGUI::cancel ( )
protected

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

95 : string
96 {
97 $this->ctrl->setParameter($this, self::IDENTIFIER, null);
98 $this->ctrl->redirect($this, self::CMD_DEFAULT);
99 }

Referenced by delete(), and reset().

+ Here is the caller graph for this function:

◆ confirmDelete()

ilADNNotificationGUI::confirmDelete ( )
protected

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

123 : string
124 {
125 $notification = $this->getNotificationFromRequest();
126 $confirmation = new ilConfirmationGUI();
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);
131
132 return $confirmation->getHTML();
133 }
Confirmation screen class.

References getNotificationFromRequest().

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 143 of file class.ilADNNotificationGUI.php.

143 : string
144 {
145 $notification = $this->getNotificationFromRequest();
146 $confirmation = new ilConfirmationGUI();
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);
151
152 return $confirmation->getHTML();
153 }

References getNotificationFromRequest().

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 81 of file class.ilADNNotificationGUI.php.

81 : string
82 {
85 $this->ctrl->getLinkTarget($this, self::CMD_CREATE)
86 );
87 $form->setValuesByPost();
88 if ($form->saveObject()) {
89 ilUtil::sendSuccess($this->lng->txt('msg_success_created'), true);
90 $this->ctrl->redirect($this, self::CMD_DEFAULT);
91 }
92 return $form->getHTML();
93 }

Referenced by dispatchCommand().

+ Here is the caller graph for this function:

◆ delete()

ilADNNotificationGUI::delete ( )
protected

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

135 : void
136 {
137 $notification = $this->getNotificationFromRequest();
138 $notification->delete();
139 ilUtil::sendSuccess($this->lng->txt('msg_success_deleted'), true);
140 $this->cancel();
141 }

References cancel(), and getNotificationFromRequest().

+ Here is the call graph for this function:

◆ dispatchCommand()

ilADNNotificationGUI::dispatchCommand (   $cmd)
protected

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

23 : string
24 {
25 $this->tab_handling->initTabs(
28 true,
29 self::class
30 );
31 switch ($cmd) {
32 case self::CMD_ADD:
33 return $this->add();
35 return $this->create();
36 case self::CMD_EDIT:
37 return $this->edit();
39 return $this->update();
41 return $this->confirmDelete();
43 $this->delete();
44 break;
46 return $this->confirmReset();
47 case self::CMD_RESET:
48 return $this->reset();
50 default:
51 return $this->index();
52
53 }
54
55 return "";
56 }

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 101 of file class.ilADNNotificationGUI.php.

101 : string
102 {
103 $notification = $this->getNotificationFromRequest();
104 $this->ctrl->setParameter($this, ilADNNotificationGUI::IDENTIFIER, $notification->getId());
105
106 $form = new ilADNNotificationUIFormGUI($notification, $this->ctrl->getLinkTarget($this, self::CMD_UPDATE));
107 $form->fillForm();
108 return $form->getHTML();
109 }

References 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
Returns
ilADNNotification

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

168 {
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];
173 } else {
174 $identifier = $this->http->request()->getQueryParams()[self::IDENTIFIER];
175 }
176
177 return ilADNNotification::findOrFail($identifier);
178 }
Class ActiveRecord.
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 58 of file class.ilADNNotificationGUI.php.

58 : string
59 {
60 if ($this->access->hasUserPermissionTo('write')) {
61 $button = ilLinkButton::getInstance();
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);
65 }
66
67 $notMessageTableGUI = new ilADNNotificationTableGUI($this, self::CMD_DEFAULT);
68 return $notMessageTableGUI->getHTML();
69 }
Class ilADNNotificationTableGUI.
static getInstance()
Factory.

References ilLinkButton\getInstance().

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 155 of file class.ilADNNotificationGUI.php.

156 {
157 $notification = $this->getNotificationFromRequest();
158
159 $notification->resetForAllUsers();
160 ilUtil::sendSuccess($this->lng->txt('msg_success_reset'), true);
161 $this->cancel();
162 }

References cancel(), and getNotificationFromRequest().

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 111 of file class.ilADNNotificationGUI.php.

111 : string
112 {
113 $notification = $this->getNotificationFromRequest();
114 $form = new ilADNNotificationUIFormGUI($notification, $this->ctrl->getLinkTarget($this, self::CMD_UPDATE));
115 $form->setValuesByPost();
116 if ($form->saveObject()) {
117 ilUtil::sendSuccess($this->lng->txt('msg_success_updated'), true);
118 $this->ctrl->redirect($this, self::CMD_DEFAULT);
119 }
120 return $form->getHTML();
121 }

References getNotificationFromRequest().

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 13 of file class.ilADNNotificationGUI.php.

Referenced by dispatchCommand().

◆ CMD_CANCEL

const ilADNNotificationGUI::CMD_CANCEL = 'cancel'

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

◆ CMD_CONFIRM_DELETE

const ilADNNotificationGUI::CMD_CONFIRM_DELETE = 'confirmDelete'

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

Referenced by dispatchCommand().

◆ CMD_CONFIRM_RESET

const ilADNNotificationGUI::CMD_CONFIRM_RESET = 'confirmReset'

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

Referenced by dispatchCommand().

◆ CMD_CREATE

const ilADNNotificationGUI::CMD_CREATE = 'save'

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

Referenced by dispatchCommand().

◆ CMD_DEFAULT

const ilADNNotificationGUI::CMD_DEFAULT = 'index'

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

Referenced by dispatchCommand().

◆ CMD_DELETE

const ilADNNotificationGUI::CMD_DELETE = 'delete'

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

Referenced by dispatchCommand().

◆ CMD_EDIT

const ilADNNotificationGUI::CMD_EDIT = 'edit'

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

Referenced by dispatchCommand().

◆ CMD_RESET

const ilADNNotificationGUI::CMD_RESET = 'reset'

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

Referenced by dispatchCommand().

◆ CMD_UPDATE

const ilADNNotificationGUI::CMD_UPDATE = 'update'

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

Referenced by dispatchCommand().

◆ TAB_TABLE

const ilADNNotificationGUI::TAB_TABLE = 'notifications'

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

Referenced by ilADNAbstractGUI\executeCommand().


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