ILIAS  release_7 Revision v7.30-3-g800a261c036
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}
An exception for terminatinating execution or to throw for unit testing.
global $DIC
Definition: goto.php:24
$factory
Definition: metadata.php:58