ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Mode.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2016 Jesús López <lopez@leifos.de> Extended GPL, see docs/LICENSE */
4
6
9
10class Mode implements C\ViewControl\Mode
11{
13
18
22 protected $aria_label;
23
27 protected $active;
28
29 public function __construct($labelled_actions, $aria_label)
30 {
31 $this->labeled_actions = $this->toArray($labelled_actions);
32 $this->checkStringArg("string", $aria_label);
33 $this->aria_label = $aria_label;
34 }
35
36 public function withActive($label)
37 {
38 $this->checkStringArg("label", $label);
39 $clone = clone $this;
40 $clone->active = $label;
41 return $clone;
42 }
43
44 public function getActive()
45 {
46 return $this->active;
47 }
48
49 public function getLabelledActions()
50 {
52 }
53
54 public function getAriaLabel()
55 {
56 return $this->aria_label;
57 }
58}
An exception for terminatinating execution or to throw for unit testing.
__construct($labelled_actions, $aria_label)
Definition: Mode.php:29
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.
trait ComponentHelper
Provides common functionality for component implementations.