Show a treeview in the admin menus, to select between the different elements.

This commit is contained in:
Jan Böhmer 2019-04-05 17:49:02 +02:00
parent 928b574d8c
commit 650b388a1d
16 changed files with 269 additions and 25 deletions

View file

@ -40,6 +40,8 @@ class TreeViewNode
protected $href;
protected $nodes;
protected $state;
/**
* Creates a new TreeView node with the given parameters.
* @param string $text The text that is shown in the node. (e.g. the name of the node)
@ -53,6 +55,8 @@ class TreeViewNode
$this->text = $text;
$this->href = $href;
$this->nodes = $nodes;
$this->state = new TreeViewNodeState();
}
/**
@ -115,4 +119,29 @@ class TreeViewNode
return $this;
}
public function getState() : TreeViewNodeState
{
return $this->state;
}
public function setState(TreeViewNodeState $state) : self
{
$this->state = $state;
return $this;
}
public function setDisabled(?bool $disabled) : self
{
$this->state->setDisabled($disabled);
return $this;
}
public function setSelected(?bool $selected) : self
{
$this->state->setSelected($selected);
return $this;
}
}