ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
10 use \ILIAS\UI\Component\Modal\LightboxTextPage as ILightboxTextPage;
11 
17 class LightboxTextPage implements LightboxPage, ILightboxTextPage
18 {
19  use ComponentHelper;
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 }
trait ComponentHelper
Provides common functionality for component implementations.
getTitle()
Get the title of this page, displayed as title in the lightbox modal.string
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
getComponent()
Get the component representing the media item to be displayed in the modals content section...