ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStudyProgrammeCommonSettingsGUI Class Reference
+ Collaboration diagram for ilStudyProgrammeCommonSettingsGUI:

Public Member Functions

 __construct (ilCtrl $ctrl, ilGlobalTemplateInterface $tpl, ilLanguage $lng, ilObjectService $object_service)
 
 executeCommand ()
 
 setObject (ilObjStudyProgramme $object)
 

Data Fields

const CMD_EDIT = 'editSettings'
 
const CMD_SAVE = 'saveSettings'
 

Protected Member Functions

 editSettings (ilPropertyFormGUI $form=null)
 
 buildForm ()
 
 addServiceSettingsToForm (ilPropertyFormGUI $form)
 
 saveSettings ()
 
 txt (string $code)
 

Protected Attributes

 $object
 
 $ctrl
 
 $tpl
 
 $lng
 
 $object_service
 

Detailed Description

Definition at line 5 of file class.ilStudyProgrammeCommonSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeCommonSettingsGUI::__construct ( ilCtrl  $ctrl,
ilGlobalTemplateInterface  $tpl,
ilLanguage  $lng,
ilObjectService  $object_service 
)

Member Function Documentation

◆ addServiceSettingsToForm()

ilStudyProgrammeCommonSettingsGUI::addServiceSettingsToForm ( ilPropertyFormGUI  $form)
protected

Definition at line 92 of file class.ilStudyProgrammeCommonSettingsGUI.php.

References ilObjectServiceSettingsGUI\initServiceSettingsForm(), and ilObjectServiceSettingsGUI\ORGU_POSITION_ACCESS.

Referenced by buildForm().

93  {
95  $this->object->getId(),
96  $form,
97  [
99  ]
100  );
101  }
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildForm()

ilStudyProgrammeCommonSettingsGUI::buildForm ( )
protected

Definition at line 79 of file class.ilStudyProgrammeCommonSettingsGUI.php.

References addServiceSettingsToForm(), and txt().

Referenced by editSettings(), and saveSettings().

80  {
81  $form = new ilPropertyFormGUI();
82  $form->setFormAction($this->ctrl->getFormAction($this));
83  $form->setTitle($this->txt('obj_features'));
84  $form->addCommandButton(self::CMD_SAVE, $this->txt('save'));
85  $form->addCommandButton(self::CMD_EDIT, $this->txt('cancel'));
86 
87  $this->addServiceSettingsToForm($form);
88 
89  return $form;
90  }
This class represents a property form user interface.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editSettings()

ilStudyProgrammeCommonSettingsGUI::editSettings ( ilPropertyFormGUI  $form = null)
protected

Definition at line 71 of file class.ilStudyProgrammeCommonSettingsGUI.php.

References buildForm().

Referenced by executeCommand(), and saveSettings().

72  {
73  if (is_null($form)) {
74  $form = $this->buildForm();
75  }
76  return $form->getHTML();
77  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilStudyProgrammeCommonSettingsGUI::executeCommand ( )

Definition at line 47 of file class.ilStudyProgrammeCommonSettingsGUI.php.

References editSettings(), and saveSettings().

48  {
49  if (is_null($this->object)) {
50  throw new ilException('Object of ilObjStudyProgramme is not set');
51  }
52 
53  $cmd = $this->ctrl->getCmd();
54  switch ($cmd) {
55  case self::CMD_EDIT:
56  return $this->editSettings();
57  break;
58  case self::CMD_SAVE:
59  $this->saveSettings();
60  break;
61  default:
62  throw new Exception('Unknown command ' . $cmd);
63  }
64  }
+ Here is the call graph for this function:

◆ saveSettings()

ilStudyProgrammeCommonSettingsGUI::saveSettings ( )
protected

Definition at line 103 of file class.ilStudyProgrammeCommonSettingsGUI.php.

References buildForm(), editSettings(), ilObjectServiceSettingsGUI\ORGU_POSITION_ACCESS, and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

Referenced by executeCommand().

104  {
105  $form = $this->buildForm();
106 
107  if (!$form->checkInput()) {
108  $form->setValuesByPost();
109  $this->editSettings($form);
110  return;
111  }
112 
114  $this->object->getId(),
115  $form,
116  [
118  ]
119  );
120 
121  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
122  $this->ctrl->redirect($this, self::CMD_EDIT);
123  }
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setObject()

ilStudyProgrammeCommonSettingsGUI::setObject ( ilObjStudyProgramme  $object)

Definition at line 66 of file class.ilStudyProgrammeCommonSettingsGUI.php.

References $object.

◆ txt()

ilStudyProgrammeCommonSettingsGUI::txt ( string  $code)
protected

Definition at line 125 of file class.ilStudyProgrammeCommonSettingsGUI.php.

Referenced by buildForm().

125  : string
126  {
127  return $this->lng->txt($code);
128  }
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilStudyProgrammeCommonSettingsGUI::$ctrl
protected

Definition at line 18 of file class.ilStudyProgrammeCommonSettingsGUI.php.

Referenced by __construct().

◆ $lng

ilStudyProgrammeCommonSettingsGUI::$lng
protected

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

Referenced by __construct().

◆ $object

ilStudyProgrammeCommonSettingsGUI::$object
protected

Definition at line 13 of file class.ilStudyProgrammeCommonSettingsGUI.php.

Referenced by setObject().

◆ $object_service

ilStudyProgrammeCommonSettingsGUI::$object_service
protected

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

Referenced by __construct().

◆ $tpl

ilStudyProgrammeCommonSettingsGUI::$tpl
protected

Definition at line 23 of file class.ilStudyProgrammeCommonSettingsGUI.php.

Referenced by __construct().

◆ CMD_EDIT

const ilStudyProgrammeCommonSettingsGUI::CMD_EDIT = 'editSettings'

Definition at line 7 of file class.ilStudyProgrammeCommonSettingsGUI.php.

◆ CMD_SAVE

const ilStudyProgrammeCommonSettingsGUI::CMD_SAVE = 'saveSettings'

Definition at line 8 of file class.ilStudyProgrammeCommonSettingsGUI.php.


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