ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ILIAS\UI\examples\Button\Close Namespace Reference

Functions

 base ()
 
 modal ()
 

Function Documentation

◆ base()

ILIAS\UI\examples\Button\Close\base ( )

description: > This example is rather artificial, since the close button is only used in other components (see purpose).

expected output: > ILIAS a dark grey "X" in the right corner. Clicking the "X" won't activate any action.

note: > In some cases, additional CSS will be required for placing the button

properly by the surrounding component.

Definition at line 37 of file base.php.

38{
39 global $DIC;
40 $f = $DIC->ui()->factory();
41 $renderer = $DIC->ui()->renderer();
42
43 return $renderer->render($f->button()->close());
44}
$renderer

References ILIAS\UI\examples\Layout\Page\Mail\$DIC, Vendor\Package\$f, and $renderer.

◆ modal()

ILIAS\UI\examples\Button\Close\modal ( )

description: > This example shows a scenario in which the Close Button is used in an overlay as indicated in the purpose description. Note that in the Modal the Close Button is properly placed in the top right corner.

expected output: > ILIAS shows a button titled "Show Close Button Demo". Clicking the button will open a modal with text and a Close-Button.

A click onto the button will close the modal.

Definition at line 35 of file modal.php.

36{
37 global $DIC;
38 $factory = $DIC->ui()->factory();
39 $renderer = $DIC->ui()->renderer();
40
41 $modal = $factory->modal()->roundtrip(
42 'Close Button Demo',
43 $factory->legacy()->content('See the Close Button in the top right corner.')
44 );
45 $button1 = $factory->button()->standard('Show Close Button Demo', '#')
46 ->withOnClick($modal->getShowSignal());
47
48 return $renderer->render([$button1, $modal]);
49}
global $DIC
Definition: shib_login.php:26

References $DIC, and $renderer.