ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 63 of file class.ilStudyProgrammeTypeGUI.php.

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

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

Member Function Documentation

◆ add()

ilStudyProgrammeTypeGUI::add ( )
protected

Display form to create a new StudyProgramme type.

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

References $form.

Referenced by executeCommand().

236  {
238  $this->tpl->setContent($form->getHTML());
239  }
Class ilStudyProgrammeTypeFormGUI.
if(isset($_POST['submit'])) $form
Class ilStudyProgrammeType.
+ Here is the caller graph for this function:

◆ checkAccess()

ilStudyProgrammeTypeGUI::checkAccess ( )
protected

Check if user can edit types.

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

References ilUtil\sendFailure().

Referenced by executeCommand().

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

ilStudyProgrammeTypeGUI::create ( )
protected

Create (save) type.

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

References $form.

Referenced by executeCommand().

257  {
259  if ($form->saveObject()) {
260  ilUtil::sendSuccess($this->lng->txt('msg_obj_created'), true);
261  $this->ctrl->redirect($this);
262  } else {
263  $this->tpl->setContent($form->getHTML());
264  }
265  }
Class ilStudyProgrammeTypeFormGUI.
if(isset($_POST['submit'])) $form
Class ilStudyProgrammeType.
+ Here is the caller graph for this function:

◆ delete()

ilStudyProgrammeTypeGUI::delete ( )
protected

Delete a type.

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

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

287  {
288  $type = new ilStudyProgrammeType((int) $_GET['type_id']);
289  try {
290  $type->delete();
291  ilUtil::sendSuccess($this->lng->txt('prg_type_msg_deleted'), true);
292  $this->ctrl->redirect($this);
293  } catch (ilException $e) {
294  ilUtil::sendFailure($e->getMessage(), true);
295  $this->ctrl->redirect($this);
296  }
297  }
$type
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilStudyProgrammeType.
+ Here is the call graph for this function:

◆ edit()

ilStudyProgrammeTypeGUI::edit ( )
protected

Display form to edit an existing StudyProgramme type.

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

References $_GET, $form, and $type.

Referenced by executeCommand().

246  {
247  $type = new ilStudyProgrammeType((int) $_GET['type_id']);
249  $this->tpl->setContent($form->getHTML());
250  }
$type
$_GET["client_id"]
Class ilStudyProgrammeTypeFormGUI.
if(isset($_POST['submit'])) $form
Class ilStudyProgrammeType.
+ Here is the caller graph for this function:

◆ editAMD()

ilStudyProgrammeTypeGUI::editAMD ( )
protected

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

References $_GET, and $form.

Referenced by executeCommand().

198  {
199  $form = new ilStudyProgrammeTypeAdvancedMetaDataFormGUI($this, ilStudyProgrammeType::find((int) $_GET['type_id']));
200  $this->tpl->setContent($form->getHTML());
201  }
$_GET["client_id"]
if(isset($_POST['submit'])) $form
+ Here is the caller graph for this function:

◆ editCustomIcons()

ilStudyProgrammeTypeGUI::editCustomIcons ( )
protected

Display form for editing custom icons.

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

References $_GET, and $form.

Referenced by executeCommand().

176  {
177  $form = new ilStudyProgrammeTypeCustomIconsFormGUI($this, new ilStudyProgrammeType((int) $_GET['type_id']));
178  $this->tpl->setContent($form->getHTML());
179  }
$_GET["client_id"]
if(isset($_POST['submit'])) $form
Class ilStudyProgrammeType.
+ Here is the caller graph for this function:

◆ executeCommand()

ilStudyProgrammeTypeGUI::executeCommand ( )

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

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

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

References $table, and ilLinkButton\getInstance().

Referenced by executeCommand().

220  {
221  if ($this->access->checkAccess("write", "", $this->parent_gui->object->getRefId())) {
222  $button = ilLinkButton::getInstance();
223  $button->setCaption('prg_subtype_add');
224  $button->setUrl($this->ctrl->getLinkTarget($this, 'add'));
225  $this->toolbar->addButtonInstance($button);
226  }
227  $table = new ilStudyProgrammeTypeTableGUI($this, 'listTypes', $this->parent_gui->object->getRefId());
228  $this->tpl->setContent($table->getHTML());
229  }
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()

