ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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 36 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 42 of file ModifyFooter.php.

49 {
50 }

Member Function Documentation

◆ __invoke()

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

Definition at line 52 of file ModifyFooter.php.

52 : Closure
53 {
54 return $this->user->acceptedVersion()->map(
55 fn($document) => $this->footer($footer, $this->renderModal($document))
56 )->except(
57 fn() => new Ok(
58 !$this->goto_link || $this->user->isLoggedIn() ?
59 $this->footer($footer, null) :
60 $this->footer($footer, ($this->goto_link)())
61 )
62 )->value();
63 }

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

+ Here is the call graph for this function:

◆ footer()

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

Definition at line 94 of file ModifyFooter.php.

94 : Closure
95 {
96 return $footer($this->legal_documents->id(), $this->ui->txt('usr_agreement'), $value);
97 }

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

+ Here is the caller graph for this function:

◆ renderModal()

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

Definition at line 65 of file ModifyFooter.php.

65 : Modal
66 {
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(),
73 ]);
74 }

References ILIAS\LegalDocuments\Value\DocumentContent\title(), and ILIAS\Repository\ui().

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

+ 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 76 of file ModifyFooter.php.

76 : Component
77 {
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(
82 'BTN_WITHDRAWAL',
83 ($this->render)(
84 $this->ui->create()->button()->standard($this->ui->txt('withdraw_consent'), $this->legal_documents->withdrawal()->beginProcessURL())
85 )
86 );
87
88 return $this->ui->create()->legacy()->content($template->get());
89 }

References ILIAS\Repository\ui().

+ Here is the call graph for this function:

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