ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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 }

References ILIAS\Repository\ctrl().

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

+ 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.

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 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ save()

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

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

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 }

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

+ Here is the call graph for this function:

◆ show()

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

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

61 : void
62 {
63 $this->tpl->setContent(
64 $this->ui_renderer->render(
65 $this->buildForm()
66 )
67 );
68 }

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

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