ILIAS  release_7 Revision v7.30-3-g800a261c036
show_the_same_modal_with_different_buttons.php File Reference

Go to the source code of this file.

Functions

 show_the_same_modal_with_different_buttons ()
 

Function Documentation

◆ show_the_same_modal_with_different_buttons()

show_the_same_modal_with_different_buttons ( )

Definition at line 2 of file show_the_same_modal_with_different_buttons.php.

3{
4 global $DIC;
5 $factory = $DIC->ui()->factory();
6 $renderer = $DIC->ui()->renderer();
7
8 $modal = $factory->modal()->roundtrip('My Modal 1', $factory->legacy('My Content'))
9 ->withActionButtons([
10 $factory->button()->primary('Primary Action', ''),
11 $factory->button()->standard('Secondary Action', ''),
12 ]);
13
14 $out = '';
15 $button1 = $factory->button()->standard('Open Modal 1', '#')
16 ->withOnClick($modal->getShowSignal());
17 $out .= ' ' . $renderer->render($button1);
18
19 $button2 = $button1->withLabel('Also opens modal 1');
20 $out .= ' ' . $renderer->render($button2);
21
22 $button3 = $button2->withLabel('Does not open modal 1')
23 ->withResetTriggeredSignals();
24 $out .= ' ' . $renderer->render($button3);
25
26 return $out . $renderer->render($modal);
27}
global $DIC
Definition: goto.php:24
$factory
Definition: metadata.php:58

References $DIC, $factory, and $out.