ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
Sub.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types=1);
3 
4 /* Copyright (c) 2019 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
5 
7 
12 
16 class 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 }
__construct($label, array $items)
Definition: Sub.php:29
isInitiallyActive()
Is this initially active?
Definition: Sub.php:50
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
This describes a Menu Control with a label.
Definition: LabeledMenu.php:13
withInitiallyActive()
Configure this Submenu to be active when the menu is loaded.
Definition: Sub.php:40
This describes a Submenu, i.e.
Definition: Sub.php:14