ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilOrgUnitTypeGUI Class Reference

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

+ Collaboration diagram for ilOrgUnitTypeGUI:

Public Member Functions

 __construct (ilObjOrgUnitGUI $parent_gui)
 
 executeCommand ()
 

Protected Member Functions

 create ()
 Create (save) type. More...
 

Private Member Functions

 checkAccess ()
 
 setSubTabsEdit (string $active_tab_id)
 
 editCustomIcons ()
 Display form for editing custom icons. More...
 
 updateCustomIcons ()
 
 editAMD ()
 
 updateAMD ()
 
 listTypes ()
 Display all types in a table with actions to edit/delete. More...
 
 add ()
 Display form to create a new OrgUnit type. More...
 
 edit ()
 Display form to edit an existing OrgUnit type. More...
 
 update ()
 Update (save) type. More...
 
 delete ()
 Delete a type. More...
 

Private Attributes

ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilTabsGUI $tabs
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ilSetting $settings
 
ilLanguage $lng
 
ilObjOrgUnitGUI $parent_gui
 

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 ilOrgUnitTypeGUI

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

Definition at line 24 of file class.ilOrgUnitTypeGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitTypeGUI::__construct ( ilObjOrgUnitGUI  $parent_gui)
Parameters
ilObjOrgUnitGUI$parent_gui

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

References $DIC, $parent_gui, ILIAS\Repository\access(), checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

39  {
40  global $DIC;
41 
42  $this->tpl = $DIC->ui()->mainTemplate();
43  $this->ctrl = $DIC->ctrl();
44  $this->access =$DIC->access();
45  $this->toolbar = $DIC->toolbar();
46  $this->tabs = $DIC->tabs();
47  $this->lng = $DIC->language();
48  $this->settings = $DIC->settings();
49  $this->parent_gui = $parent_gui;
50  $this->lng->loadLanguageModule('orgu');
51  $this->ctrl->saveParameter($this, 'type_id');
52  $this->lng->loadLanguageModule('meta');
53  $this->checkAccess();
54  }
global $DIC
Definition: feed.php:28
ilObjOrgUnitGUI $parent_gui
+ Here is the call graph for this function:

Member Function Documentation

◆ add()

ilOrgUnitTypeGUI::add ( )
private

Display form to create a new OrgUnit type.

Definition at line 183 of file class.ilOrgUnitTypeGUI.php.

Referenced by executeCommand().

