ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
Panel.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 2016 Timon Amstutz <timon.amstutz@ilub.unibe.ch> Extended GPL, see docs/LICENSE */
4 
6 
7 use ILIAS\UI\Component as C;
9 
14 class Panel implements C\Panel\Panel
15 {
16  use ComponentHelper;
17 
21  protected $title;
22 
26  private $content;
27 
31  protected $actions = null;
32 
37  public function __construct($title, $content)
38  {
39  $this->checkStringArg("title", $title);
40  $content = $this->toArray($content);
41  $types = [C\Component::class];
42  $this->checkArgListElements("content", $content, $types);
43 
44  $this->title = $title;
45  $this->content = $content;
46  }
47 
51  public function getTitle()
52  {
53  return $this->title;
54  }
55 
59  public function getContent()
60  {
61  return $this->content;
62  }
63 
67  public function withActions(\ILIAS\UI\Component\Dropdown\Standard $actions)
68  {
69  $clone = clone $this;
70  $clone->actions = $actions;
71  return $clone;
72  }
73 
77  public function getActions()
78  {
79  return $this->actions;
80  }
81 }
Class Factory.
Class BaseForm.
trait ComponentHelper
Provides common functionality for component implementations.
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
checkArgListElements($which, array &$values, &$classes)
Check every element of the list if it is an instance of one of the given classes. ...
withActions(\ILIAS\UI\Component\Dropdown\Standard $actions)
Definition: Panel.php:67
toArray($value)
Wrap the given value in an array if it is no array.