ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 (protected ilObjFile $object, protected ilCtrl $ctrl, protected ilGlobalTemplateInterface $tpl, protected ilLanguage $lng, protected 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)
 

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 ( protected ilObjFile  $object,
protected ilCtrl  $ctrl,
protected ilGlobalTemplateInterface  $tpl,
protected ilLanguage  $lng,
protected ilObjectService  $object_service 
)

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

31  {
32  }

Member Function Documentation

◆ addCommonFieldsToForm()

ilFileCommonSettingsGUI::addCommonFieldsToForm ( ilPropertyFormGUI  $form)
protected

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

Referenced by buildForm().

75  : void
76  {
77  //
78  }
+ Here is the caller graph for this function:

◆ addServiceSettingsToForm()

ilFileCommonSettingsGUI::addServiceSettingsToForm ( ilPropertyFormGUI  $form)
protected

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

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

Referenced by buildForm().

66  : void
67  {
69  $this->object->getId(),
70  $form,
72  );
73  }
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 52 of file class.ilFileCommonSettingsGUI.php.

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

Referenced by editSettings(), and saveSettings().

53  {
54  $form = new ilPropertyFormGUI();
55  $form->setFormAction($this->ctrl->getFormAction($this));
56  $form->setTitle($this->txt('obj_features'));
57  $form->addCommandButton(self::CMD_SAVE, $this->txt('save'));
58  $form->addCommandButton(self::CMD_EDIT, $this->txt('cancel'));
59 
60  $this->addServiceSettingsToForm($form);
61  $this->addCommonFieldsToForm($form);
62 
63  return $form;
64  }
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 44 of file class.ilFileCommonSettingsGUI.php.

References buildForm().

Referenced by executeCommand(), and saveSettings().

44  : void
45  {
46  if (is_null($form)) {
47  $form = $this->buildForm();
48  }
49  $this->tpl->setContent($form->getHTML());
50  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilFileCommonSettingsGUI::executeCommand ( )

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

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

34  : void
35  {
36  $cmd = $this->ctrl->getCmd();
37  match ($cmd) {
38  self::CMD_EDIT => $this->editSettings(),
39  self::CMD_SAVE => $this->saveSettings(),
40  default => throw new Exception('Unknown command ' . $cmd),
41  };
42  }
editSettings(?ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:

◆ saveSettings()

ilFileCommonSettingsGUI::saveSettings ( )
protected

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

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

Referenced by executeCommand().

80  : void
81  {
82  $form = $this->buildForm();
83 
84  if (!$form->checkInput()) {
85  $form->setValuesByPost();
86  $this->editSettings($form);
87  return;
88  }
89 
91  $this->object->getId(),
92  $form,
94  );
95 
96  $this->tpl->setOnScreenMessage("success", $this->lng->txt('service_settings_saved'), true);
97  $this->ctrl->redirect($this, self::CMD_EDIT);
98  }
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 100 of file class.ilFileCommonSettingsGUI.php.

References ILIAS\Repository\lng().

Referenced by buildForm().

100  : string
101  {
102  return $this->lng->txt($code);
103  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $services

array ilFileCommonSettingsGUI::$services
private

◆ 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: