ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
show_modal_on_button_click.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
30{
31 global $DIC;
32
33 $ui = $DIC->ui()->factory();
34
35 $item = $ui->item()
36 ->standard('Some information')
37 ->withDescription('A very long text.');
38
39
40 $another_item = $ui->item()
41 ->standard('Some other information')
42 ->withDescription('Another very long text.')
43 ->withProperties([
44 'Belongs to' => 'No one',
45 'Created on' => 'June the 15th',
46 'Awarded by' => 'John Doe',
47 'Valid until' => 'Forever',
48 ]);
49
50 $card = $ui->card()
51 ->standard('A card title')
52 ->withSections([$item])
53 ->withHiddenSections([$another_item]);
54 $box = $ui->modal()->lightboxCardPage($card);
55 $modal = $ui->modal()->lightbox($box);
56
57 $button = $ui
58 ->button()
59 ->standard('Show Modal', '')
60 ->withOnClick($modal->getShowSignal());
61
62 return $DIC->ui()->renderer()->render([$button, $modal]);
63}
global $DIC
Definition: shib_login.php:26