19declare(strict_types=1);
42 private readonly
UI $ui,
43 private readonly
User $user,
44 private readonly
Provide $legal_documents,
45 private readonly Closure $render,
46 private readonly Closure $create_template,
47 private readonly ?Closure $goto_link,
51 public function __invoke(Closure $footer): Closure
53 return $this->
user->acceptedVersion()->map(
57 !$this->goto_link || $this->
user->isLoggedIn() ?
59 $this->footer($footer, ($this->goto_link)())
66 return $this->
ui->create()->modal()->roundtrip($content->
title(), [
67 $this->ui->create()->legacy()->content($this->ui->txt(
'usr_agreement_footer_intro')),
68 $this->ui->create()->divider()->horizontal(),
69 $this->legal_documents->document()->contentAsComponent($content),
70 $this->ui->create()->divider()->horizontal(),
71 $this->withdrawalButton(),
77 $template = ($this->create_template)(
'withdrawal-section.html');
78 $template->setVariable(
'TXT_WITHDRAWAL_HEADLINE', $this->
ui->txt(
'withdraw_consent_header'));
79 $template->setVariable(
'TXT_WITHDRAWAL', $this->
ui->txt(
'withdraw_consent_description'));
80 $template->setVariable(
83 $this->
ui->create()->button()->standard($this->
ui->txt(
'withdraw_consent'), $this->legal_documents->withdrawal()->beginProcessURL())
87 return $this->
ui->create()->legacy()->content($template->get());
93 private function footer(Closure $footer,
object $value): Closure
95 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.
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.