ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
LightboxImagePage.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25use ILIAS\UI\Implementation\Component\ComponentHelper;
26use ILIAS\UI\Component\Modal\LightboxImagePage as ILightboxImagePage;
27
36class LightboxImagePage implements LightboxDescriptionEnabledPage, ILightboxImagePage
37{
38 use ComponentHelper;
39
40 protected Image $image;
41 protected string $title;
42 protected string $description;
43
44 public function __construct(Image $image, string $title, string $description = '')
45 {
46 $this->image = $image;
47 $this->title = $title;
48 $this->description = $description;
49 }
50
54 public function getTitle(): string
55 {
56 return $this->title;
57 }
58
62 public function getDescription(): string
63 {
64 return $this->description ?: $this->image->getAlt();
65 }
66
70 public function getComponent(): Image
71 {
72 return $this->image;
73 }
74}
__construct(Image $image, string $title, string $description='')
getTitle()
Get the title of this page, displayed as title in the lightbox modal.
getDescription()
Get the description of this page, displayed along with the media item.
getComponent()
Get the component representing the media item to be displayed in the modals content section,...
A lightbox Image page represents a page displaying a media element, such as image,...