ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
Bulky.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
23 use ILIAS\UI\Component as C;
25 use ILIAS\Data\URI;
26 
27 class Bulky extends Link implements C\Link\Bulky
28 {
30 
31  // allowed ARIA roles
32  public const MENUITEM = 'menuitem';
33 
34  protected string $label;
35  protected ?string $aria_role = null;
36  protected C\Symbol\Symbol $symbol;
37 
41  protected static array $allowed_aria_roles = array(
42  self::MENUITEM
43  );
44 
45  public function __construct(C\Symbol\Symbol $symbol, string $label, URI $target)
46  {
47  parent::__construct($target->__toString());
48  $this->label = $label;
49  $this->symbol = $symbol;
50  }
51 
55  public function getLabel(): string
56  {
57  return $this->label;
58  }
59 
63  public function getSymbol(): C\Symbol\Symbol
64  {
65  return $this->symbol;
66  }
67 
71  public function withAriaRole(string $aria_role): C\Link\Bulky
72  {
73  $this->checkArgIsElement(
74  "role",
75  $aria_role,
76  self::$allowed_aria_roles,
77  implode('/', self::$allowed_aria_roles)
78  );
79  $clone = clone $this;
80  $clone->aria_role = $aria_role;
81  return $clone;
82  }
83 
87  public function getAriaRole(): ?string
88  {
89  return $this->aria_role;
90  }
91 }
This describes a symbol.
Definition: Symbol.php:29
__toString()
Definition: URI.php:333
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
The scope of this class is split ilias-conform URI&#39;s into components.
Definition: URI.php:34
__construct(Container $dic, ilPlugin $plugin)