Use a more reliable way to detect the current page, fixes #420
Dieser Commit ist enthalten in:
@ -7,6 +7,9 @@ class Root extends Directory
|
||||
/** @var Config */
|
||||
protected $config;
|
||||
|
||||
/** @var Entry */
|
||||
protected $activeNode;
|
||||
|
||||
/**
|
||||
* The root doesn't have a parent
|
||||
*/
|
||||
@ -33,4 +36,30 @@ class Root extends Directory
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
public function isHotPath(Entry $node = null) {
|
||||
if ($node == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($this->activeNode == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($node == $this->activeNode) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach ($this->activeNode->getParents() as $parent) {
|
||||
if ($node == $parent) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function setActiveNode(Entry $node) {
|
||||
$this->activeNode = $node;
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren