81 return $this->lng->txt(
$key);
83 $f =
function () : InputFactory {
84 return $this->ui_fa->input();
88 $title =
$f()->field()->text(
$txt(
'topitem_title_default'),
$txt(
'topitem_title_default_byline'))
90 if (!$this->item_facade->isEmpty()) {
91 $title =
$title->withValue($this->item_facade->getDefaultTitle());
94 $items[self::F_TITLE] =
$title;
97 $type =
$f()->field()->radio(
$txt(
'topitem_type'),
$txt(
'topitem_type_byline'))->withRequired(
true);
98 $type_informations = $this->
repository->getPossibleTopItemTypesWithInformation();
101 foreach ($type_informations as $classname => $information) {
102 if ($this->item_facade->isEmpty()
103 || (!$this->item_facade->isEmpty() && $classname === $this->item_facade->getType() && $this->item_facade->isCustom())
105 $inputs = $this->
repository->getTypeHandlerForType($classname)->getAdditionalFieldsForSubForm($this->item_facade->identification());
106 $type =
$type->withOption($this->
hash($classname), $information->getTypeNameForPresentation(), $information->getTypeBylineForPresentation(), $inputs);
111 if (!$this->item_facade->isEmpty() && $this->item_facade->isCustom()) {
112 $type =
$type->withValue($this->
hash($this->item_facade->getType()));
113 } elseif ($this->item_facade->isCustom()) {
114 $type =
$type->withValue($this->
hash(reset(array_keys($type_informations))));
117 if (($this->item_facade->isEmpty() || $this->item_facade->isCustom()) && $type_i > 0) {
118 $items[self::F_TYPE] =
$type;
122 $active =
$f()->field()->checkbox(
$txt(
'topitem_active'),
$txt(
'topitem_active_byline'));
123 if (!$this->item_facade->isEmpty()) {
124 $active = $active->withValue($this->item_facade->isAvailable());
126 $items[self::F_ACTIVE] = $active;
129 if ($this->item_facade->isEmpty()) {
hash(StreamInterface $stream, $algo, $rawOutput=false)
Calculate a hash of a Stream.