ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
DocumentModal.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use Closure;
27
29{
33 private array $components = [];
34
38 public function __construct(
39 private readonly UIServices $ui,
40 private readonly Closure $content_as_component
41 ) {
42 }
43
47 public function create(DocumentContent $content): array
48 {
49 $modal = $this->ui->factory()->modal()->lightbox([
50 $this->ui->factory()->modal()->lightboxTextPage(
51 $this->ui->renderer()->render(($this->content_as_component)($content)),
52 $content->title()
53 )
54 ]);
55
56 $link = $this->ui->factory()->button()->shy($content->title(), '')->withOnClick(
57 $modal->getShowSignal()
58 );
59
60 $this->components[] = $modal;
61
62 return [$link];
63 }
64
68 public function popComponents(): array
69 {
71 $this->components = [];
72 return $c;
73 }
74}
Provides fluid interface to RBAC services.
Definition: UIServices.php:25
__construct(private readonly UIServices $ui, private readonly Closure $content_as_component)
$c
Definition: deliver.php:25
A component is the most general form of an entity in the UI.
Definition: Component.php:28
Class ilChatroomConfigFileHandler \ILIAS\Chatroom\classes.