19 declare(strict_types=1);
47 private \ILIAS\UI\Component\Input\Container\Form\Standard
$icon_form;
62 $this->
ctrl = $DIC->ctrl();
63 $this->
lng = $DIC->language();
64 $this->
tabs = $DIC->tabs();
65 $this->ui_factory = $DIC->ui()->factory();
66 $this->wrapper = $DIC->http()->wrapper();
74 $this->
tabs->clearSubTabs();
75 $this->
tabs->clearTargets();
76 $back_target = $this->
ctrl->getLinkTargetByClass(
77 ilObjFileIconsOverviewGUI::class,
80 $this->
tabs->setBackTarget($this->
lng->txt(
'back'), $back_target);
82 if ($this->mode == self::MODE_EDIT) {
83 $form_title = $this->
lng->txt(self::FORM_ICON_UPDATING);
84 $form_action = $this->
ctrl->getFormActionByClass(
85 ilObjFileIconsOverviewGUI::class,
89 $form_title = $this->
lng->txt(self::FORM_ICON_CREATION);
90 $form_action = $this->
ctrl->getFormActionByClass(
91 ilObjFileIconsOverviewGUI::class,
96 $rid = $this->icon->getRid();
97 $this->
ctrl->setParameterByClass(ilIconUploadHandlerGUI::class,
'rid', $rid);
98 $icon_input = $this->ui_factory->input()->field()->file(
100 $this->
lng->txt(self::INPUT_ICON),
101 $this->
lng->txt(self::INPUT_DESC_ICON)
102 )->withAcceptedMimeTypes(
108 $icon_input = $icon_input->withValue([$rid]);
111 $active_input = $this->ui_factory->input()->field()->checkbox(
112 $this->
lng->txt(self::INPUT_ACTIVE),
113 $this->
lng->txt(self::INPUT_DESC_ACTIVE)
115 $this->icon->isActive()
118 $suffix_input = $this->ui_factory->input()->field()->text(
119 $this->
lng->txt(self::INPUT_SUFFIXES),
120 $this->
lng->txt(self::INPUT_DESC_SUFFIXES)
124 $this->icon_repo->turnSuffixesArrayIntoString($this->icon->getSuffixes())
125 )->withAdditionalTransformation(
126 $this->
refinery->custom()->transformation(
function ($suffixes_input): array {
127 return $this->icon_repo->turnSuffixesStringIntoArray($suffixes_input);
129 )->withAdditionalTransformation(
130 $this->
refinery->custom()->constraint(
function ($suffixes_input):
bool {
131 return $this->icon_repo->hasSuffixInputOnlyAllowedCharacters($suffixes_input);
132 }, $this->
lng->txt(
'msg_error_suffixes_with_forbidden_characters'))
133 )->withAdditionalTransformation(
134 $this->
refinery->custom()->constraint(
function ($suffixes_input):
bool {
135 return $this->icon_repo->hasSuffixInputNoDuplicatesToItsOwnEntries($suffixes_input);
136 }, $this->
lng->txt(
'msg_error_duplicate_suffix_entries'))
137 )->withAdditionalTransformation(
138 $this->
refinery->custom()->constraint(
function ($suffixes_input):
bool {
140 $section = $this->icon_form->getInputs()[0];
141 $inputs = $section->getInputs();
142 $input_active =
$inputs[self::INPUT_ACTIVE];
143 $field_is_active = $input_active->getName();
144 $to_bool = $this->
refinery->custom()->transformation(
function ($checkbox_input_value):
bool {
147 $post_is_active_value = $this->wrapper->post()->retrieve($field_is_active, $to_bool);
149 return $this->icon_repo->causesNoActiveSuffixesConflict(
151 $post_is_active_value,
154 }, $this->
lng->txt(
'msg_error_active_suffixes_conflict'))
157 $section = $this->ui_factory->input()->field()->section([
158 self::INPUT_ICON => $icon_input,
159 self::INPUT_ACTIVE => $active_input,
160 self::INPUT_SUFFIXES => $suffix_input
162 $this->icon_form = $this->ui_factory->input()->container()->form()->standard($form_action, [$section]);
172 if ($checkbox_input_value !== null) {
173 $checkbox_input_value_str = $this->
refinery->kindlyTo()->string()->transform($checkbox_input_value);
174 if ($checkbox_input_value_str ==
"checked") {
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...