ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilStudyProgrammeTypeGUI Class Reference

Class ilStudyProgrammeTypeGUI. More...

+ Collaboration diagram for ilStudyProgrammeTypeGUI:

Public Member Functions

 __construct ($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 StudyProgramme type. More...
 
 edit ()
 Display form to edit an existing StudyProgramme 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()

ilStudyProgrammeTypeGUI::__construct (   $parent_gui)
Parameters
ilObjStudyProgrammeGUI$parent_gui

Definition at line 62 of file class.ilStudyProgrammeTypeGUI.php.

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

ilStudyProgrammeTypeGUI::add ( )
protected

Display form to create a new StudyProgramme type.

Definition at line 225 of file class.ilStudyProgrammeTypeGUI.php.

225 {
226 $form = new ilStudyProgrammeTypeFormGUI($this, new ilStudyProgrammeType());
227 $this->tpl->setContent($form->getHTML());
228 }
Class ilStudyProgrammeTypeFormGUI.
Class ilStudyProgrammeType.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ checkAccess()

ilStudyProgrammeTypeGUI::checkAccess ( )
protected

Check if user can edit types.

Definition at line 145 of file class.ilStudyProgrammeTypeGUI.php.

145 {
146 if (!$this->access->checkAccess("write", "", $this->parent_gui->object->getRefId())) {
147 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
148 $this->ctrl->redirect($this->parent_gui);
149 }
150 }
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()

ilStudyProgrammeTypeGUI::create ( )
protected

Create (save) type.

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

244 {
245 $form = new ilStudyProgrammeTypeFormGUI($this, new ilStudyProgrammeType());
246 if ($form->saveObject()) {
247 ilUtil::sendSuccess($this->lng->txt('msg_obj_created'), true);
248 $this->ctrl->redirect($this);
249 } else {
250 $this->tpl->setContent($form->getHTML());
251 }
252 }
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()

ilStudyProgrammeTypeGUI::delete ( )
protected

Delete a type.

Definition at line 272 of file class.ilStudyProgrammeTypeGUI.php.

272 {
273 $type = new ilStudyProgrammeType((int)$_GET['type_id']);
274 try {
275 $type->delete();
276 ilUtil::sendSuccess($this->lng->txt('prg_type_msg_deleted'), true);
277 $this->ctrl->redirect($this);
278 } catch (ilException $e) {
279 ilUtil::sendFailure($e->getMessage(), true);
280 $this->ctrl->redirect($this);
281 }
282 }
$_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()

ilStudyProgrammeTypeGUI::edit ( )
protected

Display form to edit an existing StudyProgramme type.

Definition at line 234 of file class.ilStudyProgrammeTypeGUI.php.

234 {
235 $type = new ilStudyProgrammeType((int)$_GET['type_id']);
236 $form = new ilStudyProgrammeTypeFormGUI($this, $type);
237 $this->tpl->setContent($form->getHTML());
238 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ editAMD()

ilStudyProgrammeTypeGUI::editAMD ( )
protected

Definition at line 191 of file class.ilStudyProgrammeTypeGUI.php.

191 {
192 $form = new ilStudyProgrammeTypeAdvancedMetaDataFormGUI($this, ilStudyProgrammeType::find((int)$_GET['type_id']));
193 $this->tpl->setContent($form->getHTML());
194 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ editCustomIcons()

ilStudyProgrammeTypeGUI::editCustomIcons ( )
protected

Display form for editing custom icons.

Definition at line 171 of file class.ilStudyProgrammeTypeGUI.php.

171 {
172 $form = new ilStudyProgrammeTypeCustomIconsFormGUI($this, new ilStudyProgrammeType((int)$_GET['type_id']));
173 $this->tpl->setContent($form->getHTML());
174 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ executeCommand()

ilStudyProgrammeTypeGUI::executeCommand ( )

Definition at line 93 of file class.ilStudyProgrammeTypeGUI.php.

93 {
94 $cmd = $this->ctrl->getCmd();
95
96 switch ($cmd) {
97 case '':
98 case 'view':
99 case 'listTypes':
100 $this->listTypes();
101 break;
102 case 'add':
103 $this->add();
104 break;
105 case 'edit':
106 $this->setSubTabsEdit('general');
107 $this->edit();
108 break;
109 case 'editCustomIcons':
110 $this->setSubTabsEdit('custom_icons');
111 $this->editCustomIcons();
112 break;
113 case 'editAMD':
114 $this->setSubTabsEdit('amd');
115 $this->editAMD();
116 break;
117 case 'updateAMD':
118 $this->setSubTabsEdit('amd');
119 $this->updateAMD();
120 break;
121 case 'updateCustomIcons':
122 $this->setSubTabsEdit('custom_icons');
123 $this->updateCustomIcons();
124 break;
125 case 'create':
126 $this->create();
127 break;
128 case 'update':
129 $this->setSubTabsEdit('general');
130 $this->update();
131 break;
132 case 'delete':
133 $this->delete();
134 break;
135 case 'cancel':
136 $this->ctrl->redirect($this->parent_gui);
137 break;
138 }
139 }
editCustomIcons()
Display form for editing custom icons.
setSubTabsEdit($active_tab_id)
Add subtabs for editing type.
edit()
Display form to edit an existing StudyProgramme type.
listTypes()
Display all types in a table with actions to edit/delete.
add()
Display form to create a new StudyProgramme 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()

ilStudyProgrammeTypeGUI::listTypes ( )
protected

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

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

211 {
212 $button = ilLinkButton::getInstance();
213 $button->setCaption('prg_subtype_add');
214 $button->setUrl($this->ctrl->getLinkTarget($this, 'add'));
215 $this->toolbar->addButtonInstance($button);
216
217 $table = new ilStudyProgrammeTypeTableGUI($this, 'listTypes');
218 $this->tpl->setContent($table->getHTML());
219 }
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()

ilStudyProgrammeTypeGUI::setSubTabsEdit (   $active_tab_id)
protected

Add subtabs for editing type.

Definition at line 156 of file class.ilStudyProgrammeTypeGUI.php.

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

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ update()

ilStudyProgrammeTypeGUI::update ( )
protected

Update (save) type.

Definition at line 258 of file class.ilStudyProgrammeTypeGUI.php.

258 {
259 $form = new ilStudyProgrammeTypeFormGUI($this, new ilStudyProgrammeType((int)$_GET['type_id']));
260 if ($form->saveObject()) {
261 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
262 $this->ctrl->redirect($this);
263 } else {
264 $this->tpl->setContent($form->getHTML());
265 }
266 }

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()

ilStudyProgrammeTypeGUI::updateAMD ( )
protected

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

197 {
198 $form = new ilStudyProgrammeTypeAdvancedMetaDataFormGUI($this, ilStudyProgrammeType::find((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, and ilUtil\sendSuccess().

Referenced by executeCommand().

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

◆ updateCustomIcons()

ilStudyProgrammeTypeGUI::updateCustomIcons ( )
protected

Save icon.

Definition at line 180 of file class.ilStudyProgrammeTypeGUI.php.

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

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

ilStudyProgrammeTypeGUI::$access
protected

Definition at line 32 of file class.ilStudyProgrammeTypeGUI.php.

◆ $ctrl

ilStudyProgrammeTypeGUI::$ctrl

Definition at line 20 of file class.ilStudyProgrammeTypeGUI.php.

◆ $ilias

ilStudyProgrammeTypeGUI::$ilias
protected

Definition at line 48 of file class.ilStudyProgrammeTypeGUI.php.

Referenced by __construct().

◆ $lng

ilStudyProgrammeTypeGUI::$lng
protected

Definition at line 52 of file class.ilStudyProgrammeTypeGUI.php.

Referenced by __construct().

◆ $locator

ilStudyProgrammeTypeGUI::$locator
protected

Definition at line 40 of file class.ilStudyProgrammeTypeGUI.php.

◆ $log

ilStudyProgrammeTypeGUI::$log
protected

Definition at line 44 of file class.ilStudyProgrammeTypeGUI.php.

◆ $parent_gui

ilStudyProgrammeTypeGUI::$parent_gui
protected

Definition at line 56 of file class.ilStudyProgrammeTypeGUI.php.

Referenced by __construct().

◆ $tabs

ilStudyProgrammeTypeGUI::$tabs

Definition at line 28 of file class.ilStudyProgrammeTypeGUI.php.

◆ $toolbar

ilStudyProgrammeTypeGUI::$toolbar
protected

Definition at line 36 of file class.ilStudyProgrammeTypeGUI.php.

◆ $tpl

ilStudyProgrammeTypeGUI::$tpl

Definition at line 24 of file class.ilStudyProgrammeTypeGUI.php.

Referenced by __construct().


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