mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 19:58:53 +02:00
Show a treeview in the admin menus, to select between the different elements.
This commit is contained in:
parent
928b574d8c
commit
650b388a1d
16 changed files with 269 additions and 25 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue