ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\User\Profile\Prompt\SettingsGUI Class Reference
+ Collaboration diagram for ILIAS\User\Profile\Prompt\SettingsGUI:

Public Member Functions

 __construct (private readonly \ilCtrl $ctrl, private readonly Language $lng, private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer, private \ilGlobalTemplateInterface $tpl, private readonly ServerRequestInterface $request, private readonly Refinery $refinery, private readonly Repository $prompt_repository)
 
 executeCommand ()
 
 show ()
 
 save ()
 

Private Member Functions

 buildForm ()
 

Private Attributes

Settings $prompt_settings
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\Profile\Prompt\SettingsGUI::__construct ( private readonly \ilCtrl  $ctrl,
private readonly Language  $lng,
private readonly UIFactory  $ui_factory,
private readonly UIRenderer  $ui_renderer,
private \ilGlobalTemplateInterface  $tpl,
private readonly ServerRequestInterface  $request,
private readonly Refinery  $refinery,
private readonly Repository  $prompt_repository 
)

Definition at line 35 of file class.SettingsGUI.php.

44  {
45  $this->prompt_settings = $this->prompt_repository->getSettings();
46  }

Member Function Documentation

◆ buildForm()

ILIAS\User\Profile\Prompt\SettingsGUI::buildForm ( )
private

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

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

Referenced by ILIAS\User\Profile\Prompt\SettingsGUI\save().

88  : StandardForm
89  {
90  return $this->ui_factory->input()->container()->form()->standard(
91  $this->ctrl->getFormActionByClass(self::class, 'save'),
92  $this->prompt_settings->toForm($this->ui_factory, $this->lng, $this->refinery)
93  );
94  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ILIAS\User\Profile\Prompt\SettingsGUI::executeCommand ( )

Definition at line 48 of file class.SettingsGUI.php.

References ILIAS\Repository\ctrl().

48  : void
49  {
50  $next_class = $this->ctrl->getNextClass($this);
51  $cmd = $this->ctrl->getCmd("show");
52 
53  switch ($next_class) {
54  default:
55  if (in_array($cmd, ["show", "save"])) {
56  $this->$cmd();
57  }
58  }
59  }
+ Here is the call graph for this function:

◆ save()

ILIAS\User\Profile\Prompt\SettingsGUI::save ( )

Definition at line 70 of file class.SettingsGUI.php.

References $data, ILIAS\User\Profile\Prompt\SettingsGUI\buildForm(), ILIAS\Repository\lng(), null, and ILIAS\User\Profile\Prompt\SettingsGUI\show().

70  : void
71  {
72  $form = $this->buildForm()->withRequest($this->request);
73  $data = $form->getData();
74  if ($data === null) {
75  $this->tpl->setContent(
76  $this->ui_renderer->render($form)
77  );
78  return;
79  }
80 
81  $this->prompt_settings = $this->prompt_settings->withFormData($data);
82  $this->prompt_repository->saveSettings($this->prompt_settings);
83 
84  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_obj_modified'));
85  $this->show();
86  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ show()

ILIAS\User\Profile\Prompt\SettingsGUI::show ( )

Definition at line 61 of file class.SettingsGUI.php.

Referenced by ILIAS\User\Profile\Prompt\SettingsGUI\save().

61  : void
62  {
63  $this->tpl->setContent(
64  $this->ui_renderer->render(
65  $this->buildForm()
66  )
67  );
68  }
+ Here is the caller graph for this function:

Field Documentation

◆ $prompt_settings

Settings ILIAS\User\Profile\Prompt\SettingsGUI::$prompt_settings
private

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


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