80 $txt =
function (
$id) :
string {
81 return $this->lng->txt(
$id);
83 $f =
function () : InputFactory {
84 return $this->ui_fa->input();
87 $title =
$f()->field()->text(
$txt(
'sub_title_default'),
$txt(
'sub_title_default_byline'));
88 if (!$this->item_facade->isEmpty()) {
89 $title =
$title->withValue($this->item_facade->getDefaultTitle());
91 $items[self::F_TITLE] =
$title;
94 $type =
$f()->field()->radio(
$txt(
'sub_type'),
$txt(
'sub_type_byline'))->withRequired(
true);
95 $type_informations = $this->
repository->getPossibleSubItemTypesWithInformation();
97 foreach ($type_informations as $classname => $information) {
98 if ($this->item_facade->isEmpty()
99 || (!$this->item_facade->isEmpty() && $classname === $this->item_facade->getType() && $this->item_facade->isCustom())
101 $inputs = $this->
repository->getTypeHandlerForType($classname)->getAdditionalFieldsForSubForm($this->item_facade->identification());
102 $type =
$type->withOption($this->
hash($classname), $information->getTypeNameForPresentation(), $information->getTypeBylineForPresentation(), $inputs);
106 if (!$this->item_facade->isEmpty() && $this->item_facade->isCustom()) {
107 $type =
$type->withValue($this->
hash($this->item_facade->getType()));
108 } elseif ($this->item_facade->isCustom()) {
109 $type =
$type->withValue($this->
hash(reset(array_keys($type_informations))));
112 if ($this->item_facade->isEmpty() || $this->item_facade->isCustom()) {
113 $items[self::F_TYPE] =
$type;
117 $parent =
$f()->field()->select(
$txt(
'sub_parent'), $this->
repository->getPossibleParentsForFormAndTable())
118 ->withRequired(
true);
119 if (!$this->item_facade->isEmpty() && !$this->item_facade->isInLostItem()) {
120 $parent = $parent->withValue($this->item_facade->getParentIdentificationString());
122 $parent = $parent->withValue(reset(array_keys($this->
repository->getPossibleParentsForFormAndTable())));
124 $items[self::F_PARENT] = $parent;
127 $active =
$f()->field()->checkbox(
$txt(
'sub_active'),
$txt(
'sub_active_byline'));
128 if (!$this->item_facade->isEmpty()) {
129 $active = $active->withValue($this->item_facade->isAvailable());
131 $items[self::F_ACTIVE] = $active;
134 if ($this->item_facade->isEmpty()) {
136 $this->form =
$f()->container()->form()
140 $this->form =
$f()->container()->form()
if(!array_key_exists('StateId', $_REQUEST)) $id
hash(StreamInterface $stream, $algo, $rawOutput=false)
Calculate a hash of a Stream.