ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilOrgUnitAuthorityFormGUI.php
Go to the documentation of this file.
1 <?php
20 
26 {
27  protected ActiveRecord $object;
28  private const F_TITLE = 'title';
29  private const F_DESCRIPTION = 'description';
30 
31  public function initFormElements(): void
32  {
33  $te = new ilTextInputGUI($this->lng->txt(self::F_TITLE), self::F_TITLE);
34  $te->setRequired(true);
35  $this->addItem($te);
36 
37  $te = new ilTextAreaInputGUI($this->lng->txt(self::F_DESCRIPTION), self::F_DESCRIPTION);
38  $this->addItem($te);
39 
40  $c = new ilCustomInputGUI($this->lng->txt('authorities'));
41  $f = $this->parent_gui->dic()->ui()->factory();
42  $r = $this->parent_gui->dic()->ui()->renderer();
43  $modal = $f->modal()->roundtrip("Modal", $f->legacy(''))->withCloseWithKeyboard(false);
44  $button = $f->button()
45  ->shy($this->lng->txt("open_authorities_modal"), '#')
46  ->withOnClick($modal->getShowSignal());
47 
48  $c->setHtml($r->render([$button, $modal]));
49  $this->addItem($c);
50  }
51 
52  public function fillForm(): void
53  {
54  $array = array(
55  self::F_TITLE => $this->object->getTitle(),
56  self::F_DESCRIPTION => $this->object->getDescription(),
57  );
58 
59  $this->setValuesByArray($array);
60  }
61 
62  public function fillObject(): bool
63  {
64  if (!$this->checkInput()) {
65  return false;
66  }
67 
68  $this->object->setTitle($this->getInput(self::F_TITLE));
69  $this->object->setDescription($this->getInput(self::F_DESCRIPTION));
70 
71  return true;
72  }
73 }
$c
Definition: cli.php:38
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 file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
Class ilOrgUnitAuthorityFormGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...