ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilOrgUnitAuthorityFormGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
21
26class ilOrgUnitAuthorityFormGUI extends BaseForm // TODO: still in use?
27{
28 protected \ActiveRecord $object;
29 private const F_TITLE = 'title';
30 private const F_DESCRIPTION = 'description';
31
32 public function initFormElements(): void
33 {
34 $te = new ilTextInputGUI($this->lng->txt(self::F_TITLE), self::F_TITLE);
35 $te->setRequired(true);
36 $this->addItem($te);
37
38 $te = new ilTextAreaInputGUI($this->lng->txt(self::F_DESCRIPTION), self::F_DESCRIPTION);
39 $this->addItem($te);
40
41 $c = new ilCustomInputGUI($this->lng->txt('authorities'));
42 $f = $this->parent_gui->dic()->ui()->factory();
43 $r = $this->parent_gui->dic()->ui()->renderer();
44 $modal = $f->modal()->roundtrip("Modal", $f->legacy()->content(''))->withCloseWithKeyboard(false);
45 $button = $f->button()
46 ->shy($this->lng->txt("open_authorities_modal"), '#')
47 ->withOnClick($modal->getShowSignal());
48
49 $c->setHtml($r->render([$button, $modal]));
50 $this->addItem($c);
51 }
52
53 public function fillForm(): void
54 {
55 $array = array(
56 self::F_TITLE => $this->object->getTitle(),
57 self::F_DESCRIPTION => $this->object->getDescription(),
58 );
59
60 $this->setValuesByArray($array);
61 }
62
63 public function fillObject(): bool
64 {
65 if (!$this->checkInput()) {
66 return false;
67 }
68
69 $this->object->setTitle($this->getInput(self::F_TITLE));
70 $this->object->setDescription($this->getInput(self::F_DESCRIPTION));
71
72
73 return true;
74 }
75}
This class represents a custom property in a property form.
Class ilOrgUnitAuthorityFormGUI.
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
This class represents a text area property in a property form.
This class represents a text property in a property form.
$c
Definition: deliver.php:25