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

ilStudyProgrammeTypeGUI::add ( )
protected

Display form to create a new StudyProgramme type.

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

215 {
216 $form = new ilStudyProgrammeTypeFormGUI($this, new ilStudyProgrammeType());
217 $this->tpl->setContent($form->getHTML());
218 }
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 135 of file class.ilStudyProgrammeTypeGUI.php.

135 {
136 if (!$this->access->checkAccess("write", "", $this->parent_gui->object->getRefId())) {
137 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
138 $this->ctrl->redirect($this->parent_gui);
139 }
140 }
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 234 of file class.ilStudyProgrammeTypeGUI.php.

234 {
235 $form = new ilStudyProgrammeTypeFormGUI($this, new ilStudyProgrammeType());
236 if ($form->saveObject()) {
237 ilUtil::sendSuccess($this->lng->txt('msg_obj_created'), true);
238 $this->ctrl->redirect($this);
239 } else {
240 $this->tpl->setContent($form->getHTML());
241 }
242 }
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 262 of file class.ilStudyProgrammeTypeGUI.php.

262 {
263 $type = new ilStudyProgrammeType((int)$_GET['type_id']);
264 try {
265 $type->delete();
266 ilUtil::sendSuccess($this->lng->txt('prg_type_msg_deleted'), true);
267 $this->ctrl->redirect($this);
268 } catch (ilException $e) {
269 ilUtil::sendFailure($e->getMessage(), true);
270 $this->ctrl->redirect($this);
271 }
272 }
$_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 224 of file class.ilStudyProgrammeTypeGUI.php.

224 {
225 $type = new ilStudyProgrammeType((int)$_GET['type_id']);
226 $form = new ilStudyProgrammeTypeFormGUI($this, $type);
227 $this->tpl->setContent($form->getHTML());
228 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ editAMD()

ilStudyProgrammeTypeGUI::editAMD ( )
protected

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

181 {
182 $form = new ilStudyProgrammeTypeAdvancedMetaDataFormGUI($this, ilStudyProgrammeType::find((int)$_GET['type_id']));
183 $this->tpl->setContent($form->getHTML());
184 }

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 161 of file class.ilStudyProgrammeTypeGUI.php.

161 {
162 $form = new ilStudyProgrammeTypeCustomIconsFormGUI($this, new ilStudyProgrammeType((int)$_GET['type_id']));
163 $this->tpl->setContent($form->getHTML());
164 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ executeCommand()

ilStudyProgrammeTypeGUI::executeCommand ( )

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

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

201 {
202 $button = ilLinkButton::getInstance();
203 $button->setCaption('prg_subtype_add');
204 $button->setUrl($this->ctrl->getLinkTarget($this, 'add'));
205 $this->toolbar->addButtonInstance($button);
206
207 $table = new ilStudyProgrammeTypeTableGUI($this, 'listTypes');
208 $this->tpl->setContent($table->getHTML());
209 }
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 146 of file class.ilStudyProgrammeTypeGUI.php.

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

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ update()

ilStudyProgrammeTypeGUI::update ( )
protected

Update (save) type.

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

248 {
249 $form = new ilStudyProgrammeTypeFormGUI($this, new ilStudyProgrammeType((int)$_GET['type_id']));
250 if ($form->saveObject()) {
251 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
252 $this->ctrl->redirect($this);
253 } else {
254 $this->tpl->setContent($form->getHTML());
255 }
256 }

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 187 of file class.ilStudyProgrammeTypeGUI.php.

187 {
188 $form = new ilStudyProgrammeTypeAdvancedMetaDataFormGUI($this, ilStudyProgrammeType::find((int)$_GET['type_id']));
189 if ($form->saveObject()) {
190 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
191 $this->ctrl->redirect($this);
192 } else {
193 $this->tpl->setContent($form->getHTML());
194 }
195 }

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 170 of file class.ilStudyProgrammeTypeGUI.php.

170 {
171 $form = new ilStudyProgrammeTypeCustomIconsFormGUI($this, new ilStudyProgrammeType((int)$_GET['type_id']));
172 if ($form->saveObject()) {
173 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
174 $this->ctrl->redirect($this);
175 } else {
176 $this->tpl->setContent($form->getHTML());
177 }
178 }

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: