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

Class ilOrgUnitTypeGUI. More...

+ Collaboration diagram for ilOrgUnitTypeGUI:

Public Member Functions

 __construct (ilObjOrgUnitGUI $parent_gui)
 
 executeCommand ()
 

Data Fields

 $ctrl
 
 $tpl
 
 $tabs
 

Protected Member Functions

 checkAccess ()
 Check if user can edit types. More...
 
 setSubTabsEdit ($active_tab_id)
 Add subtabs for editing type. More...
 
 editCustomIcons ()
 Display form for editing custom icons. More...
 
 updateCustomIcons ()
 Save icon. More...
 
 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...
 
 create ()
 Create (save) type. More...
 
 update ()
 Update (save) type. More...
 
 delete ()
 Delete a type. More...
 

Protected Attributes

 $access
 
 $toolbar
 
 $locator
 
 $log
 
 $ilias
 
 $lng
 
 $parent_gui
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

58 {
59 global $DIC;
60 $tpl = $DIC['tpl'];
61 $ilCtrl = $DIC['ilCtrl'];
62 $ilAccess = $DIC['ilAccess'];
63 $ilToolbar = $DIC['ilToolbar'];
64 $ilLocator = $DIC['ilLocator'];
65 $tree = $DIC['tree'];
66 $lng = $DIC['lng'];
67 $ilLog = $DIC['ilLog'];
68 $ilias = $DIC['ilias'];
69 $ilTabs = $DIC['ilTabs'];
70 $this->tpl = $tpl;
71 $this->ctrl = $ilCtrl;
72 $this->access = $ilAccess;
73 $this->locator = $ilLocator;
74 $this->toolbar = $ilToolbar;
75 $this->tabs = $ilTabs;
76 $this->log = $ilLog;
77 $this->lng = $lng;
78 $this->ilias = $ilias;
79 $this->parent_gui = $parent_gui;
80 $this->lng->loadLanguageModule('orgu');
81 $this->ctrl->saveParameter($this, 'type_id');
82 $this->lng->loadLanguageModule('meta');
83 $this->checkAccess();
84 }
checkAccess()
Check if user can edit types.
global $DIC
Definition: goto.php:24
redirection script todo: (a better solution should control the processing via a xml file)

References $DIC, $ilias, $lng, $parent_gui, $tpl, and checkAccess().

+ Here is the call graph for this function:

Member Function Documentation

◆ add()

ilOrgUnitTypeGUI::add ( )
protected

Display form to create a new OrgUnit type.

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

228 {
229 $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
230 $this->tpl->setContent($form->getHTML());
231 }
Class ilOrgUnitTypeFormGUI.
Class ilOrgUnitType.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ checkAccess()

ilOrgUnitTypeGUI::checkAccess ( )
protected

Check if user can edit types.

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

