ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
show_popover_with_different_positions.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
37{
38 global $DIC;
39 $factory = $DIC->ui()->factory();
40 $renderer = $DIC->ui()->renderer();
41
42 $content = $factory->legacy()->content('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.');
43 $popover = $factory->popover()->standard($content);
44 $button = $factory->button()->standard('Auto Popover', '#')
45 ->withOnClick($popover->getShowSignal());
46
47 $content = $factory->legacy()->content('The position of this popover is either on top or bottom of the triggerer, based on the available space');
48 $popover2 = $factory->popover()->standard($content)
49 ->withVerticalPosition();
50 $button2 = $factory->button()->standard('Vertical Popover', '#')
51 ->withOnClick($popover2->getShowSignal());
52
53 $content = $factory->legacy()->content('The position of this popover is either on the left or right of the triggerer, based on the available space');
54 $popover3 = $factory->popover()->standard($content)
55 ->withHorizontalPosition();
56 $button3 = $factory->button()->standard('Horizontal Popover', '#')
57 ->withOnClick($popover3->getShowSignal());
58
59 $buttons = implode(' ', [$renderer->render($button), $renderer->render($button2), $renderer->render($button3)]);
60
61 return $buttons . $renderer->render([$popover, $popover2, $popover3]);
62}
$renderer
global $DIC
Definition: shib_login.php:26