ilStudyProgrammeTypeGUI::setSubTabsEdit (   $active_tab_id)
protected

Add subtabs for editing type.

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

Referenced by executeCommand().

160  {
161  $this->tabs->addSubTab('general', $this->lng->txt('meta_general'), $this->ctrl->getLinkTarget($this, 'edit'));
162  if ($this->ilias->getSetting('custom_icons')) {
163  $this->tabs->addSubTab('custom_icons', $this->lng->txt('icon_settings'), $this->ctrl->getLinkTarget($this, 'editCustomIcons'));
164  }
165  if (count(ilStudyProgrammeType::getAvailableAdvancedMDRecordIds())) {
166  $this->tabs->addSubTab('amd', $this->lng->txt('md_advanced'), $this->ctrl->getLinkTarget($this, 'editAMD'));
167  }
168  $this->tabs->setSubTabActive($active_tab_id);
169  }
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the caller graph for this function:

◆ update()

ilStudyProgrammeTypeGUI::update ( )
protected

Update (save) type.

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

References $_GET, and $form.

Referenced by executeCommand().

272  {
273  $form = new ilStudyProgrammeTypeFormGUI($this, new ilStudyProgrammeType((int) $_GET['type_id']));
274  if ($form->saveObject()) {
275  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
276  $this->ctrl->redirect($this);
277  } else {
278  $this->tpl->setContent($form->getHTML());
279  }
280  }
$_GET["client_id"]
Class ilStudyProgrammeTypeFormGUI.
if(isset($_POST['submit'])) $form
Class ilStudyProgrammeType.
+ Here is the caller graph for this function:

◆ updateAMD()

ilStudyProgrammeTypeGUI::updateAMD ( )
protected

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

References $_GET, and $form.

Referenced by executeCommand().

205  {
206  $form = new ilStudyProgrammeTypeAdvancedMetaDataFormGUI($this, ilStudyProgrammeType::find((int) $_GET['type_id']));
207  if ($form->saveObject()) {
208  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
209  $this->ctrl->redirect($this);
210  } else {
211  $this->tpl->setContent($form->getHTML());
212  }
213  }
$_GET["client_id"]
if(isset($_POST['submit'])) $form
+ Here is the caller graph for this function:

◆ updateCustomIcons()

ilStudyProgrammeTypeGUI::updateCustomIcons ( )
protected

Save icon.

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

References $_GET, and $form.

Referenced by executeCommand().

186  {
187  $form = new ilStudyProgrammeTypeCustomIconsFormGUI($this, new ilStudyProgrammeType((int) $_GET['type_id']));
188  if ($form->saveObject()) {
189  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
190  $this->ctrl->redirect($this);
191  } else {
192  $this->tpl->setContent($form->getHTML());
193  }
194  }
$_GET["client_id"]
if(isset($_POST['submit'])) $form
Class ilStudyProgrammeType.
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilStudyProgrammeTypeGUI::$access
protected

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

◆ $ctrl

ilStudyProgrammeTypeGUI::$ctrl

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

◆ $ilias

ilStudyProgrammeTypeGUI::$ilias
protected

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

Referenced by __construct().

◆ $lng

ilStudyProgrammeTypeGUI::$lng
protected

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

Referenced by __construct().

◆ $locator

ilStudyProgrammeTypeGUI::$locator
protected

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

◆ $log

ilStudyProgrammeTypeGUI::$log
protected

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

◆ $parent_gui

ilStudyProgrammeTypeGUI::$parent_gui
protected

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

Referenced by __construct().

◆ $tabs

ilStudyProgrammeTypeGUI::$tabs

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

◆ $toolbar

ilStudyProgrammeTypeGUI::$toolbar
protected

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

◆ $tpl

ilStudyProgrammeTypeGUI::$tpl

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

Referenced by __construct().


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