ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
7 function base()
8 {
9  global $DIC;
10  $factory = $DIC->ui()->factory();
11  $renderer = $DIC->ui()->renderer();
12 
13  $message1 = 'Toggle Button has been turned on';
14  $message2 = 'Toggle Button has been turned off';
15  $form_action = $DIC->ctrl()->getFormActionByClass('ilsystemstyledocumentationgui');
16 
17  $modal = $factory->modal()->interruptive('ON', $message1, $form_action);
18  $modal2 = $factory->modal()->interruptive('OFF', $message2, $form_action);
19 
20  //Note, important do not miss to set a proper aria-label (see rules above).
21  //Note that aria-pressed is taken care off by the default implementation.
22  $button = $factory->button()->toggle("", $modal->getShowSignal(), $modal2->getShowSignal())
23  ->withAriaLabel("Switch the State of XY");
24 
25  return $renderer->render([$button, $modal, $modal2]);
26 }
global $DIC
Definition: feed.php:28
$factory
Definition: metadata.php:75