141 {
142 if (!$this->access->checkAccess("write", "", $this->parent_gui->object->getRefId())) {
143 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
144 $this->ctrl->redirect($this->parent_gui);
145 }
146 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References ilUtil\sendFailure().

Referenced by __construct().

+ 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 248 of file class.ilOrgUnitTypeGUI.php.

249 {
250 $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
251 if ($form->saveObject()) {
252 ilUtil::sendSuccess($this->lng->txt('msg_obj_created'), true);
253 $this->ctrl->redirect($this);
254 } else {
255 $this->tpl->setContent($form->getHTML());
256 }
257 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ delete()

ilOrgUnitTypeGUI::delete ( )
protected

Delete a type.

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

279 {
280 $type = new ilOrgUnitType((int) $_GET['type_id']);
281 try {
282 $type->delete();
283 ilUtil::sendSuccess($this->lng->txt('orgu_type_msg_deleted'), true);
284 $this->ctrl->redirect($this);
285 } catch (ilException $e) {
286 ilUtil::sendFailure($e->getMessage(), true);
287 $this->ctrl->redirect($this);
288 }
289 }
$_GET["client_id"]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$type

References $_GET, Vendor\Package\$e, $type, and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ edit()

ilOrgUnitTypeGUI::edit ( )
protected

Display form to edit an existing OrgUnit type.

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

238 {
239 $type = new ilOrgUnitType((int) $_GET['type_id']);
240 $form = new ilOrgUnitTypeFormGUI($this, $type);
241 $this->tpl->setContent($form->getHTML());
242 }

References $_GET, and $type.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ editAMD()

ilOrgUnitTypeGUI::editAMD ( )
protected

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

191 {
192 $form = new ilOrgUnitTypeAdvancedMetaDataFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
193 $this->tpl->setContent($form->getHTML());
194 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ editCustomIcons()

ilOrgUnitTypeGUI::editCustomIcons ( )
protected

Display form for editing custom icons.

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

169 {
170 $form = new ilOrgUnitTypeCustomIconsFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
171 $this->tpl->setContent($form->getHTML());
172 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ executeCommand()

ilOrgUnitTypeGUI::executeCommand ( )

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

88 {
89 $cmd = $this->ctrl->getCmd();
90 $next_class = $this->ctrl->getNextClass($this);
91 switch ($next_class) {
92 case '':
93 switch ($cmd) {
94 case '':
95 case 'listTypes':
96 $this->listTypes();
97 break;
98 case 'add':
99 $this->add();
100 break;
101 case 'edit':
102 $this->setSubTabsEdit('general');
103 $this->edit();
104 break;
105 case 'editCustomIcons':
106 $this->setSubTabsEdit('custom_icons');
107 $this->editCustomIcons();
108 break;
109 case 'editAMD':
110 $this->setSubTabsEdit('amd');
111 $this->editAMD();
112 break;
113 case 'updateAMD':
114 $this->setSubTabsEdit('amd');
115 $this->updateAMD();
116 break;
117 case 'updateCustomIcons':
118 $this->setSubTabsEdit('custom_icons');
119 $this->updateCustomIcons();
120 break;
121 case 'create':
122 $this->create();
123 break;
124 case 'update':
125 $this->setSubTabsEdit('general');
126 $this->update();
127 break;
128 case 'delete':
129 $this->delete();
130 break;
131 }
132 break;
133 }
134 }
create()
Create (save) type.
setSubTabsEdit($active_tab_id)
Add subtabs for editing type.
update()
Update (save) type.
add()
Display form to create a new OrgUnit type.
listTypes()
Display all types in a table with actions to edit/delete.
editCustomIcons()
Display form for editing custom icons.
edit()
Display form to edit an existing OrgUnit type.

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

+ Here is the call graph for this function:

◆ listTypes()

ilOrgUnitTypeGUI::listTypes ( )
protected

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

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

213 {
214 $button = ilLinkButton::getInstance();
215 $button->setCaption('orgu_type_add');
216 $button->setUrl($this->ctrl->getLinkTarget($this, 'add'));
217 $this->toolbar->addButtonInstance($button);
218
219 $table = new ilOrgUnitTypeTableGUI($this, 'listTypes');
220 $this->tpl->setContent($table->getHTML());
221 }
static getInstance()
Factory.

References ilLinkButton\getInstance().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubTabsEdit()

ilOrgUnitTypeGUI::setSubTabsEdit (   $active_tab_id)
protected

Add subtabs for editing type.

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

153 {
154 $this->tabs->addSubTab('general', $this->lng->txt('meta_general'), $this->ctrl->getLinkTarget($this, 'edit'));
155 if ($this->ilias->getSetting('custom_icons')) {
156 $this->tabs->addSubTab('custom_icons', $this->lng->txt('icon_settings'), $this->ctrl->getLinkTarget($this, 'editCustomIcons'));
157 }
158 if (count(ilOrgUnitType::getAvailableAdvancedMDRecordIds())) {
159 $this->tabs->addSubTab('amd', $this->lng->txt('md_advanced'), $this->ctrl->getLinkTarget($this, 'editAMD'));
160 }
161 $this->tabs->setSubTabActive($active_tab_id);
162 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ update()

ilOrgUnitTypeGUI::update ( )
protected

Update (save) type.

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

264 {
265 $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
266 if ($form->saveObject()) {
267 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
268 $this->ctrl->redirect($this);
269 } else {
270 $this->tpl->setContent($form->getHTML());
271 }
272 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ updateAMD()

ilOrgUnitTypeGUI::updateAMD ( )
protected

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

198 {
199 $form = new ilOrgUnitTypeAdvancedMetaDataFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
200 if ($form->saveObject()) {
201 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
202 $this->ctrl->redirect($this);
203 } else {
204 $this->tpl->setContent($form->getHTML());
205 }
206 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ updateCustomIcons()

ilOrgUnitTypeGUI::updateCustomIcons ( )
protected

Save icon.

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

179 {
180 $form = new ilOrgUnitTypeCustomIconsFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
181 if ($form->saveObject()) {
182 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
183 $this->ctrl->redirect($this);
184 } else {
185 $this->tpl->setContent($form->getHTML());
186 }
187 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilOrgUnitTypeGUI::$access
protected

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

◆ $ctrl

ilOrgUnitTypeGUI::$ctrl

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

◆ $ilias

ilOrgUnitTypeGUI::$ilias
protected

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

Referenced by __construct().

◆ $lng

ilOrgUnitTypeGUI::$lng
protected

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

Referenced by __construct().

◆ $locator

ilOrgUnitTypeGUI::$locator
protected

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

◆ $log

ilOrgUnitTypeGUI::$log
protected

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

◆ $parent_gui

ilOrgUnitTypeGUI::$parent_gui
protected

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

Referenced by __construct().

◆ $tabs

ilOrgUnitTypeGUI::$tabs

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

◆ $toolbar

ilOrgUnitTypeGUI::$toolbar
protected

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

◆ $tpl

ilOrgUnitTypeGUI::$tpl

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

Referenced by __construct().


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