ILIAS  trunk Revision v11.0_alpha-2658-ge2404539063
ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter Class Reference
+ Collaboration diagram for ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter:

Public Member Functions

 __construct (private readonly UI $ui, private readonly User $user, private readonly Provide $legal_documents, private readonly Closure $render, private readonly Closure $create_template, private readonly ?Closure $goto_link,)
 
 __invoke (Closure $footer)
 
 renderModal (DocumentContent $content)
 
 withdrawalButton ()
 

Private Member Functions

 footer (Closure $footer, object $value)
 

Detailed Description

Definition at line 35 of file ModifyFooter.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter::__construct ( private readonly UI  $ui,
private readonly User  $user,
private readonly Provide  $legal_documents,
private readonly Closure  $render,
private readonly Closure  $create_template,
private readonly ?Closure  $goto_link 
)
Parameters
Closure(list<Component>|Component)string $render
Closure(string)ilTemplate $create_template

Definition at line 41 of file ModifyFooter.php.

48  {
49  }

Member Function Documentation

◆ __invoke()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter::__invoke ( Closure  $footer)

Definition at line 51 of file ModifyFooter.php.

References ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter\footer(), ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter\renderModal(), and ILIAS\Repository\user().

51  : Closure
52  {
53  return $this->user->acceptedVersion()->map(
54  fn($document) => $this->footer($footer, $this->renderModal($document))
55  )->except(
56  fn() => new Ok(
57  !$this->goto_link || $this->user->isLoggedIn() ?
58  $footer :
59  $this->footer($footer, ($this->goto_link)())
60  )
61  )->value();
62  }
+ Here is the call graph for this function:

◆ footer()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter::footer ( Closure  $footer,
object  $value 
)
private
Parameters
URI | Modal$value

Definition at line 93 of file ModifyFooter.php.

References ILIAS\Repository\ui().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter\__invoke().

93  : Closure
94  {
95  return $footer($this->legal_documents->id(), $this->ui->txt('usr_agreement'), $value);
96  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderModal()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter::renderModal ( DocumentContent  $content)

Definition at line 64 of file ModifyFooter.php.

References ILIAS\LegalDocuments\Value\DocumentContent\title(), ILIAS\Repository\ui(), and ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter\withdrawalButton().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter\__invoke().

64  : Modal
65  {
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(),
72  ]);
73  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ withdrawalButton()

ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter::withdrawalButton ( )

Definition at line 75 of file ModifyFooter.php.

References ILIAS\Repository\ui().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\ConsumerSlots\ModifyFooter\renderModal().

75  : Component
76  {
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(
81  'BTN_WITHDRAWAL',
82  ($this->render)(
83  $this->ui->create()->button()->standard($this->ui->txt('withdraw_consent'), $this->legal_documents->withdrawal()->beginProcessURL())
84  )
85  );
86 
87  return $this->ui->create()->legacy()->content($template->get());
88  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: