mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 11:48:49 +02:00
Show icons in the root node in sidebar treeviews.
This commit is contained in:
parent
90da7d71b9
commit
18f41e14e6
4 changed files with 51 additions and 4 deletions
|
@ -60,6 +60,8 @@ final class TreeViewNode implements JsonSerializable
|
|||
|
||||
private $id;
|
||||
|
||||
private $icon;
|
||||
|
||||
/**
|
||||
* Creates a new TreeView node with the given parameters.
|
||||
*
|
||||
|
@ -233,6 +235,24 @@ final class TreeViewNode implements JsonSerializable
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getIcon(): ?string
|
||||
{
|
||||
return $this->icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $icon
|
||||
*/
|
||||
public function setIcon(?string $icon): void
|
||||
{
|
||||
$this->icon = $icon;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
$ret = [
|
||||
|
@ -259,6 +279,10 @@ final class TreeViewNode implements JsonSerializable
|
|||
$ret['selectable'] = false;
|
||||
}
|
||||
|
||||
if ($this->icon != null) {
|
||||
$ret['icon'] = $this->icon;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue