ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
show_the_same_modal_with_different_buttons.php
Go to the documentation of this file.
1 <?php
2 
19 declare(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 }
$renderer
show_the_same_modal_with_different_buttons()
description: > Example for rendering a round trip modal with different buttons.
$out
Definition: buildRTE.php:24
global $DIC
Definition: shib_login.php:22