ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Bulky.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
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
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(Container $dic, ilPlugin $plugin)