183  : void
184  {
185  $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
186  $this->tpl->setContent($form->getHTML());
187  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ checkAccess()

ilOrgUnitTypeGUI::checkAccess ( )
private

Definition at line 105 of file class.ilOrgUnitTypeGUI.php.

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

Referenced by __construct().

105  : void
106  {
107  if (!$this->access->checkAccess("write", "", $this->parent_gui->object->getRefId())) {
108  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
109  $this->ctrl->redirect($this->parent_gui);
110  }
111  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilOrgUnitTypeGUI::create ( )
protected

Create (save) type.

Definition at line 202 of file class.ilOrgUnitTypeGUI.php.

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

Referenced by executeCommand().

202  : void
203  {
204  $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
205  if ($form->saveObject()) {
206  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_created'), true);
207  $this->ctrl->redirect($this);
208  } else {
209  $this->tpl->setContent($form->getHTML());
210  }
211  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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:

◆ delete()

ilOrgUnitTypeGUI::delete ( )
private

Delete a type.

Definition at line 230 of file class.ilOrgUnitTypeGUI.php.

References $_GET, Vendor\Package\$e, $type, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

230  : void
231  {
232  $type = new ilOrgUnitType((int) $_GET['type_id']);
233  try {
234  $type->delete();
235  $this->tpl->setOnScreenMessage('success', $this->lng->txt('orgu_type_msg_deleted'), true);
236  $this->ctrl->redirect($this);
237  } catch (ilException $e) {
238  $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
239  $this->ctrl->redirect($this);
240  }
241  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$type
$_GET['client_id']
Definition: saml1-acs.php:21
+ Here is the call graph for this function:

◆ edit()

ilOrgUnitTypeGUI::edit ( )
private

Display form to edit an existing OrgUnit type.

Definition at line 192 of file class.ilOrgUnitTypeGUI.php.

References $_GET, and $type.

Referenced by executeCommand().

192  : void
193  {
194  $type = new ilOrgUnitType((int) $_GET['type_id']);
195  $form = new ilOrgUnitTypeFormGUI($this, $type);
196  $this->tpl->setContent($form->getHTML());
197  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$type
$_GET['client_id']
Definition: saml1-acs.php:21
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ editAMD()

ilOrgUnitTypeGUI::editAMD ( )
private

Definition at line 149 of file class.ilOrgUnitTypeGUI.php.

References $_GET.

Referenced by executeCommand().

149  : void
150  {
151  $form = new ilOrgUnitTypeAdvancedMetaDataFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
152  $this->tpl->setContent($form->getHTML());
153  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$_GET['client_id']
Definition: saml1-acs.php:21
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ editCustomIcons()

ilOrgUnitTypeGUI::editCustomIcons ( )
private

Display form for editing custom icons.

Definition at line 132 of file class.ilOrgUnitTypeGUI.php.

References $_GET.

Referenced by executeCommand().

132  : void
133  {
134  $form = new ilOrgUnitTypeCustomIconsFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
135  $this->tpl->setContent($form->getHTML());
136  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$_GET['client_id']
Definition: saml1-acs.php:21
+ Here is the caller graph for this function:

◆ executeCommand()

ilOrgUnitTypeGUI::executeCommand ( )

Definition at line 56 of file class.ilOrgUnitTypeGUI.php.

References add(), create(), ILIAS\Repository\ctrl(), edit(), editAMD(), editCustomIcons(), listTypes(), setSubTabsEdit(), update(), updateAMD(), and updateCustomIcons().

56  : void
57  {
58  $cmd = $this->ctrl->getCmd();
59  $next_class = $this->ctrl->getNextClass($this);
60  switch ($next_class) {
61  case '':
62  switch ($cmd) {
63  case '':
64  case 'listTypes':
65  $this->listTypes();
66  break;
67  case 'add':
68  $this->add();
69  break;
70  case 'edit':
71  $this->setSubTabsEdit('general');
72  $this->edit();
73  break;
74  case 'editCustomIcons':
75  $this->setSubTabsEdit('custom_icons');
76  $this->editCustomIcons();
77  break;
78  case 'editAMD':
79  $this->setSubTabsEdit('amd');
80  $this->editAMD();
81  break;
82  case 'updateAMD':
83  $this->setSubTabsEdit('amd');
84  $this->updateAMD();
85  break;
86  case 'updateCustomIcons':
87  $this->setSubTabsEdit('custom_icons');
88  $this->updateCustomIcons();
89  break;
90  case 'create':
91  $this->create();
92  break;
93  case 'update':
94  $this->setSubTabsEdit('general');
95  $this->update();
96  break;
97  case 'delete':
98  $this->delete();
99  break;
100  }
101  break;
102  }
103  }
update()
Update (save) type.
edit()
Display form to edit an existing OrgUnit type.
create()
Create (save) type.
editCustomIcons()
Display form for editing custom icons.
setSubTabsEdit(string $active_tab_id)
listTypes()
Display all types in a table with actions to edit/delete.
add()
Display form to create a new OrgUnit type.
+ Here is the call graph for this function:

◆ listTypes()

ilOrgUnitTypeGUI::listTypes ( )
private

Display all types in a table with actions to edit/delete.

Definition at line 169 of file class.ilOrgUnitTypeGUI.php.

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

Referenced by executeCommand().

169  : void
170  {
171  $button = ilLinkButton::getInstance();
172  $button->setCaption('orgu_type_add');
173  $button->setUrl($this->ctrl->getLinkTarget($this, 'add'));
174  $this->toolbar->addButtonInstance($button);
175 
176  $table = new ilOrgUnitTypeTableGUI($this, 'listTypes');
177  $this->tpl->setContent($table->getHTML());
178  }
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:

◆ setSubTabsEdit()

ilOrgUnitTypeGUI::setSubTabsEdit ( string  $active_tab_id)
private

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

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

Referenced by executeCommand().

113  : void
114  {
115  $this->tabs->addSubTab('general', $this->lng->txt('meta_general'), $this->ctrl->getLinkTarget($this, 'edit'));
116  if ($this->settings->get('custom_icons')) {
117  $this->tabs->addSubTab(
118  'custom_icons',
119  $this->lng->txt('icon_settings'),
120  $this->ctrl->getLinkTarget($this, 'editCustomIcons')
121  );
122  }
123  if (count(ilOrgUnitType::getAvailableAdvancedMDRecordIds())) {
124  $this->tabs->addSubTab('amd', $this->lng->txt('md_advanced'), $this->ctrl->getLinkTarget($this, 'editAMD'));
125  }
126  $this->tabs->setSubTabActive($active_tab_id);
127  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilOrgUnitTypeGUI::update ( )
private

Update (save) type.

Definition at line 216 of file class.ilOrgUnitTypeGUI.php.

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

Referenced by executeCommand().

216  : void
217  {
218  $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
219  if ($form->saveObject()) {
220  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
221  $this->ctrl->redirect($this);
222  } else {
223  $this->tpl->setContent($form->getHTML());
224  }
225  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$_GET['client_id']
Definition: saml1-acs.php:21
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:

◆ updateAMD()

ilOrgUnitTypeGUI::updateAMD ( )
private

Definition at line 155 of file class.ilOrgUnitTypeGUI.php.

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

Referenced by executeCommand().

155  : void
156  {
157  $form = new ilOrgUnitTypeAdvancedMetaDataFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
158  if ($form->saveObject()) {
159  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
160  $this->ctrl->redirect($this);
161  } else {
162  $this->tpl->setContent($form->getHTML());
163  }
164  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$_GET['client_id']
Definition: saml1-acs.php:21
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:

◆ updateCustomIcons()

ilOrgUnitTypeGUI::updateCustomIcons ( )
private

Definition at line 138 of file class.ilOrgUnitTypeGUI.php.

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

Referenced by executeCommand().

138  : void
139  {
140  $form = new ilOrgUnitTypeCustomIconsFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
141  if ($form->saveObject()) {
142  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'), true);
143  $this->ctrl->redirect($this);
144  } else {
145  $this->tpl->setContent($form->getHTML());
146  }
147  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$_GET['client_id']
Definition: saml1-acs.php:21
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilOrgUnitTypeGUI::$access
private

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

◆ $ctrl

ilCtrl ilOrgUnitTypeGUI::$ctrl
private

Definition at line 26 of file class.ilOrgUnitTypeGUI.php.

◆ $lng

ilLanguage ilOrgUnitTypeGUI::$lng
private

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

◆ $parent_gui

ilObjOrgUnitGUI ilOrgUnitTypeGUI::$parent_gui
private

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

Referenced by __construct().

◆ $settings

ilSetting ilOrgUnitTypeGUI::$settings
private

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

◆ $tabs

ilTabsGUI ilOrgUnitTypeGUI::$tabs
private

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

◆ $toolbar

ilToolbarGUI ilOrgUnitTypeGUI::$toolbar
private

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

◆ $tpl

ilGlobalTemplateInterface ilOrgUnitTypeGUI::$tpl
private

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


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