ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Questions\Administration\ConfigurationGUI Class Reference
+ Collaboration diagram for ILIAS\Questions\Administration\ConfigurationGUI:

Public Member Functions

 __construct (private readonly \ilCtrl $ctrl, private readonly HTTP $http, private readonly Language $lng, private readonly Refinery $refinery, private readonly \ilGlobalTemplateInterface $tpl, private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer, private readonly ConfigurationRepository $repository)
 
 executeCommand ()
 

Private Member Functions

 viewCmd (?StandardForm $form=null)
 
 saveCmd ()
 
 buildSettingsForm ()
 

Private Attributes

const string CMD_DEFAULT = 'view'
 
const string CMD_SAVE = 'save'
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Questions\Administration\ConfigurationGUI::__construct ( private readonly \ilCtrl  $ctrl,
private readonly HTTP  $http,
private readonly Language  $lng,
private readonly Refinery  $refinery,
private readonly \ilGlobalTemplateInterface  $tpl,
private readonly UIFactory  $ui_factory,
private readonly UIRenderer  $ui_renderer,
private readonly ConfigurationRepository  $repository 
)

Definition at line 36 of file class.ConfigurationGUI.php.

45 {
46 }

Member Function Documentation

◆ buildSettingsForm()

ILIAS\Questions\Administration\ConfigurationGUI::buildSettingsForm ( )
private

Definition at line 85 of file class.ConfigurationGUI.php.

85 : StandardForm
86 {
87 return $this->ui_factory->input()->container()->form()->standard(
88 $this->ctrl->getLinkTargetByClass(
89 [
90 \ilAdministrationGUI::class,
91 \ilObjQuestionsGUI::class,
92 self::class
93 ],
94 self::CMD_SAVE
95 ),
96 [
97 'default_user_settings' => $this->ui_factory->input()->field()->section(
98 [
99 'create_mode' => $this->repository->getInputForCreateMode(
100 $this->ui_factory->input()->field(),
101 $this->lng,
102 $this->refinery
103 )->withAdditionalTransformation(
104 $this->refinery->custom()->transformation(
105 static fn(string $v): CreateModes => CreateModes::tryFrom($v)
106 ?? CreateModes::getDefaultMode()
107 )
108 )
109 ],
110 $this->lng->txt('default_user_settings')
111 )
112 ]
113 );
114 }

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

+ Here is the call graph for this function:

◆ executeCommand()

ILIAS\Questions\Administration\ConfigurationGUI::executeCommand ( )

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

48 : void
49 {
50 $cmd = $this->ctrl->getCmd(self::CMD_DEFAULT) . 'Cmd';
51 $this->$cmd();
52 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveCmd()

ILIAS\Questions\Administration\ConfigurationGUI::saveCmd ( )
private

Definition at line 64 of file class.ConfigurationGUI.php.

64 : void
65 {
66 $form = $this->buildSettingsForm()->withRequest($this->http->request());
67 $data = $form->getData();
68 if ($data === null) {
69 $this->viewCmd($form);
70 }
71
72 $this->repository->persistCreateMode(
73 $data['default_user_settings']['create_mode']
74 );
75
76 $this->ctrl->redirectByClass(
77 [
78 \ilAdministrationGUI::class,
79 \ilObjQuestionsGUI::class,
80 self::class
81 ]
82 );
83 }
static http()
Fetches the global http state from ILIAS.
$data
Definition: storeScorm.php:45

References $data, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), and ILIAS\UI\examples\Deck\repository().

+ Here is the call graph for this function:

◆ viewCmd()

ILIAS\Questions\Administration\ConfigurationGUI::viewCmd ( ?StandardForm  $form = null)
private

Definition at line 54 of file class.ConfigurationGUI.php.

56 : void {
57 $this->tpl->setContent(
58 $this->ui_renderer->render(
59 $form ?? $this->buildSettingsForm()
60 )
61 );
62 }

Field Documentation

◆ CMD_DEFAULT

const string ILIAS\Questions\Administration\ConfigurationGUI::CMD_DEFAULT = 'view'
private

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

◆ CMD_SAVE

const string ILIAS\Questions\Administration\ConfigurationGUI::CMD_SAVE = 'save'
private

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


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