ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
show_popover_with_different_positions.php
Go to the documentation of this file.
1 <?php
3 {
4  global $DIC;
5  $factory = $DIC->ui()->factory();
6  $renderer = $DIC->ui()->renderer();
7 
8  $content = $factory->legacy('The position of this popover is calculated automatically based on the available space. Note that the max width CSS setting is used here, as this text is quite long.');
9  $popover = $factory->popover()->standard($content);
10  $button = $factory->button()->standard('Auto Popover', '#')
11  ->withOnClick($popover->getShowSignal());
12 
13  $content = $factory->legacy('The position of this popover is either on top or bottom of the triggerer, based on the available space');
14  $popover2 = $factory->popover()->standard($content)
15  ->withVerticalPosition();
16  $button2 = $factory->button()->standard('Vertical Popover', '#')
17  ->withOnClick($popover2->getShowSignal());
18 
19  $content = $factory->legacy('The position of this popover is either on the left or right of the triggerer, based on the available space');
20  $popover3 = $factory->popover()->standard($content)
21  ->withHorizontalPosition();
22  $button3 = $factory->button()->standard('Horizontal Popover', '#')
23  ->withOnClick($popover3->getShowSignal());
24 
25  $buttons = implode(' ', [$renderer->render($button), $renderer->render($button2), $renderer->render($button3)]);
26 
27  return $buttons . $renderer->render([$popover, $popover2, $popover3]);
28 }
global $DIC
Definition: saml.php:7
$factory
Definition: metadata.php:43