19 declare(strict_types=1);
47 private readonly
ilCtrl $ctrl,
58 $this->poolOBJ = $poolGUI->getObject();
68 if (!$this->
access->checkAccess(
'write',
'', $this->poolGUI->getRefId())) {
69 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'cannot_edit_question_pool'),
true);
70 $this->
ctrl->redirectByClass(
'ilObjQuestionPoolGUI',
'infoScreen');
73 $this->
tabs->activateTab(
'settings');
74 $this->
tabs->activateSubTab(
'qpl_settings_subtab_general');
78 $nextClass = $this->
ctrl->getNextClass();
82 $cmd = $this->
ctrl->getCmd(self::CMD_SHOW_GENERAL_FORM) .
'Cmd';
89 $this->
tabs->activateSubTab(self::TAB_COMMON_SETTINGS);
93 $this->tpl->setContent($this->ui_renderer->render($form));
99 $form = $form->withRequest($this->http_request);
101 $result = $form->getInputGroup()->getContent();
103 if ($result->isOK()) {
104 $values = $result->value();
106 $this->tpl->setOnScreenMessage(MessageBox::SUCCESS, $this->
lng->txt(
"msg_obj_modified"),
true);
107 $this->
ctrl->redirect($this, self::CMD_SHOW_GENERAL_FORM);
109 $this->tpl->setOnScreenMessage(MessageBox::FAILURE, $this->
lng->txt(
'form_input_not_valid'));
116 $title_and_description =
$data[
'general_settings'][
'title_and_description'] ?? null;
118 $this->poolOBJ->getObjectProperties()->storePropertyTitleAndDescription(
119 $title_and_description
123 $online =
$data[
'availability'][
'online'] ?? null;
124 $this->poolOBJ->getObjectProperties()->storePropertyIsOnline(
125 $online ?? $this->poolOBJ->getObjectProperties()->getPropertyIsOnline()->withOffline()
128 $display_settings =
$data[
'display_settings'] ?? [];
129 if (isset($display_settings[
'tile_image'])) {
130 $this->poolOBJ->getObjectProperties()->storePropertyTileImage($display_settings[
'tile_image']);
134 $additional_features =
$data[
'additional_features'] ?? [];
135 $this->poolOBJ->setSkillServiceEnabled($additional_features[
'skill_service'] ??
false);
136 $this->poolOBJ->setShowTaxonomies($additional_features[
'show_tax'] ??
false);
138 $this->poolOBJ->saveToDb();
145 $md_obj =
new ilMD($this->poolOBJ->getId(), 0,
"qpl");
148 $title_and_description = $this->poolOBJ->getObjectProperties()->getPropertyTitleAndDescription()->toForm(
150 $this->ui_factory->input()->field(),
154 $items[
'general_settings'] = $this->ui_factory->input()->field()->section(
156 'title_and_description' => $title_and_description
158 $this->
lng->txt(
'qpl_form_general_settings')
161 $online = $this->poolOBJ->getObjectProperties()->getPropertyIsOnline()->toForm(
163 $this->ui_factory->input()->field(),
166 $availability = $this->ui_factory->input()->field()->section(
167 [
'online' => $online],
168 $this->
lng->txt(
'qpl_settings_availability')
170 $items[
'availability'] = $availability;
172 $timg = $this->poolOBJ->getObjectProperties()->getPropertyTileImage()->toForm(
174 $this->ui_factory->input()->field(),
177 $items[
'display_settings'] = $this->ui_factory->input()->field()->section(
178 [
'tile_image' => $timg],
179 $this->
lng->txt(
'tst_presentation_settings_section')
182 $additional_features_inputs = [];
185 $additional_features_inputs[
'skill_service'] = $this->ui_factory->input()->field()->checkbox(
186 $this->
lng->txt(
'tst_activate_skill_service')
187 )->
withValue($this->poolOBJ->isSkillServiceEnabled());
190 $additional_features_inputs[
'show_tax'] = $this->ui_factory->input()->field()->checkbox(
191 $this->
lng->txt(
'qpl_settings_general_form_property_show_taxonomies')
192 )->
withValue($this->poolOBJ->getShowTaxonomies());
194 $items[
'additional_features'] = $this->ui_factory->input()->field()->section(
195 $additional_features_inputs,
196 $this->
lng->txt(
'obj_features')
199 return $this->ui_factory->input()->container()->form()->standard(
200 $this->
ctrl->getFormAction($this, self::CMD_SAVE_GENERAL_FORM),
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const CMD_SAVE_GENERAL_FORM
__construct(private readonly ilCtrl $ctrl, private readonly ilAccessHandler $access, private readonly ilLanguage $lng, private readonly ilGlobalTemplateInterface $tpl, private readonly ilTabsGUI $tabs, private readonly ilObjQuestionPoolGUI $poolGUI, private readonly Refinery $refinery, private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer, private readonly HttpRequest $http_request,)
const TAB_COMMON_SETTINGS
showFormCmd(Form $form=null)
const CMD_SHOW_GENERAL_FORM
ilObjQuestionPool ilObject $poolOBJ
static isSkillManagementGloballyActivated()
executeCommand()
Command Execution.
Refinery Factory $refinery