ILIAS  release_8 Revision v8.24
class.ilOrgUnitAuthorityFormGUI.php
Go to the documentation of this file.
1<?php
20
26{
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}
Class ActiveRecord.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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: cli.php:38