ILIAS  release_7 Revision v7.30-3-g800a261c036
LightboxTextPage.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
5
10use \ILIAS\UI\Component\Modal\LightboxTextPage as ILightboxTextPage;
11
17class LightboxTextPage implements LightboxPage, ILightboxTextPage
18{
20
22 protected $text = '';
23
25 protected $title = '';
26
31 public function __construct(string $text, string $title)
32 {
33 $this->checkStringArg('text', $text);
34 $this->checkStringArg('title', $title);
35 $this->text = $text;
36 $this->title = $title;
37 }
38
39
43 public function getTitle()
44 {
45 return $this->title;
46 }
47
51 public function getComponent()
52 {
53 return new Legacy($this->text, new SignalGenerator());
54 }
55}
An exception for terminatinating execution or to throw for unit testing.
getTitle()
Get the title of this page, displayed as title in the lightbox modal.string
getComponent()
Get the component representing the media item to be displayed in the modals content section,...
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
trait ComponentHelper
Provides common functionality for component implementations.