ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
9
14class Panel implements C\Panel\Panel
15{
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}
An exception for terminatinating execution or to throw for unit testing.
withActions(\ILIAS\UI\Component\Dropdown\Standard $actions)
Definition: Panel.php:67
A component is the most general form of an entity in the UI.
Definition: Component.php:14
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
toArray($value)
Wrap the given value in an array if it is no array.
checkArgListElements($which, array &$values, $classes)
Check every element of the list if it is an instance of one of the given classes.
trait ComponentHelper
Provides common functionality for component implementations.
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.