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

Functions

 show_a_single_image ()
 

description: > Example for rendering a lightbox image page modal with a single image. More...

 
 show_multiple_images ()
 

description: > Example for rendering a lightbox image page modal with multiple images. More...

 

Function Documentation

◆ show_a_single_image()

ILIAS\UI\examples\Modal\LightboxImagePage\show_a_single_image ( )


description: > Example for rendering a lightbox image page modal with a single image.

expected output: > ILIAS shows a button titled "Show Image". A click onto the button greys out ILIAS, opens a modal titled "Mountains",

an image and a Copyright note above the image. The modal's background is dark with a light font color.

Definition at line 34 of file show_a_single_image.php.

References $DIC, and $renderer.

35 {
36  global $DIC;
37  $factory = $DIC->ui()->factory();
38  $renderer = $DIC->ui()->renderer();
39  $image = $factory->image()->responsive("assets/ui-examples/images/Image/mountains.jpg", "Image source: https://stocksnap.io, Creative Commons CC0 license");
40  $page = $factory->modal()->lightboxImagePage($image, 'Mountains');
41  $modal = $factory->modal()->lightbox($page);
42  $button = $factory->button()->standard('Show Image', '')
43  ->withOnClick($modal->getShowSignal());
44 
45  return $renderer->render([$button, $modal]);
46 }
$renderer
global $DIC
Definition: shib_login.php:22

◆ show_multiple_images()

ILIAS\UI\examples\Modal\LightboxImagePage\show_multiple_images ( )


description: > Example for rendering a lightbox image page modal with multiple images.

expected output: > ILIAS shows a button titled "Show some fancy images". A click onto the button will grey out ILIAS and opens a modal with multiple contents which can be viewed one after another by clicking the arrow glyphs. The modal's background is dark with a light font color. All contents consist of a titled each. In the lower part of the modal a circle glyph is centered about which you can see that you can look at

three contents within the modal.

Definition at line 38 of file show_multiple_images.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($image, 'Mountains', 'Image source: https://stocksnap.io, Creative Commons CC0 license');
45  $image2 = $factory->image()->responsive('assets/ui-examples/images/Image/sanfrancisco.jpg', 'The golden gate bridge');
46  $page2 = $factory->modal()->lightboxImagePage($image2, 'San Francisco', 'Image source: https://stocksnap.io, Creative Commons CC0 license');
47  $image3 = $factory->image()->responsive('assets/ui-examples/images/Image/ski.jpg', 'Skiing');
48  $page3 = $factory->modal()->lightboxImagePage($image3, 'Ski Fun', 'Image source: https://stocksnap.io, Creative Commons CC0 license');
49  $modal = $factory->modal()->lightbox([$page, $page2, $page3]);
50  $button = $factory->button()->standard('Show some fancy images', '')
51  ->withOnClick($modal->getShowSignal());
52 
53  return $renderer->render([$button, $modal]);
54 }
$renderer
global $DIC
Definition: shib_login.php:22