ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 ()
 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 ilADNNotificationGUI: ilObjAdministrativeNotificationGUI 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.

References ILIAS\Repository\ctrl(), and ilADNNotificationUIFormGUI\getHTML().

Referenced by dispatchCommand().

86  : string
87  {
88  $form = new ilADNNotificationUIFormGUI(
89  new ilADNNotification(),
90  $this->ctrl->getLinkTarget($this, self::CMD_CREATE)
91  );
92  return $form->getHTML();
93  }
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 109 of file class.ilADNNotificationGUI.php.

References ILIAS\Repository\ctrl().

Referenced by delete(), and reset().

109  : void
110  {
111  $this->ctrl->setParameter($this, self::IDENTIFIER, null);
112  $this->ctrl->redirect($this, self::CMD_DEFAULT);
113  }
+ 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.

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

Referenced by dispatchCommand().

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()
PhpIncompatibleReturnTypeInspection
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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.

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

Referenced by dispatchCommand().

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  }
getNotificationFromRequest()
PhpIncompatibleReturnTypeInspection
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ 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.

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

Referenced by dispatchCommand().

95  : string
96  {
97  $form = new ilADNNotificationUIFormGUI(
98  new ilADNNotification(),
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  }
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 148 of file class.ilADNNotificationGUI.php.

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

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  }
getNotificationFromRequest()
PhpIncompatibleReturnTypeInspection
+ Here is the call graph for this function:

◆ dispatchCommand()

ilADNNotificationGUI::dispatchCommand (   $cmd)
protected

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

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

39  : string
40  {
41  $this->tab_handling->initTabs(
44  true
45  );
46  switch ($cmd) {
47  case self::CMD_ADD:
48  return $this->add();
49  case self::CMD_CREATE:
50  return $this->create();
51  case self::CMD_EDIT:
52  return $this->edit();
53  case self::CMD_UPDATE:
54  return $this->update();
55  case self::CMD_CONFIRM_DELETE:
56  return $this->confirmDelete();
57  case self::CMD_DELETE:
58  $this->delete();
59  break;
60  case self::CMD_CONFIRM_RESET:
61  return $this->confirmReset();
62  case self::CMD_RESET:
63  $this->reset();
64  break;
65  case self::CMD_DEFAULT:
66  default:
67  return $this->index();
68 
69  }
70 
71  return "";
72  }
+ Here is the call graph for this function:

◆ edit()

ilADNNotificationGUI::edit ( )
protected

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

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

Referenced by dispatchCommand().

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  }
getNotificationFromRequest()
PhpIncompatibleReturnTypeInspection
Class ilADNNotificationUIFormGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNotificationFromRequest()

ilADNNotificationGUI::getNotificationFromRequest ( )
protected

PhpIncompatibleReturnTypeInspection

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

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

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

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

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

Referenced by dispatchCommand().

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

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

Referenced by dispatchCommand().

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  }
getNotificationFromRequest()
PhpIncompatibleReturnTypeInspection
+ 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.

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

Referenced by dispatchCommand().

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  }
getNotificationFromRequest()
PhpIncompatibleReturnTypeInspection
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 29 of file class.ilADNNotificationGUI.php.

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

◆ CMD_CONFIRM_RESET

const ilADNNotificationGUI::CMD_CONFIRM_RESET = 'confirmReset'

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

◆ CMD_CREATE

const ilADNNotificationGUI::CMD_CREATE = 'save'

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

◆ CMD_DEFAULT

const ilADNNotificationGUI::CMD_DEFAULT = 'index'

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

◆ CMD_DELETE

const ilADNNotificationGUI::CMD_DELETE = 'delete'

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

Referenced by ilADNNotificationTableGUI\formatDate().

◆ CMD_EDIT

const ilADNNotificationGUI::CMD_EDIT = 'edit'

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

Referenced by ilADNNotificationTableGUI\formatDate().

◆ CMD_RESET

const ilADNNotificationGUI::CMD_RESET = 'reset'

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

Referenced by ilADNNotificationTableGUI\formatDate().

◆ CMD_UPDATE

const ilADNNotificationGUI::CMD_UPDATE = 'update'

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

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