19declare(strict_types=1);
43 private readonly
UI $ui,
44 private readonly
User $user,
45 private readonly
Provide $legal_documents,
46 private readonly Closure $render,
47 private readonly Closure $create_template,
48 private readonly ?Closure $goto_link,
52 public function __invoke(Closure $footer): Closure
54 return $this->
user->acceptedVersion()->map(
58 !$this->goto_link || $this->
user->isLoggedIn() ?
59 $this->footer($footer,
null) :
60 $this->footer($footer, ($this->goto_link)())
67 return $this->
ui->create()->modal()->roundtrip($content->
title(), [
68 $this->ui->create()->legacy()->content($this->ui->txt(
'usr_agreement_footer_intro')),
69 $this->ui->create()->divider()->horizontal(),
70 $this->legal_documents->document()->contentAsComponent($content),
71 $this->ui->create()->divider()->horizontal(),
72 $this->withdrawalButton(),
78 $template = ($this->create_template)(
'withdrawal-section.html');
79 $template->setVariable(
'TXT_WITHDRAWAL_HEADLINE', $this->
ui->txt(
'withdraw_consent_header'));
80 $template->setVariable(
'TXT_WITHDRAWAL', $this->
ui->txt(
'withdraw_consent_description'));
81 $template->setVariable(
84 $this->
ui->create()->button()->standard($this->
ui->txt(
'withdraw_consent'), $this->legal_documents->withdrawal()->beginProcessURL())
88 return $this->
ui->create()->legacy()->content($template->get());
94 private function footer(Closure $footer, ?
object $value): Closure
96 return $footer($this->legal_documents->id(), $this->ui->txt(
'usr_agreement'), $value);
A result encapsulates a value or an error and simplifies the handling of those.
The scope of this class is split ilias-conform URI's into components.
special template class to simplify handling of ITX/PEAR
A component is the most general form of an entity in the UI.
This describes commonalities between the different modals.