ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
LightboxImagePage.php
Go to the documentation of this file.
1 <?php
2 
4 
8 
18 {
19  use ComponentHelper;
20 
24  protected $image;
28  protected $title;
32  protected $description;
33 
34 
40  public function __construct(Image $image, $title, $description = '')
41  {
42  $this->checkArgInstanceOf('image', $image, Image::class);
43  $this->checkStringArg('title', $title);
44  $this->checkStringArg('description', $description);
45  $this->image = $image;
46  $this->title = $title;
47  $this->description = $description;
48  }
49 
50 
54  public function getTitle()
55  {
56  return $this->title;
57  }
58 
59 
63  public function getDescription()
64  {
65  return $this->description ? $this->description : $this->image->getAlt();
66  }
67 
68 
72  public function getComponent()
73  {
74  return $this->image;
75  }
76 }
checkArgInstanceOf($which, $value, $class)
Throw an InvalidArgumentException if $value is not an instance of $class.
trait ComponentHelper
Provides common functionality for component implementations.
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
getTitle()
Get the title of this page, displayed as title in the lightbox modal.string
Generate an image
getDescription()
Get the description of this page, displayed along with the media item.string
__construct(Image $image, $title, $description='')
getComponent()
Get the component representing the media item to be displayed in the modals content section...