ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
Sub.php
Go to the documentation of this file.
1<?php
2declare(strict_types=1);
3
4/* Copyright (c) 2019 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
5
7
12
16class Sub extends LabeledMenu implements IMenu\Sub
17{
19
23 protected $active = false;
24
29 public function __construct($label, array $items)
30 {
31 $this->checkLabelParameter($label);
32 $this->checkItemParameter($items);
33 $this->label = $label;
34 $this->items = $items;
35 }
36
40 public function withInitiallyActive() : IMenu\Sub
41 {
42 $clone = clone $this;
43 $clone->active = true;
44 return $clone;
45 }
46
50 public function isInitiallyActive() : bool
51 {
52 return $this->active;
53 }
54}
An exception for terminatinating execution or to throw for unit testing.
__construct($label, array $items)
Definition: Sub.php:29
withInitiallyActive()
Configure this Submenu to be active when the menu is loaded.
Definition: Sub.php:40
isInitiallyActive()
Is this initially active?
Definition: Sub.php:50
This describes a Menu Control with a label.
Definition: LabeledMenu.php:14
This describes a Submenu, i.e.
Definition: Sub.php:15
This describes how a glyph could be modified during construction of UI.
Definition: Glyph.php:14
This describes how a icon could be modified during construction of UI.
Definition: Icon.php:10
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.