19 declare(strict_types=1);
36 private readonly \
ilCtrl $ctrl,
45 $this->prompt_settings = $this->prompt_repository->getSettings();
50 $next_class = $this->
ctrl->getNextClass($this);
51 $cmd = $this->
ctrl->getCmd(
"show");
53 switch ($next_class) {
55 if (in_array($cmd, [
"show",
"save"])) {
61 public function show(): void
63 $this->tpl->setContent(
64 $this->ui_renderer->render(
70 public function save(): void
72 $form = $this->
buildForm()->withRequest($this->request);
73 $data = $form->getData();
75 $this->tpl->setContent(
76 $this->ui_renderer->render($form)
81 $this->prompt_settings = $this->prompt_settings->withFormData(
$data);
82 $this->prompt_repository->saveSettings($this->prompt_settings);
84 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'));
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)
__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)
Settings $prompt_settings
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null