72 $this->check_input_called = $status;
78 protected function initForm() :
void 80 if ($this->assignment->getId() > 0) {
81 $this->
setTitle($this->lng->txt(
'acc_form_edit_criterion_head'));
83 $this->
setTitle($this->lng->txt(
'acc_form_attach_criterion_head'));
89 $document->setValue($this->document->getTitle());
93 if ($this->criterionTypeFactory->hasOnlyOneCriterion()) {
95 $criteriaSelection->setRequired(
true);
96 $criteriaSelection->setValue($this->assignment->getCriterionId());
98 foreach ($this->criterionTypeFactory->getTypesByIdentMap() as $criterion) {
100 if (!$this->assignment->getId()) {
101 $criteriaSelection->setValue($criterion->getTypeIdent());
104 $criterionGui = $criterion->ui($this->lng);
105 if ($this->assignment->getCriterionId() == $criterion->getTypeIdent()) {
106 $languageSelection = $criterionGui->getSelection($this->assignment->getCriterionValue());
110 $this->
addItem($languageSelection);
112 $this->
addItem($criteriaSelection);
114 $criteriaSelection =
new ilRadioGroupInputGUI($this->lng->txt(
'acc_form_criterion'),
'criterion');
116 $criteriaSelection->setValue($this->assignment->getCriterionId());
119 foreach ($this->criterionTypeFactory->getTypesByIdentMap() as $criterion) {
121 if (!$this->assignment->getId() && $first) {
122 $criteriaSelection->setValue($criterion->getTypeIdent());
126 $criterionGui = $criterion->ui($this->lng);
127 if ($this->assignment->getCriterionId() == $criterion->getTypeIdent()) {
128 $criterionGui->appendOption(
130 $this->assignment->getCriterionValue()
136 $this->
addItem($criteriaSelection);
148 return strlen($this->translatedError) > 0;
171 $this->criterionTypeFactory,
177 if (!$uniqueAssignmentConstraint->accepts($this->assignment)) {
178 $this->
getItemByPostVar(
'criterion')->setAlert($this->lng->txt(
'acc_criterion_assignment_must_be_unique_insert'));
179 if ($this->assignment->getId() > 0) {
180 $this->
getItemByPostVar(
'criterion')->setAlert($this->lng->txt(
'acc_criterion_assignment_must_be_unique_update'));
183 $this->translatedError = $this->lng->txt(
'form_input_not_valid');
188 if (!$this->assignment->getId()) {
189 $this->document->attachCriterion($this->assignment);
191 $this->document->save();
206 $criterionType = $this->criterionTypeFactory->findByTypeIdent($this->
getInput(
'criterion'));
207 $criterionGui = $criterionType->ui($this->lng);
209 $this->assignment->setCriterionId($criterionType->getTypeIdent());
210 $this->assignment->setCriterionValue($criterionGui->getConfigByForm($this));
212 if ($this->assignment->getId() > 0) {
213 $this->assignment->setLastModifiedUsrId($this->actor->getId());
215 $this->assignment->setOwnerUsrId($this->actor->getId());
219 $this->translatedError = $this->lng->txt(
'form_input_not_valid');
Class ilAccessibilityDocument.
Class ilAccessibilityDocumentCriterionAssignmentConstraint.
Class ilAccessibilityCriterionConfig.
This class represents a non editable value in a property form.
__construct(Container $dic, ilPlugin $plugin)
Interface ilAccessibilityCriterionTypeFactoryInterface.
Class ilAccessibilityDocumentCriterionAssignment.