ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ShowOnLoginPage.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 use Closure;
27 use ilTemplate;
28 
29 final class ShowOnLoginPage
30 {
34  public function __construct(
35  private readonly Provide $legal_documents,
36  private readonly UI $ui,
37  private readonly Closure $create_template
38  ) {
39  }
40 
44  public function __invoke(): array
45  {
46  if ($this->legal_documents->document()->repository()->countAll() === 0) {
47  return [];
48  }
49 
50  $template = ($this->create_template)('login_link.html');
51  $template->setVariable('LABEL', htmlentities($this->ui->txt('usr_agreement')));
52  $template->setVariable('HREF', $this->legal_documents->publicPage()->url());
53 
54  return [$this->ui->create()->legacy()->content($template->get())];
55  }
56 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(private readonly Provide $legal_documents, private readonly UI $ui, private readonly Closure $create_template)