ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 60 of file class.ilOrgUnitTypeGUI.php.

60 {
61 global $DIC;
62 $tpl = $DIC['tpl'];
63 $ilCtrl = $DIC['ilCtrl'];
64 $ilAccess = $DIC['ilAccess'];
65 $ilToolbar = $DIC['ilToolbar'];
66 $ilLocator = $DIC['ilLocator'];
67 $tree = $DIC['tree'];
68 $lng = $DIC['lng'];
69 $ilLog = $DIC['ilLog'];
70 $ilias = $DIC['ilias'];
71 $ilTabs = $DIC['ilTabs'];
72 $this->tpl = $tpl;
73 $this->ctrl = $ilCtrl;
74 $this->access = $ilAccess;
75 $this->locator = $ilLocator;
76 $this->toolbar = $ilToolbar;
77 $this->tabs = $ilTabs;
78 $this->log = $ilLog;
79 $this->lng = $lng;
80 $this->ilias = $ilias;
81 $this->parent_gui = $parent_gui;
82 $this->lng->loadLanguageModule('orgu');
83 $this->ctrl->saveParameter($this, 'type_id');
84 $this->lng->loadLanguageModule('meta');
85 $this->checkAccess();
86 }
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

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

221 {
222 $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
223 $this->tpl->setContent($form->getHTML());
224 }
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 141 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 240 of file class.ilOrgUnitTypeGUI.php.

240 {
241 $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
242 if ($form->saveObject()) {
243 ilUtil::sendSuccess($this->lng->txt('msg_obj_created'), true);
244 $this->ctrl->redirect($this);
245 } else {
246 $this->tpl->setContent($form->getHTML());
247 }
248 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References 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 268 of file class.ilOrgUnitTypeGUI.php.

268 {
269 $type = new ilOrgUnitType((int)$_GET['type_id']);
270 try {
271 $type->delete();
272 ilUtil::sendSuccess($this->lng->txt('orgu_type_msg_deleted'), true);
273 $this->ctrl->redirect($this);
274 } catch (ilException $e) {
275 ilUtil::sendFailure($e->getMessage(), true);
276 $this->ctrl->redirect($this);
277 }
278 }
$_GET["client_id"]
Base class for ILIAS Exception handling.

References $_GET, 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 230 of file class.ilOrgUnitTypeGUI.php.

230 {
231 $type = new ilOrgUnitType((int)$_GET['type_id']);
232 $form = new ilOrgUnitTypeFormGUI($this, $type);
233 $this->tpl->setContent($form->getHTML());
234 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ editAMD()

ilOrgUnitTypeGUI::editAMD ( )
protected

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

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

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

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

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ executeCommand()

ilOrgUnitTypeGUI::executeCommand ( )

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

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

References $cmd, 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 207 of file class.ilOrgUnitTypeGUI.php.

207 {
208 $button = ilLinkButton::getInstance();
209 $button->setCaption('orgu_type_add');
210 $button->setUrl($this->ctrl->getLinkTarget($this, 'add'));
211 $this->toolbar->addButtonInstance($button);
212
213 $table = new ilOrgUnitTypeTableGUI($this, 'listTypes');
214 $this->tpl->setContent($table->getHTML());
215 }
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.

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

254 {
255 $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType((int)$_GET['type_id']));
256 if ($form->saveObject()) {
257 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
258 $this->ctrl->redirect($this);
259 } else {
260 $this->tpl->setContent($form->getHTML());
261 }
262 }

References $_GET, 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 193 of file class.ilOrgUnitTypeGUI.php.

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

References $_GET, 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 176 of file class.ilOrgUnitTypeGUI.php.

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

References $_GET, 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 30 of file class.ilOrgUnitTypeGUI.php.

◆ $ctrl

ilOrgUnitTypeGUI::$ctrl

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

◆ $ilias

ilOrgUnitTypeGUI::$ilias
protected

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

Referenced by __construct().

◆ $lng

ilOrgUnitTypeGUI::$lng
protected

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

Referenced by __construct().

◆ $locator

ilOrgUnitTypeGUI::$locator
protected

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

◆ $log

ilOrgUnitTypeGUI::$log
protected

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

◆ $parent_gui

ilOrgUnitTypeGUI::$parent_gui
protected

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

Referenced by __construct().

◆ $tabs

ilOrgUnitTypeGUI::$tabs

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

◆ $toolbar

ilOrgUnitTypeGUI::$toolbar
protected

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

◆ $tpl

ilOrgUnitTypeGUI::$tpl

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

Referenced by __construct().


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