ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilFileCommonSettingsGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilFileCommonSettingsGUI:

Public Member Functions

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

Data Fields

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

Protected Member Functions

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

Protected Attributes

ilObjFile $object
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilObjectService $object_service
 

Private Attributes

array $services
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 22 of file class.ilFileCommonSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilFileCommonSettingsGUI::__construct ( ilObjFile  $object,
ilCtrl  $ctrl,
ilGlobalTemplateInterface  $tpl,
ilLanguage  $lng,
ilObjectService  $object_service 
)

Member Function Documentation

◆ addCommonFieldsToForm()

ilFileCommonSettingsGUI::addCommonFieldsToForm ( ilPropertyFormGUI  $form)
protected

Definition at line 97 of file class.ilFileCommonSettingsGUI.php.

Referenced by buildForm().

97  : void
98  {
99  //
100  }
+ Here is the caller graph for this function:

◆ addServiceSettingsToForm()

ilFileCommonSettingsGUI::addServiceSettingsToForm ( ilPropertyFormGUI  $form)
protected

Definition at line 88 of file class.ilFileCommonSettingsGUI.php.

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

Referenced by buildForm().

88  : void
89  {
91  $this->object->getId(),
92  $form,
94  );
95  }
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildForm()

ilFileCommonSettingsGUI::buildForm ( )
protected

Definition at line 74 of file class.ilFileCommonSettingsGUI.php.

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

Referenced by editSettings(), and saveSettings().

75  {
76  $form = new ilPropertyFormGUI();
77  $form->setFormAction($this->ctrl->getFormAction($this));
78  $form->setTitle($this->txt('obj_features'));
79  $form->addCommandButton(self::CMD_SAVE, $this->txt('save'));
80  $form->addCommandButton(self::CMD_EDIT, $this->txt('cancel'));
81 
82  $this->addServiceSettingsToForm($form);
83  $this->addCommonFieldsToForm($form);
84 
85  return $form;
86  }
addServiceSettingsToForm(ilPropertyFormGUI $form)
addCommonFieldsToForm(ilPropertyFormGUI $form)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editSettings()

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

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

References buildForm().

Referenced by executeCommand(), and saveSettings().

66  : void
67  {
68  if (is_null($form)) {
69  $form = $this->buildForm();
70  }
71  $this->tpl->setContent($form->getHTML());
72  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilFileCommonSettingsGUI::executeCommand ( )

Definition at line 51 of file class.ilFileCommonSettingsGUI.php.

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

51  : void
52  {
53  $cmd = $this->ctrl->getCmd();
54  switch ($cmd) {
55  case self::CMD_EDIT:
56  $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  }
editSettings(ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:

◆ saveSettings()

ilFileCommonSettingsGUI::saveSettings ( )
protected

Definition at line 102 of file class.ilFileCommonSettingsGUI.php.

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

Referenced by executeCommand().

102  : void
103  {
104  $form = $this->buildForm();
105 
106  if (!$form->checkInput()) {
107  $form->setValuesByPost();
108  $this->editSettings($form);
109  return;
110  }
111 
113  $this->object->getId(),
114  $form,
116  );
117 
118  $this->tpl->setOnScreenMessage("success", $this->lng->txt('service_settings_saved'), true);
119  $this->ctrl->redirect($this, self::CMD_EDIT);
120  }
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
editSettings(ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ txt()

ilFileCommonSettingsGUI::txt ( string  $code)
protected

Definition at line 122 of file class.ilFileCommonSettingsGUI.php.

References ILIAS\Repository\lng().

Referenced by buildForm().

122  : string
123  {
124  return $this->lng->txt($code);
125  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilFileCommonSettingsGUI::$ctrl
protected

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

Referenced by __construct().

◆ $lng

ilLanguage ilFileCommonSettingsGUI::$lng
protected

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

Referenced by __construct().

◆ $object

ilObjFile ilFileCommonSettingsGUI::$object
protected

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

Referenced by __construct().

◆ $object_service

ilObjectService ilFileCommonSettingsGUI::$object_service
protected

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

Referenced by __construct().

◆ $services

array ilFileCommonSettingsGUI::$services
private

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

Referenced by addServiceSettingsToForm(), and saveSettings().

◆ $tpl

ilGlobalTemplateInterface ilFileCommonSettingsGUI::$tpl
protected

Definition at line 30 of file class.ilFileCommonSettingsGUI.php.

Referenced by __construct().

◆ CMD_EDIT

const ilFileCommonSettingsGUI::CMD_EDIT = 'editSettings'

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

Referenced by ilObjFileGUI\initSettingsTab().

◆ CMD_SAVE

const ilFileCommonSettingsGUI::CMD_SAVE = 'saveSettings'

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


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