ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
show_the_same_modal_with_different_buttons.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
34{
35 global $DIC;
36 $factory = $DIC->ui()->factory();
37 $renderer = $DIC->ui()->renderer();
38
39 $modal = $factory->modal()->roundtrip('My Modal 1', $factory->legacy()->content('My Content'))
40 ->withActionButtons([
41 $factory->button()->primary('Primary Action', ''),
42 $factory->button()->standard('Secondary Action', ''),
43 ]);
44
45 $out = '';
46 $button1 = $factory->button()->standard('Open Modal 1', '#')
47 ->withOnClick($modal->getShowSignal());
48 $out .= ' ' . $renderer->render($button1);
49
50 $button2 = $button1->withLabel('Also opens modal 1');
51 $out .= ' ' . $renderer->render($button2);
52
53 $button3 = $button2->withLabel('Does not open modal 1')
54 ->withResetTriggeredSignals();
55 $out .= ' ' . $renderer->render($button3);
56
57 return $out . $renderer->render($modal);
58}
$out
Definition: buildRTE.php:24
$renderer
global $DIC
Definition: shib_login.php:26