ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 $tpl, $ilCtrl, $ilAccess, $ilToolbar, $ilLocator, $tree, $lng, $ilLog, $ilias, $ilTabs;
62 $this->tpl = $tpl;
63 $this->ctrl = $ilCtrl;
64 $this->access = $ilAccess;
65 $this->locator = $ilLocator;
66 $this->toolbar = $ilToolbar;
67 $this->tabs = $ilTabs;
68 $this->log = $ilLog;
69 $this->lng = $lng;
70 $this->ilias = $ilias;
71 $this->parent_gui = $parent_gui;
72 $this->lng->loadLanguageModule('orgu');
73 $this->ctrl->saveParameter($this, 'type_id');
74 $this->lng->loadLanguageModule('meta');
75 $this->checkAccess();
76 }
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)

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

211 {
212 $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
213 $this->tpl->setContent($form->getHTML());
214 }
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 131 of file class.ilOrgUnitTypeGUI.php.

131 {
132 if (!$this->access->checkAccess("write", "", $this->parent_gui->object->getRefId())) {
133 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
134 $this->ctrl->redirect($this->parent_gui);
135 }
136 }
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 230 of file class.ilOrgUnitTypeGUI.php.

230 {
231 $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
232 if ($form->saveObject()) {
233 ilUtil::sendSuccess($this->lng->txt('msg_obj_created'), true);
234 $this->ctrl->redirect($this);
235 } else {
236 $this->tpl->setContent($form->getHTML());
237 }
238 }
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 258 of file class.ilOrgUnitTypeGUI.php.

258 {
259 $type = new ilOrgUnitType((int)$_GET['type_id']);
260 try {
261 $type->delete();
262 ilUtil::sendSuccess($this->lng->txt('orgu_type_msg_deleted'), true);
263 $this->ctrl->redirect($this);
264 } catch (ilException $e) {
265 ilUtil::sendFailure($e->getMessage(), true);
266 $this->ctrl->redirect($this);
267 }
268 }
$_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 220 of file class.ilOrgUnitTypeGUI.php.

220 {
221 $type = new ilOrgUnitType((int)$_GET['type_id']);
222 $form = new ilOrgUnitTypeFormGUI($this, $type);
223 $this->tpl->setContent($form->getHTML());
224 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ editAMD()

ilOrgUnitTypeGUI::editAMD ( )
protected

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

177 {
178 $form = new ilOrgUnitTypeAdvancedMetaDataFormGUI($this, new ilOrgUnitType((int)$_GET['type_id']));
179 $this->tpl->setContent($form->getHTML());
180 }

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

157 {
158 $form = new ilOrgUnitTypeCustomIconsFormGUI($this, new ilOrgUnitType((int)$_GET['type_id']));
159 $this->tpl->setContent($form->getHTML());
160 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ executeCommand()

ilOrgUnitTypeGUI::executeCommand ( )

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

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

197 {
198 $button = ilLinkButton::getInstance();
199 $button->setCaption('orgu_type_add');
200 $button->setUrl($this->ctrl->getLinkTarget($this, 'add'));
201 $this->toolbar->addButtonInstance($button);
202
203 $table = new ilOrgUnitTypeTableGUI($this, 'listTypes');
204 $this->tpl->setContent($table->getHTML());
205 }
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 142 of file class.ilOrgUnitTypeGUI.php.

142 {
143 $this->tabs->addSubTab('general', $this->lng->txt('meta_general'), $this->ctrl->getLinkTarget($this, 'edit'));
144 if ($this->ilias->getSetting('custom_icons')) {
145 $this->tabs->addSubTab('custom_icons', $this->lng->txt('icon_settings'), $this->ctrl->getLinkTarget($this, 'editCustomIcons'));
146 }
147 if (count(ilOrgUnitType::getAvailableAdvancedMDRecordIds())) {
148 $this->tabs->addSubTab('amd', $this->lng->txt('md_advanced'), $this->ctrl->getLinkTarget($this, 'editAMD'));
149 }
150 $this->tabs->setSubTabActive($active_tab_id);
151 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ update()

ilOrgUnitTypeGUI::update ( )
protected

Update (save) type.

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

244 {
245 $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType((int)$_GET['type_id']));
246 if ($form->saveObject()) {
247 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
248 $this->ctrl->redirect($this);
249 } else {
250 $this->tpl->setContent($form->getHTML());
251 }
252 }

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

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

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

166 {
167 $form = new ilOrgUnitTypeCustomIconsFormGUI($this, new ilOrgUnitType((int)$_GET['type_id']));
168 if ($form->saveObject()) {
169 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
170 $this->ctrl->redirect($this);
171 } else {
172 $this->tpl->setContent($form->getHTML());
173 }
174 }

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: