ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilStudyProgrammeCommonSettingsGUI Class Reference
+ Collaboration diagram for ilStudyProgrammeCommonSettingsGUI:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilObjectService $object_service
 
ilObjStudyProgramme $object = null
 

Private Attributes

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

Detailed Description

Definition at line 21 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 93 of file class.ilStudyProgrammeCommonSettingsGUI.php.

93 : void
94 {
96 $this->object->getId(),
97 $form,
98 [
100 ]
101 );
102 }
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)

References ilObjectServiceSettingsGUI\initServiceSettingsForm(), ILIAS\Repository\object(), and ilObjectServiceSettingsGUI\ORGU_POSITION_ACCESS.

Referenced by buildForm().

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

◆ buildForm()

ilStudyProgrammeCommonSettingsGUI::buildForm ( )
protected

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

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

References addServiceSettingsToForm(), ILIAS\Repository\ctrl(), and txt().

Referenced by editSettings(), and saveSettings().

+ 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 72 of file class.ilStudyProgrammeCommonSettingsGUI.php.

72 : string
73 {
74 if (is_null($form)) {
75 $form = $this->buildForm();
76 }
77 return $form->getHTML();
78 }

References buildForm().

Referenced by executeCommand(), and saveSettings().

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

◆ executeCommand()

ilStudyProgrammeCommonSettingsGUI::executeCommand ( )
Returns
string|void
Exceptions
Exception

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

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

References CMD_EDIT, CMD_SAVE, ILIAS\Repository\ctrl(), editSettings(), and saveSettings().

+ Here is the call graph for this function:

◆ saveSettings()

ilStudyProgrammeCommonSettingsGUI::saveSettings ( )
protected

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

104 : void
105 {
106 $form = $this->buildForm();
107
108 if (!$form->checkInput()) {
109 $form->setValuesByPost();
110 $this->editSettings($form);
111 return;
112 }
113
115 $this->object->getId(),
116 $form,
117 [
119 ]
120 );
121
122 $this->tpl->setOnScreenMessage("success", $this->lng->txt('msg_obj_modified'), true);
123 $this->ctrl->redirect($this, self::CMD_EDIT);
124 }
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)

References buildForm(), ILIAS\Repository\ctrl(), editSettings(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilObjectServiceSettingsGUI\ORGU_POSITION_ACCESS, and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

Referenced by executeCommand().

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

◆ setObject()

ilStudyProgrammeCommonSettingsGUI::setObject ( ilObjStudyProgramme  $object)

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

67 : void
68 {
69 $this->object = $object;
70 }

References $object.

◆ txt()

ilStudyProgrammeCommonSettingsGUI::txt ( string  $code)
protected

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

126 : string
127 {
128 return $this->lng->txt($code);
129 }

References ILIAS\Repository\lng().

Referenced by buildForm().

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

Field Documentation

◆ $ctrl

ilCtrl ilStudyProgrammeCommonSettingsGUI::$ctrl
protected

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

Referenced by __construct().

◆ $lng

ilLanguage ilStudyProgrammeCommonSettingsGUI::$lng
protected

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

Referenced by __construct().

◆ $object

ilObjStudyProgramme ilStudyProgrammeCommonSettingsGUI::$object = null
protected

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

Referenced by setObject().

◆ $object_service

ilObjectService ilStudyProgrammeCommonSettingsGUI::$object_service
protected

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

Referenced by __construct().

◆ $tpl

ilGlobalTemplateInterface ilStudyProgrammeCommonSettingsGUI::$tpl
protected

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

Referenced by __construct().

◆ CMD_EDIT

const ilStudyProgrammeCommonSettingsGUI::CMD_EDIT = 'editSettings'
private

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

Referenced by executeCommand().

◆ CMD_SAVE

const ilStudyProgrammeCommonSettingsGUI::CMD_SAVE = 'saveSettings'
private

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

Referenced by executeCommand().


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