ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Bulky.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
27class 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 {
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",
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}
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
__toString()
Definition: URI.php:337
This describes a symbol.
Definition: Symbol.php:30
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.