ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
Custom.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 2017 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3 
5 
6 use ILIAS\UI\Component as C;
8 
9 class Custom extends Icon implements C\Symbol\Icon\Custom
10 {
11 
15  private $icon_path;
16 
17 
18  public function __construct(string $icon_path, string $label, string $size, bool $is_disabled)
19  {
20  $this->checkArgIsElement(
21  "size",
22  $size,
23  self::$possible_sizes,
24  implode('/', self::$possible_sizes)
25  );
26  $this->name = 'custom';
27  $this->icon_path = $icon_path;
28  $this->label = $label;
29  $this->size = $size;
30  $this->is_disabled = $is_disabled;
31  }
32 
36  public function getIconPath()
37  {
38  return $this->icon_path;
39  }
40 }
checkArgIsElement($which, $value, $array, $name)
Throw an InvalidArgumentException if $value is not an element of array.
__construct(string $icon_path, string $label, string $size, bool $is_disabled)
Definition: Custom.php:18
trait ComponentHelper
Provides common functionality for component implementations.