ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
LightboxImagePage.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
26 use ILIAS\UI\Component\Modal\LightboxImagePage as ILightboxImagePage;
27 
36 class 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 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Factory.php:21
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.
A lightbox Image page represents a page displaying a media element, such as image, video.
__construct(Image $image, string $title, string $description='')
getComponent()
Get the component representing the media item to be displayed in the modals content section...