ILIAS  release_8 Revision v8.24
show_popover_with_different_positions.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
8{
9 global $DIC;
10 $factory = $DIC->ui()->factory();
11 $renderer = $DIC->ui()->renderer();
12
13 $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.');
14 $popover = $factory->popover()->standard($content);
15 $button = $factory->button()->standard('Auto Popover', '#')
16 ->withOnClick($popover->getShowSignal());
17
18 $content = $factory->legacy('The position of this popover is either on top or bottom of the triggerer, based on the available space');
19 $popover2 = $factory->popover()->standard($content)
20 ->withVerticalPosition();
21 $button2 = $factory->button()->standard('Vertical Popover', '#')
22 ->withOnClick($popover2->getShowSignal());
23
24 $content = $factory->legacy('The position of this popover is either on the left or right of the triggerer, based on the available space');
25 $popover3 = $factory->popover()->standard($content)
26 ->withHorizontalPosition();
27 $button3 = $factory->button()->standard('Horizontal Popover', '#')
28 ->withOnClick($popover3->getShowSignal());
29
30 $buttons = implode(' ', [$renderer->render($button), $renderer->render($button2), $renderer->render($button3)]);
31
32 return $buttons . $renderer->render([$popover, $popover2, $popover3]);
33}
global $DIC
Definition: feed.php:28
$factory
Definition: metadata.php:75