ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
DocumentModal.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use Closure;
27
29{
33 public function __construct(
34 private readonly UIServices $ui,
35 private readonly Closure $content_as_component
36 ) {
37 }
38
42 public function create(DocumentContent $content): array
43 {
44 $modal = $this->ui->factory()->modal()->lightbox([
45 $this->ui->factory()->modal()->lightboxTextPage(
46 $this->ui->renderer()->render(($this->content_as_component)($content)),
47 $content->title()
48 )
49 ]);
50
51 $link = $this->ui->factory()->button()->shy($content->title(), '')->withOnClick(
52 $modal->getShowSignal()
53 );
54
55 return [$link, $modal];
56 }
57}
Provides fluid interface to RBAC services.
Definition: UIServices.php:25
__construct(private readonly UIServices $ui, private readonly Closure $content_as_component)
A component is the most general form of an entity in the UI.
Definition: Component.php:28