ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilOrgUnitAuthorityFormGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
21 
26 class 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 }
$c
Definition: deliver.php:25
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-...
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)
This class represents a text area property in a property form.
Class ilOrgUnitAuthorityFormGUI.
$r