19declare(strict_types=1);
24use ILIAS\GlobalScreen\GUI\I18n\Translator;
25use Psr\Http\Message\ServerRequestInterface;
57 $this->ui_factory = $pons->
out()->ui()->factory();
58 $this->i18n = $pons->
i18n();
59 $this->request = $pons->
in()->request();
67 $node_retrieval = new \NodeRetrievalGUI();
68 $current_ref_id_value = $this->shortlink->getTargetData()[
'ref_id'] ??
null;
74 $node_retrieval->getNodeRetrieval(),
75 $this->i18n->t(self::F_TARGET_REF_ID),
76 $this->i18n->t(self::F_TARGET_REF_ID,
'info'),
79 ->withAdditionalTransformation(
80 $this->
refinery->custom()->constraint(
81 fn(
$d):
bool => !empty(
$d),
82 $this->i18n->t(
'target_ref_id_required')
85 ->withAdditionalTransformation(
86 $this->
refinery->custom()->transformation(
100 if (!empty($current_ref_id_value)) {
101 $tree_select = $tree_select->withValue(
102 $current_ref_id_value
112 $this->i18n->t(self::F_ALIAS),
113 $this->i18n->t(self::F_ALIAS,
'info')
116 $this->shortlink->getAlias()
119 if (empty($this->shortlink->getId())) {
121 ->withAdditionalTransformation(
122 $this->
refinery->custom()->constraint(
124 $this->i18n->t(
'alias_already_exists')
130 ->withAdditionalTransformation(
131 $this->
refinery->custom()->constraint(
132 fn(
$d):
bool => $this->validator->isValid(
$d),
133 $this->i18n->t(
'alias_invalid')
136 ->withAdditionalTransformation(
137 $this->
refinery->custom()->transformation(
148 $this->i18n->t(self::F_ACTIVE),
149 $this->i18n->t(self::F_ACTIVE,
'info')
152 $this->shortlink->isActive()
154 ->withAdditionalTransformation(
155 $this->
refinery->custom()->transformation(
161 self::F_ALIAS => $alias,
162 self::F_TARGET_REF_ID => $tree_select,
163 self::F_ACTIVE => $active
175 (
string) $this->target,
190 $data = $form->getData();
200 public function get(): \Generator
Builds a Color from either hex- or rgb values.
The scope of this class is split ilias-conform URI's into components.
This is how the factory for UI elements looks.