Fixed root showing in multiple columns

This commit is contained in:
Andy Miller
2019-06-06 16:38:03 -06:00
parent 9b606642be
commit ee4fd383c3

View File

@@ -1455,6 +1455,7 @@ class AdminController extends AdminBaseController
$children = null;
$sub_route = null;
$extra = null;
$root = false;
// Handle leaf_route
if ($leaf_route && $route != $leaf_route) {
@@ -1471,6 +1472,7 @@ class AdminController extends AdminBaseController
if (!$route) {
$is_page = false;
$route = $this->grav['locator']->findResource('page://', true);
$root = true;
}
if ($is_page) {
@@ -1500,20 +1502,20 @@ class AdminController extends AdminBaseController
}
if ($fileInfo->isDot()) {
if (!$initial) {
if ($root) {
$payload = [
'name' => '<root>',
'value' => '',
'item-key' => '',
'filename' => '.',
'extension' => '',
'type' => 'root',
'modified' => $fileInfo->getMTime(),
'size' => 0
];
} else {
continue;
}
$payload = [
'name' => '<root>',
'value' => '',
'item-key' => '',
'filename' => '.',
'extension' => '',
'type' => 'root',
'modified' => $fileInfo->getMTime(),
'size' => 0
];
} else {
$file_page = $page_instances[$fileInfo->getPathname()] ?? null;
$file_path = Utils::replaceFirstOccurrence(GRAV_ROOT, '', $fileInfo->getPathname());