ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\UI\examples\Modal\Lightbox Namespace Reference

Functions

 show_different_page_types ()
 

description: > Example for rendering a lightbox modal. More...

 

Function Documentation

◆ show_different_page_types()

ILIAS\UI\examples\Modal\Lightbox\show_different_page_types ( )


description: > Example for rendering a lightbox modal.

expected output: > ILIAS shows a button titled "Show some fancy images and texts". A click onto the button will grey out ILIAS and opens a modal including multiple contents which can be displayed by clicking the arrow glyphs. All contents have got their own title. The contents consist of images and texts. In the lower part of the modal a circle glyph is displayed centered about which you can see that you can look at

five contents within the modal.

Definition at line 38 of file show_different_page_types.php.

References $DIC, and $renderer.

39 {
40  global $DIC;
41  $factory = $DIC->ui()->factory();
42  $renderer = $DIC->ui()->renderer();
43  $image = $factory->image()->responsive('assets/ui-examples/images/Image/mountains.jpg', 'Nice view on some mountains');
44  $page = $factory->modal()->lightboxImagePage(
45  $image,
46  'Mountains',
47  'Image source: https://stocksnap.io, Creative Commons CC0 license'
48  );
49 
50  $page2 = $factory->modal()->lightboxTextPage('Some text content you have to agree on!', 'User Agreement');
51 
52  $image2 = $factory->image()->responsive('assets/ui-examples/images/Image/sanfrancisco.jpg', 'The golden gate bridge');
53  $page3 = $factory->modal()->lightboxImagePage(
54  $image2,
55  'San Francisco',
56  'Image source: https://stocksnap.io, Creative Commons CC0 license'
57  );
58 
59  $page4 = $factory->modal()->lightboxTextPage(
60  'Another text content you have to agree on!',
61  'Data Privacy Statement'
62  );
63 
64  $image3 = $factory->image()->responsive('assets/ui-examples/images/Image/ski.jpg', 'Skiing');
65  $page5 = $factory->modal()->lightboxImagePage(
66  $image3,
67  'Ski Fun',
68  'Image source: https://stocksnap.io, Creative Commons CC0 license'
69  );
70 
71  $modal = $factory->modal()->lightbox([$page, $page2, $page3, $page4, $page5]);
72  $button = $factory->button()->standard('Show some fancy images and texts', '')
73  ->withOnClick($modal->getShowSignal());
74 
75  return $renderer->render([$button, $modal]);
76 }
$renderer
global $DIC
Definition: shib_login.php:22