mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
parent
e6a6ae996a
commit
206168672b
@ -325,6 +325,30 @@ class NavigationItem implements IteratorAggregate
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return this item's name escaped with only ASCII chars and/or digits
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function getEscapedName()
|
||||||
|
{
|
||||||
|
return preg_replace('~[^a-zA-Z0-9]~', '_', $this->getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a unique version of this item's name
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getUniqueName()
|
||||||
|
{
|
||||||
|
if ($this->getParent() === null) {
|
||||||
|
return 'navigation-' . $this->getEscapedName();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->getParent()->getEscapedName() . '-' . $this->getEscapedName();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return this item's name
|
* Return this item's name
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user