mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 19:36:08 +01:00
Fixed root showing in multiple columns
This commit is contained in:
@@ -1455,6 +1455,7 @@ class AdminController extends AdminBaseController
|
|||||||
$children = null;
|
$children = null;
|
||||||
$sub_route = null;
|
$sub_route = null;
|
||||||
$extra = null;
|
$extra = null;
|
||||||
|
$root = false;
|
||||||
|
|
||||||
// Handle leaf_route
|
// Handle leaf_route
|
||||||
if ($leaf_route && $route != $leaf_route) {
|
if ($leaf_route && $route != $leaf_route) {
|
||||||
@@ -1471,6 +1472,7 @@ class AdminController extends AdminBaseController
|
|||||||
if (!$route) {
|
if (!$route) {
|
||||||
$is_page = false;
|
$is_page = false;
|
||||||
$route = $this->grav['locator']->findResource('page://', true);
|
$route = $this->grav['locator']->findResource('page://', true);
|
||||||
|
$root = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($is_page) {
|
if ($is_page) {
|
||||||
@@ -1500,10 +1502,7 @@ class AdminController extends AdminBaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($fileInfo->isDot()) {
|
if ($fileInfo->isDot()) {
|
||||||
if (!$initial) {
|
if ($root) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$payload = [
|
$payload = [
|
||||||
'name' => '<root>',
|
'name' => '<root>',
|
||||||
'value' => '',
|
'value' => '',
|
||||||
@@ -1514,6 +1513,9 @@ class AdminController extends AdminBaseController
|
|||||||
'modified' => $fileInfo->getMTime(),
|
'modified' => $fileInfo->getMTime(),
|
||||||
'size' => 0
|
'size' => 0
|
||||||
];
|
];
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$file_page = $page_instances[$fileInfo->getPathname()] ?? null;
|
$file_page = $page_instances[$fileInfo->getPathname()] ?? null;
|
||||||
$file_path = Utils::replaceFirstOccurrence(GRAV_ROOT, '', $fileInfo->getPathname());
|
$file_path = Utils::replaceFirstOccurrence(GRAV_ROOT, '', $fileInfo->getPathname());
|
||||||
|
|||||||
Reference in New Issue
Block a user