ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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_DUPLICATE = 'duplicate'
 
const CMD_CANCEL = 'cancel'
 
const CMD_DELETE = 'delete'
 
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 ()
 
 duplicate ()
 
 update ()
 
 delete ()
 
 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 84 of file class.ilADNNotificationGUI.php.

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

Referenced by dispatchCommand().

84  : string
85  {
86  $form = new ilADNNotificationUIFormGUI(
87  new ilADNNotification(),
88  $this->ctrl->getLinkTarget($this, self::CMD_CREATE)
89  );
90  return $form->getHTML();
91  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilADNNotificationGUI::cancel ( )
protected

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

References ILIAS\Repository\ctrl().

Referenced by delete(), duplicate(), and reset().

107  : void
108  {
109  $this->ctrl->setParameter($this, self::IDENTIFIER, null);
110  $this->ctrl->redirect($this, self::CMD_DEFAULT);
111  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilADNNotificationGUI::create ( )
protected

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

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

Referenced by dispatchCommand().

93  : string
94  {
95  $form = new ilADNNotificationUIFormGUI(
96  new ilADNNotification(),
97  $this->ctrl->getLinkTarget($this, self::CMD_CREATE)
98  );
99  $form->setValuesByPost();
100  if ($form->saveObject()) {
101  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_success_created'), true);
102  $this->ctrl->redirect($this, self::CMD_DEFAULT);
103  }
104  return $form->getHTML();
105  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilADNNotificationGUI::delete ( )
protected

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

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

143  : void
144  {
145  $notification = $this->getNotificationFromRequest();
146  $notification->delete();
147  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_success_deleted'), true);
148  $this->cancel();
149  }
getNotificationFromRequest()
PhpIncompatibleReturnTypeInspection
+ Here is the call graph for this function:

◆ dispatchCommand()

ilADNNotificationGUI::dispatchCommand (   $cmd)
protected

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

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

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

◆ duplicate()

ilADNNotificationGUI::duplicate ( )
protected

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

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

Referenced by dispatchCommand().

122  : void
123  {
124  $notification = $this->getNotificationFromRequest();
125  $notification->setId(0);
126  $notification->create();
127  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_success_duplicated'), true);
128  $this->cancel();
129  }
getNotificationFromRequest()
PhpIncompatibleReturnTypeInspection
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ edit()

ilADNNotificationGUI::edit ( )
protected

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

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

Referenced by dispatchCommand().

113  : string
114  {
115  $notification = $this->getNotificationFromRequest();
116  $this->ctrl->setParameter($this, ilADNAbstractGUI::IDENTIFIER, $notification->getId());
117 
118  $form = new ilADNNotificationUIFormGUI($notification, $this->ctrl->getLinkTarget($this, self::CMD_UPDATE));
119  return $form->getHTML();
120  }
getNotificationFromRequest()
PhpIncompatibleReturnTypeInspection
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNotificationFromRequest()

ilADNNotificationGUI::getNotificationFromRequest ( )
protected

PhpIncompatibleReturnTypeInspection

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

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

Referenced by delete(), duplicate(), edit(), reset(), and update().

162  {
163  if (isset($this->http->request()->getParsedBody()[self::IDENTIFIER])) {
164  $identifier = $this->http->request()->getParsedBody()[self::IDENTIFIER];
165  } elseif (isset($this->http->request()->getParsedBody()['interruptive_items'][0])) {
166  $identifier = $this->http->request()->getParsedBody()['interruptive_items'][0];
167  } else {
168  $identifier = $this->http->request()->getQueryParams()[self::IDENTIFIER] ?? null;
169  }
170 
171  return ilADNNotification::findOrFail($identifier);
172  }
static findOrFail($primary_key, array $add_constructor_args=[])
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index()

ilADNNotificationGUI::index ( )
protected

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

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

Referenced by dispatchCommand().

71  : string
72  {
73  if ($this->access->hasUserPermissionTo('write')) {
74  $btn_add_msg = $this->ui->factory()->button()->standard(
75  $this->lng->txt('common_add_msg'),
76  $this->ctrl->getLinkTarget($this, self::CMD_ADD)
77  );
78  $this->toolbar->addComponent($btn_add_msg);
79  }
80 
81  return (new ilADNNotificationTableGUI($this, self::CMD_DEFAULT))->getHTML();
82  }
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 151 of file class.ilADNNotificationGUI.php.

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

Referenced by dispatchCommand().

151  : void
152  {
153  $notification = $this->getNotificationFromRequest();
154 
155  $notification->resetForAllUsers();
156  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_success_reset'), true);
157  $this->cancel();
158  }
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 131 of file class.ilADNNotificationGUI.php.

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

Referenced by dispatchCommand().

131  : string
132  {
133  $notification = $this->getNotificationFromRequest();
134  $form = new ilADNNotificationUIFormGUI($notification, $this->ctrl->getLinkTarget($this, self::CMD_UPDATE));
135  $form->setValuesByPost();
136  if ($form->saveObject()) {
137  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_success_updated'), true);
138  $this->ctrl->redirect($this, self::CMD_DEFAULT);
139  }
140  return $form->getHTML();
141  }
getNotificationFromRequest()
PhpIncompatibleReturnTypeInspection
+ 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 34 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 35 of file class.ilADNNotificationGUI.php.

Referenced by ilADNNotificationTableGUI\formatDate().

◆ CMD_DUPLICATE

const ilADNNotificationGUI::CMD_DUPLICATE = 'duplicate'

Definition at line 33 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 36 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: