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

Class ilADNNotificationGUI ilADNNotificationGUI: ilObjAdministrativeNotificationGUI 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.

References ilADNNotificationUIFormGUI\fillForm().

Referenced by dispatchCommand().

71  : string
72  {
73  $form = new ilADNNotificationUIFormGUI(
74  new ilADNNotification(),
75  $this->ctrl->getLinkTarget($this, self::CMD_CREATE)
76  );
77  $form->fillForm();
78  return $form->getHTML();
79  }
Class ilADNNotificationUIFormGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilADNNotificationGUI::cancel ( )
protected

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

Referenced by delete(), and reset().

95  : string
96  {
97  $this->ctrl->setParameter($this, self::IDENTIFIER, null);
98  $this->ctrl->redirect($this, self::CMD_DEFAULT);
99  }
+ Here is the caller graph for this function:

◆ confirmDelete()

ilADNNotificationGUI::confirmDelete ( )
protected

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

References getNotificationFromRequest().

Referenced by dispatchCommand().

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.
+ 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.

References getNotificationFromRequest().

Referenced by dispatchCommand().

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  }
Confirmation screen class.
+ 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.

References ilADNNotificationUIFormGUI\setValuesByPost().

Referenced by dispatchCommand().

81  : string
82  {
83  $form = new ilADNNotificationUIFormGUI(
84  new ilADNNotification(),
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  }
Class ilADNNotificationUIFormGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilADNNotificationGUI::delete ( )
protected

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

References cancel(), and getNotificationFromRequest().

135  : void
136  {
137  $notification = $this->getNotificationFromRequest();
138  $notification->delete();
139  ilUtil::sendSuccess($this->lng->txt('msg_success_deleted'), true);
140  $this->cancel();
141  }
+ Here is the call graph for this function:

◆ dispatchCommand()

ilADNNotificationGUI::dispatchCommand (   $cmd)
protected

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

References add(), ilMMSubItemGUI\CMD_VIEW_SUB_ITEMS, confirmDelete(), confirmReset(), create(), edit(), index(), reset(), ilObjAdministrativeNotificationGUI\TAB_MAIN, and update().

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();
34  case self::CMD_CREATE:
35  return $this->create();
36  case self::CMD_EDIT:
37  return $this->edit();
38  case self::CMD_UPDATE:
39  return $this->update();
40  case self::CMD_CONFIRM_DELETE:
41  return $this->confirmDelete();
42  case self::CMD_DELETE:
43  $this->delete();
44  break;
45  case self::CMD_CONFIRM_RESET:
46  return $this->confirmReset();
47  case self::CMD_RESET:
48  return $this->reset();
49  case self::CMD_DEFAULT:
50  default:
51  return $this->index();
52 
53  }
54 
55  return "";
56  }
+ Here is the call graph for this function:

◆ edit()

ilADNNotificationGUI::edit ( )
protected

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

References ilADNNotificationUIFormGUI\fillForm(), getNotificationFromRequest(), and ilADNAbstractGUI\IDENTIFIER.

Referenced by dispatchCommand().

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  }
Class ilADNNotificationUIFormGUI.
+ 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.

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

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

167  : ActiveRecord
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  }
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...
+ 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.

References ilLinkButton\getInstance().

Referenced by dispatchCommand().

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.
+ 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.

References cancel(), and getNotificationFromRequest().

Referenced by dispatchCommand().

156  {
157  $notification = $this->getNotificationFromRequest();
158 
159  $notification->resetForAllUsers();
160  ilUtil::sendSuccess($this->lng->txt('msg_success_reset'), true);
161  $this->cancel();
162  }
+ 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.

References getNotificationFromRequest(), and ilADNNotificationUIFormGUI\setValuesByPost().

Referenced by dispatchCommand().

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  }
Class ilADNNotificationUIFormGUI.
+ 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.

◆ 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.

◆ CMD_CONFIRM_RESET

const ilADNNotificationGUI::CMD_CONFIRM_RESET = 'confirmReset'

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

◆ CMD_CREATE

const ilADNNotificationGUI::CMD_CREATE = 'save'

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

◆ CMD_DEFAULT

const ilADNNotificationGUI::CMD_DEFAULT = 'index'

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

◆ CMD_DELETE

const ilADNNotificationGUI::CMD_DELETE = 'delete'

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

Referenced by ilADNNotificationTableGUI\formatDate().

◆ CMD_EDIT

const ilADNNotificationGUI::CMD_EDIT = 'edit'

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

Referenced by ilADNNotificationTableGUI\formatDate().

◆ CMD_RESET

const ilADNNotificationGUI::CMD_RESET = 'reset'

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

Referenced by ilADNNotificationTableGUI\formatDate().

◆ CMD_UPDATE

const ilADNNotificationGUI::CMD_UPDATE = 'update'

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

◆ 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: