19 declare(strict_types=1);
60 $this->routing = $routing ??
new Routing(
61 $this->container->ctrl(),
70 return new Provide($id, $this->
internal, $this->container);
75 $create = $this->
internal->get(
'show-on-login-page', $id);
79 return $this->container->ui()->renderer()->render($create());
85 $id = $this->container->http()->wrapper()->query()->retrieve(
87 $this->container->refinery()->to()->string()
93 $logout_text = $this->
internal->get(
'logout-text',
$id);
95 return null === $logout_text ?
'' : $this->container->ui()->renderer()->render($logout_text());
102 $this->container->http()->wrapper()->query()->has(
'withdraw_consent'),
103 $this->container->ctrl()
109 return array_reduce($this->internal->all(
'footer'), fn(
Closure $footer,
Closure $proc) => $proc($footer), $footer);
112 public function agree(
string $gui,
string $cmd): void
119 $key = ilLegalDocumentsAgreementGUI::class === $gui ?
'agreement-form' :
'public-page';
122 if (!$result->isOk() && $result->error() ===
'Not available.') {
123 $this->routing->redirectToOriginalTarget();
126 return $result->value();
129 public function withdraw(
string $gui,
string $cmd): void
140 $filters = $this->
internal->all(
'filter-online-users');
142 $visible_users = array_reduce(
144 fn($users, $only_visible_users) => $only_visible_users($users),
148 return array_values(array_diff($users, $visible_users));
153 return $this->container->refinery()->in()->series(array_values($this->internal->all(
'constrain-internal-mail')));
158 return $this->container->refinery()->in()->series(array_values($this->internal->all(
'use-soap-api')));
163 array_map(fn($proc) => $proc(), $this->internal->all(
'after-login'));
172 fn($goto_link) => $goto_link->name() === $goto_target,
173 $this->
internal->all(
'goto')
174 )->map(fn($goto_link) => $goto_link->target());
182 return $this->
internal->all(
'intercept');
187 return new Bundle($this->internal->all(
'self-registration'));
197 $this->internal->all(
'user-management-fields'),
198 fn(array $prev, callable
$f): array => [
200 ...array_map(
function ($val) {
201 if (is_array($val)) {
202 $this->
find(fn($x) => $x instanceof
Modal, $val)
203 ->map(fn($modal) => array_push($this->modals, $modal));
215 $string = $this->container->ui()->renderer()->render($this->modals);
231 foreach ($array as $x) {
232 if ($predicate($x)) {
237 return new Error(
'Not found.');
247 return $this->
find($predicate, $array)->isOk();
257 return !$this->
any(
static fn($x) => !$predicate($x), $array);
263 $id = $this->container->http()->wrapper()->query()->retrieve(
'id', $this->container->refinery()->to()->string());
265 return new Error(
'No provider ID given.');
268 $this->container->ctrl()->setParameterByClass($gui,
'id',
$id);
270 $value = $this->
internal->get($key,
$id);
272 if (
null === $value) {
273 return new Error(
'Field not defined.');
276 return new Ok($value);
284 return fn(
Closure $proc) => $proc($gui, $cmd)->map(fn($fragment) => $fragment->render(
285 $this->container->ui()->mainTemplate(),
286 $this->container->ui()->renderer()
292 $this->container->ui()->mainTemplate()->setContent($content);
298 $action =
new UserAction($this->container->user(), $clock);
This describes commonalities between the different modals.
readonly Internal $internal
userCanReadInternalMail()
__construct(private readonly Container $container, ?Internal $internal=null, ?Routing $routing=null)
find(Closure $predicate, array $array)
A
Customizing of pimple-DIC for ILIAS.
all(Closure $predicate, array $array)
A
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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
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)