23use Psr\Http\Message\RequestInterface;
25use ILIAS\GlobalScreen\GUI\I18n\Translator;
35 private readonly Translator $translator,
36 private readonly
Group $group,
37 private ?
Entry $entry =
null,
40 $this->ui_factory =
$DIC->ui()->factory();
47 $ff = $this->ui_factory->input()->field();
51 ->text($this->translator->translate(
'title',
'entry'))
52 ->withValue($this->entry->getTitle())
53 ->withAdditionalTransformation(
54 $this->
refinery->custom()->transformation(function (
string $value):
string {
55 $this->entry = $this->entry->withTitle($value);
63 $this->translator->translate(
'active',
'entry'),
64 $this->translator->translate(
'active_info',
'entry')
66 ->withValue($this->entry->isActive())
67 ->withAdditionalTransformation(
68 $this->
refinery->custom()->transformation(function (
bool $value):
bool {
69 $this->entry = $this->entry->withActive($value);
75 $this->translator->translate(
'action',
'entry'),
76 $this->translator->translate(
'action_info',
'entry')
79 ->withValue($this->entry->getAction())
80 ->withAdditionalTransformation(
81 $this->
refinery->custom()->transformation(function (
string $value):
string {
82 $this->entry = $this->entry->withAction($value);
87 ->checkbox($this->translator->translate(
'external',
'entry'))
88 ->withValue($this->entry->isExternal())
89 ->withAdditionalTransformation(
90 $this->
refinery->custom()->transformation(function (
bool $value):
bool {
91 $this->entry = $this->entry->withExternal($value);
100 return $this->
form ?? $this->ui_factory
106 $this->
refinery->custom()->transformation(fn(array $value): ?
Entry => $this->entry)
110 public function store(RequestInterface $request,
string $target): bool
112 $this->
form = $this->
get($target)->withRequest($request);
114 if (
$data !==
null) {
115 $this->entry = $this->entry->withParent($this->group->getId());
Builds a Color from either hex- or rgb values.
This is how the factory for UI elements looks.
form( $class_path, string $cmd, string $submit_caption="")