ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

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

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 $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
+ 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.

References $form.

Referenced by executeCommand().

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

References ilUtil\sendFailure().

Referenced by __construct().

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.
+ 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.

References $form.

Referenced by executeCommand().

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  }
Class ilOrgUnitType.
if(isset($_POST['submit'])) $form
Class ilOrgUnitTypeFormGUI.
+ Here is the caller graph for this function:

◆ delete()

ilOrgUnitTypeGUI::delete ( )
protected

Delete a type.

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

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

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  }
Class ilOrgUnitType.
$type
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ 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.

References $_GET, $form, and $type.

Referenced by executeCommand().

237  {
238  $type = new ilOrgUnitType((int) $_GET['type_id']);
239  $form = new ilOrgUnitTypeFormGUI($this, $type);
240  $this->tpl->setContent($form->getHTML());
241  }
Class ilOrgUnitType.
$type
$_GET["client_id"]
if(isset($_POST['submit'])) $form
Class ilOrgUnitTypeFormGUI.
+ Here is the caller graph for this function:

◆ editAMD()

ilOrgUnitTypeGUI::editAMD ( )
protected

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

References $_GET, and $form.

Referenced by executeCommand().

190  {
191  $form = new ilOrgUnitTypeAdvancedMetaDataFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
192  $this->tpl->setContent($form->getHTML());
193  }
Class ilOrgUnitType.
$_GET["client_id"]
if(isset($_POST['submit'])) $form
Class ilOrgUnitTypeAdvancedMetaDataFormGUI.
+ 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.

References $_GET, and $form.

Referenced by executeCommand().

168  {
169  $form = new ilOrgUnitTypeCustomIconsFormGUI($this, new ilOrgUnitType((int) $_GET['type_id']));
170  $this->tpl->setContent($form->getHTML());
171  }
Class ilOrgUnitType.
$_GET["client_id"]
if(isset($_POST['submit'])) $form
+ Here is the caller graph for this function:

◆ executeCommand()

ilOrgUnitTypeGUI::executeCommand ( )

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

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

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  }
update()
Update (save) type.
edit()
Display form to edit an existing OrgUnit type.
create()
Create (save) type.
setSubTabsEdit($active_tab_id)
Add subtabs for editing type.
editCustomIcons()
Display form for editing custom icons.
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 ( )
protected

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

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

References $table, and ilLinkButton\getInstance().

Referenced by executeCommand().

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  }
if(empty($password)) $table
Definition: pwgen.php:24
+ 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.

Referenced by executeCommand().

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  }
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the caller graph for this function:

◆ update()

ilOrgUnitTypeGUI::update ( )
protected

Update (save) type.

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

References $_GET, and $form.

Referenced by executeCommand().

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  }
Class ilOrgUnitType.
$_GET["client_id"]
if(isset($_POST['submit'])) $form
Class ilOrgUnitTypeFormGUI.
+ Here is the caller graph for this function:

◆ updateAMD()

ilOrgUnitTypeGUI::updateAMD ( )
protected

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

References $_GET, and $form.

Referenced by executeCommand().

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  }
Class ilOrgUnitType.
$_GET["client_id"]
if(isset($_POST['submit'])) $form
Class ilOrgUnitTypeAdvancedMetaDataFormGUI.
+ Here is the caller graph for this function:

◆ updateCustomIcons()

ilOrgUnitTypeGUI::updateCustomIcons ( )
protected

Save icon.

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

References $_GET, and $form.

Referenced by executeCommand().

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  }
Class ilOrgUnitType.
$_GET["client_id"]
if(isset($_POST['submit'])) $form
+ 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: