77 : StandardForm {
78 $logout_group = $this->ui_factory->input()->field()
79 ->group(
80 [],
81 $this->
lng->txt(
'destination_logout_screen')
82 );
83
84 $login_group = $this->ui_factory->input()->field()
85 ->group(
86 [],
87 $this->
lng->txt(
'destination_login_screen'),
88 $this->lng->txt('destination_login_screen_info')
89 );
90
91 $ref_id = $this->ui_factory->input()->field()
92 ->numeric($this->
lng->txt(
'destination_internal_ressource_ref_id'))
93 ->withAdditionalTransformation(
94 $this->
refinery->custom()->constraint(
95 fn($value) => $this->configurable_logout_target->isInRepository($value),
96 fn(callable
$txt, $value) =>
$txt(
'logout_behaviour_invalid_ref_id', $value)
97 )
98 )
99 ->withAdditionalTransformation(
100 $this->
refinery->custom()->constraint(
101 fn($value) => $this->configurable_logout_target->isAnonymousAccessible(
102 $value
103 ),
105 'logout_behaviour_ref_id_no_access',
106 $value
107 )
108 )
109 )
110 ->withValue($this->
settings->get(
'logout_behaviour_ref_id',
''));
111 if (isset($errors['ref_id'])) {
113 }
114
115 $internal_group = $this->ui_factory->input()->field()
116 ->group(
118 $this->
lng->txt(
'destination_internal_ressource')
119 );
120
121 $url = $this->
settings->get(
'logout_behaviour_url',
'');
122 $html = $this->ui_factory->input()->field()
123 ->url($this->
lng->txt(
'destination_external_ressource_url'))
124 ->withAdditionalTransformation(
125 $this->
refinery->custom()->constraint(
126 fn($value) => $this->configurable_logout_target->isValidExternalResource(
127 (string) $value
128 ),
129 fn(callable
$txt, $value) =>
$txt(
'logout_behaviour_invalid_url', $value)
130 )
131 )
133 if (isset($errors['url'])) {
134 $html = $html->withError($errors['url']);
135 }
136
137 $external_group = $this->ui_factory->input()->field()
138 ->group(
139 ['url' => $html],
140 $this->
lng->txt(
'destination_external_ressource')
141 );
142
143 $logout_behaviour_switchable_group = $this->ui_factory->input()->field()
144 ->switchableGroup(
145 [
146 LogoutDestinations::LOGOUT_SCREEN->value => $logout_group,
147 LogoutDestinations::LOGIN_SCREEN->value => $login_group,
148 ConfigurableLogoutTarget::INTERNAL_RESSOURCE => $internal_group,
149 ConfigurableLogoutTarget::EXTERNAL_RESSOURCE => $external_group
150 ],
151 $this->
lng->txt(
'destination_after_logout')
152 )
153 ->withValue(
155 'logout_behaviour',
156 LogoutDestinations::LOGOUT_SCREEN->value
157 )
158 );
159
160 $section = $this->ui_factory->input()->field()
161 ->section(
162 ['logout_behaviour_settings' => $logout_behaviour_switchable_group],
163 $this->
lng->txt(
'logout_behaviour_settings')
164 );
165
166 $form = $this->ui_factory->input()->container()->form()
167 ->standard(
168 $this->
ctrl->getFormAction($this,
'saveForm'),
169 ['logout_behaviour' => $section]
170 );
171 if ($request) {
172 $form = $form->withRequest($request);
173 }
174
175 return $form;
176 }