ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

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

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

Referenced by executeCommand().

228  {
229  $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
230  $this->tpl->setContent($form->getHTML());
231  }
Class ilOrgUnitType.
Class ilOrgUnitTypeFormGUI.
+ 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.

References ilUtil\sendFailure().

Referenced by __construct().

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

Referenced by executeCommand().

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  }
Class ilOrgUnitType.
Class ilOrgUnitTypeFormGUI.
+ Here is the caller graph for this function:

◆ delete()

ilOrgUnitTypeGUI::delete ( )
protected

Delete a type.

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

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

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

References $_GET, and $type.

Referenced by executeCommand().

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

◆ editAMD()

ilOrgUnitTypeGUI::editAMD ( )
protected

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

References $_GET.

Referenced by executeCommand().

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

References $_GET.

Referenced by executeCommand().

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

◆ executeCommand()

ilOrgUnitTypeGUI::executeCommand ( )

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

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

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

References ilLinkButton\getInstance().

Referenced by executeCommand().

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

Referenced by executeCommand().

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

References $_GET.

Referenced by executeCommand().

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  }
Class ilOrgUnitType.
$_GET["client_id"]
Class ilOrgUnitTypeFormGUI.
+ Here is the caller graph for this function:

◆ updateAMD()

ilOrgUnitTypeGUI::updateAMD ( )
protected

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

References $_GET.

Referenced by executeCommand().

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  }
Class ilOrgUnitType.
$_GET["client_id"]
Class ilOrgUnitTypeAdvancedMetaDataFormGUI.
+ Here is the caller graph for this function:

◆ updateCustomIcons()

ilOrgUnitTypeGUI::updateCustomIcons ( )
protected

Save icon.

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

References $_GET.

Referenced by executeCommand().

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  }
Class ilOrgUnitType.
$_GET["client_id"]
+ 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: