19 declare(strict_types=1);
57 $this->routing = $routing ??
new Routing(
58 $this->container->ctrl(),
67 return new Provide($id, $this->
internal, $this->container);
72 $create = $this->
internal->get(
'show-on-login-page', $id);
76 return $this->container->ui()->renderer()->render($create());
82 $id = $this->container->http()->wrapper()->query()->retrieve(
84 $this->container->refinery()->to()->string()
90 $logout_text = $this->
internal->get(
'logout-text',
$id);
92 return null === $logout_text ?
'' : $this->container->ui()->renderer()->render($logout_text());
99 $this->container->http()->wrapper()->query()->has(
'withdraw_consent'),
100 $this->container->ctrl()
106 return array_reduce($this->internal->all(
'footer'), fn(
Closure $footer,
Closure $proc) => $proc($footer), $footer);
109 public function agree(
string $gui,
string $cmd): void
116 $key = ilLegalDocumentsAgreementGUI::class === $gui ?
'agreement-form' :
'public-page';
119 if (!$result->isOk() && $result->error() ===
'Not available.') {
120 $this->routing->redirectToOriginalTarget();
123 return $result->value();
126 public function withdraw(
string $gui,
string $cmd): void
137 $filters = $this->
internal->all(
'filter-online-users');
139 $visible_users = array_reduce(
141 fn($users, $only_visible_users) => $only_visible_users($users),
145 return array_values(array_diff($users, $visible_users));
150 return $this->container->refinery()->in()->series(array_values($this->internal->all(
'constrain-internal-mail')));
155 return $this->container->refinery()->in()->series(array_values($this->internal->all(
'use-soap-api')));
160 array_map(fn($proc) => $proc(), $this->internal->all(
'after-login'));
169 fn($goto_link) => $goto_link->name() === $goto_target,
170 $this->
internal->all(
'goto')
171 )->map(fn($goto_link) => $goto_link->target());
179 return $this->
internal->all(
'intercept');
184 return new Bundle($this->internal->all(
'self-registration'));
194 $this->internal->all(
'user-management-fields'),
195 fn(array $prev, callable
$f): array => [
197 ...array_map(
function ($val) {
198 if (is_array($val)) {
199 $this->
find(fn($x) => $x instanceof
Modal, $val)
200 ->map(fn($modal) => array_push($this->modals, $modal));
212 $string = $this->container->ui()->renderer()->render($this->modals);
228 foreach ($array as $x) {
229 if ($predicate($x)) {
234 return new Error(
'Not found.');
244 return $this->
find($predicate, $array)->isOk();
254 return !$this->
any(
static fn($x) => !$predicate($x), $array);
260 $id = $this->container->http()->wrapper()->query()->retrieve(
'id', $this->container->refinery()->to()->string());
262 return new Error(
'No provider ID given.');
265 $this->container->ctrl()->setParameterByClass($gui,
'id',
$id);
267 $value = $this->
internal->get($key,
$id);
269 if (null === $value) {
270 return new Error(
'Field not defined.');
273 return new Ok($value);
281 return fn(
Closure $proc) => $proc($gui, $cmd)->map(fn($fragment) => $fragment->render(
282 $this->container->ui()->mainTemplate(),
283 $this->container->ui()->renderer()
289 $this->container->ui()->mainTemplate()->setContent($content);
295 $action =
new UserAction($this->container->user(), $clock);
This describes commonalities between the different modals.
readonly Internal $internal
userCanReadInternalMail()
find(Closure $predicate, array $array)
A
Customizing of pimple-DIC for ILIAS.
all(Closure $predicate, array $array)
A
static logoutUrl(array $parameters=[])
Return the logout URL with a valid CSRF token.
logoutTarget(LogoutTarget $target)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
renderPageFragment(string $gui, string $cmd)
A result encapsulates a value or an error and simplifies the handling of those.
readonly Routing $routing
__construct(private readonly Container $container, ?Internal $internal=null, Routing $routing=null)
any(Closure $predicate, array $array)
A
setMainTemplateContent(string $content)
static redirectToStartingPage(string $target='')
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
modifyFooter(Closure $footer)
loginPageHTML(string $id)
findGotoLink(string $goto_target)
agree(string $gui, string $cmd)
agreeContent(string $gui, string $cmd)
withdraw(string $gui, string $cmd)
userManagementFields(ilObjUser $user)
usersWithHiddenOnlineStatus(array $users)
byQueryParams(string $gui, string $cmd, string $key)