ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
base.php File Reference

Go to the source code of this file.

Functions

 base ()
 

Function Documentation

◆ base()

base ( )

Definition at line 2 of file base.php.

References $DIC, and $factory.

3 {
4  global $DIC;
5  $factory = $DIC->ui()->factory();
6  $renderer = $DIC->ui()->renderer();
7 
8  $message1 = 'Toggle Button has been turned on';
9  $message2 = 'Toggle Button has been turned off';
10  $form_action = $DIC->ctrl()->getFormActionByClass('ilsystemstyledocumentationgui');
11 
12  $modal = $factory->modal()->interruptive('ON', $message1, $form_action);
13  $modal2 = $factory->modal()->interruptive('OFF', $message2, $form_action);
14 
15  //Note, important do not miss to set a proper aria-label (see rules above).
16  //Note that aria-pressed is taken care off by the default implementation.
17  $button = $factory->button()->toggle("", $modal->getShowSignal(), $modal2->getShowSignal())
18  ->withAriaLabel("Switch the State of XY");
19 
20  return $renderer->render([$button, $modal, $modal2]);
21 }
$DIC
Definition: xapitoken.php:46
$factory
Definition: metadata.php:58