ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 56 of file class.ilOrgUnitTypeGUI.php.

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

References $DIC, $ilCtrl, $ilias, $ilLog, $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 226 of file class.ilOrgUnitTypeGUI.php.

227 {
228 $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
229 $this->tpl->setContent($form->getHTML());
230 }
Class ilOrgUnitTypeFormGUI.
Class ilOrgUnitType.
if(isset($_POST['submit'])) $form

References $form.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ checkAccess()

ilOrgUnitTypeGUI::checkAccess ( )
protected

Check if user can edit types.

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

140 {
141 if (!$this->access->checkAccess("write", "", $this->parent_gui->object->getRefId())) {
142 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
143 $this->ctrl->redirect($this->parent_gui);
144 }
145 }
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 247 of file class.ilOrgUnitTypeGUI.php.

248 {
249 $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
250 if ($form->saveObject()) {
251 ilUtil::sendSuccess($this->lng->txt('msg_obj_created'), true);
252 $this->ctrl->redirect($this);
253 } else {
254 $this->tpl->setContent($form->getHTML());
255 }
256 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References $form, and ilUtil\sendSuccess().

Referenced by executeCommand().

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

◆ delete()

ilOrgUnitTypeGUI::delete ( )
protected

Delete a type.

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

278 {
279 $type = new ilOrgUnitType((int) $_GET['type_id']);
280 try {
281 $type->delete();
282 ilUtil::sendSuccess($this->lng->txt('orgu_type_msg_deleted'), true);
283 $this->ctrl->redirect($this);
284 } catch (ilException $e) {
285 ilUtil::sendFailure($e->getMessage(), true);
286 $this->ctrl->redirect($this);
287 }
288 }
$_GET["client_id"]
Base class for ILIAS Exception handling.
$type

References $_GET, $type, ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ edit()

ilOrgUnitTypeGUI::edit ( )
protected

Display form to edit an existing OrgUnit type.

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

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

References $_GET, $form, and $type.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ editAMD()

ilOrgUnitTypeGUI::editAMD ( )
protected

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

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

References $_GET, and $form.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ editCustomIcons()

ilOrgUnitTypeGUI::editCustomIcons ( )
protected

Display form for editing custom icons.

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

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

References $_GET, and $form.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ executeCommand()

ilOrgUnitTypeGUI::executeCommand ( )

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

87 {
88 $cmd = $this->ctrl->getCmd();
89 $next_class = $this->ctrl->getNextClass($this);
90 switch ($next_class) {
91 case '':
92 switch ($cmd) {
93 case '':
94 case 'listTypes':
95 $this->listTypes();
96 break;
97 case 'add':
98 $this->add();
99 break;
100 case 'edit':
101 $this->setSubTabsEdit('general');
102 $this->edit();
103 break;
104 case 'editCustomIcons':
105 $this->setSubTabsEdit('custom_icons');
106 $this->editCustomIcons();
107 break;
108 case 'editAMD':
109 $this->setSubTabsEdit('amd');
110 $this->editAMD();
111 break;
112 case 'updateAMD':
113 $this->setSubTabsEdit('amd');
114 $this->updateAMD();
115 break;
116 case 'updateCustomIcons':
117 $this->setSubTabsEdit('custom_icons');
118 $this->updateCustomIcons();
119 break;
120 case 'create':
121 $this->create();
122 break;
123 case 'update':
124 $this->setSubTabsEdit('general');
125 $this->update();
126 break;
127 case 'delete':
128 $this->delete();
129 break;
130 }
131 break;
132 }
133 }
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 211 of file class.ilOrgUnitTypeGUI.php.

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

References $table, and 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 151 of file class.ilOrgUnitTypeGUI.php.

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

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ update()

ilOrgUnitTypeGUI::update ( )
protected

Update (save) type.

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

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

References $_GET, $form, and ilUtil\sendSuccess().

Referenced by executeCommand().

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

◆ updateAMD()

ilOrgUnitTypeGUI::updateAMD ( )
protected

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

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

References $_GET, $form, and ilUtil\sendSuccess().

Referenced by executeCommand().

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

◆ updateCustomIcons()

ilOrgUnitTypeGUI::updateCustomIcons ( )
protected

Save icon.

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

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

References $_GET, $form, and ilUtil\sendSuccess().

Referenced by executeCommand().

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

Field Documentation

◆ $access

ilOrgUnitTypeGUI::$access
protected

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

◆ $ctrl

ilOrgUnitTypeGUI::$ctrl

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

◆ $ilias

ilOrgUnitTypeGUI::$ilias
protected

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

Referenced by __construct().

◆ $lng

ilOrgUnitTypeGUI::$lng
protected

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

Referenced by __construct().

◆ $locator

ilOrgUnitTypeGUI::$locator
protected

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

◆ $log

ilOrgUnitTypeGUI::$log
protected

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

◆ $parent_gui

ilOrgUnitTypeGUI::$parent_gui
protected

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

Referenced by __construct().

◆ $tabs

ilOrgUnitTypeGUI::$tabs

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

◆ $toolbar

ilOrgUnitTypeGUI::$toolbar
protected

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

◆ $tpl

ilOrgUnitTypeGUI::$tpl

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

Referenced by __construct().


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