3 declare(strict_types=1);
29 $this->tpl = $DIC->ui()->mainTemplate();
30 $this->
lng = $DIC->language();
31 $this->
ctrl = $DIC->ctrl();
33 $this->gui = $a_parent_gui;
53 $this->tpl->setContent($a_form->getForm()->getHTML());
70 $form->setFormAction($this->
ctrl->getFormAction($this->gui,
"updateAction"));
75 $adt_form->setForm($form);
80 $adt_form->addToForm();
81 $adt_form->addJS($this->tpl);
84 $form->addCommandButton(
"updateAction", $this->
lng->txt(
"save"));
96 $valid = $adt_form->getForm()->checkInput();
98 $old_chksum = $this->
object->getProperties()->getCheckSum();
100 $adt_form->importFromPost();
101 $valid = $adt_form->validate();
103 $changed = ($old_chksum != $this->
object->getProperties()->getCheckSum());
107 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"form_input_not_valid"));
113 if ($this->
object->update()) {
114 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
117 foreach ($this->
object->getDBErrors() as $element_id => $codes) {
118 $element = $adt_form->getElement($element_id);
120 $element->setExternalErrors($this->
object->translateDBErrorCodes($codes));
124 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"form_input_not_valid"));
129 $this->
ctrl->redirect($this->gui,
"edit");
prepareFormElements(ilADTGroupFormBridge $a_adt_form)
Prepare/customize form elements.
updateAction()
Parse incoming values and update if valid PhpParamsInspection.
Class ilObjectGUI Basic methods of all Output classes.
__construct(ilObjectGUI $a_parent_gui)
Constructor Parent GUI is just needed for testing (ilCtrl)
initObject()
Init ADT-based object.
editAction(ilADTGroupFormBridge $a_form=null)
initForm()
Init ADT-based form.
ADT based-object base class Currently "mixed" with ActiveRecord-pattern, could be splitted...
ilGlobalTemplateInterface $tpl
ADT based-object GUI base class.