ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
DocumentModal.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 use Closure;
28 
30 {
34  public function __construct(
35  private readonly UIServices $ui,
36  private readonly Closure $content_as_component
37  ) {
38  }
39 
43  public function create(DocumentContent $content): array
44  {
45  $modal = $this->ui->factory()->modal()->lightbox([
46  $this->ui->factory()->modal()->lightboxTextPage(
47  $this->ui->renderer()->render(($this->content_as_component)($content)),
48  $content->title()
49  )
50  ]);
51 
52  $link = $this->ui->factory()->button()->shy($content->title(), '')->withOnClick(
53  $modal->getShowSignal()
54  );
55 
56  return [$link, $modal];
57  }
58 }
Provides fluid interface to RBAC services.
Definition: UIServices.php:23
__construct(private readonly UIServices $ui, private readonly Closure $content_as_component)