mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-12-20 23:40:46 +01:00
Fixes for broken parents field
This commit is contained in:
@@ -2437,8 +2437,8 @@ class AdminController extends AdminBaseController
|
|||||||
$file_path = Utils::replaceFirstOccurrence(GRAV_ROOT, '', $filePath);
|
$file_path = Utils::replaceFirstOccurrence(GRAV_ROOT, '', $filePath);
|
||||||
$type = $fileInfo->getType();
|
$type = $fileInfo->getType();
|
||||||
|
|
||||||
$child_path = $file_page ? GRAV_ROOT . $file_page->path() : $filePath;
|
$child_path = $file_page ? $file_page->path() : $filePath;
|
||||||
$has_children = Folder::hasChildren($child_path);
|
$count_children = Folder::countChildren($child_path);
|
||||||
|
|
||||||
$payload = [
|
$payload = [
|
||||||
'name' => $file_page ? $file_page->title() : $fileName,
|
'name' => $file_page ? $file_page->title() : $fileName,
|
||||||
@@ -2448,9 +2448,9 @@ class AdminController extends AdminBaseController
|
|||||||
'extension' => $type === 'dir' ? '' : $fileInfo->getExtension(),
|
'extension' => $type === 'dir' ? '' : $fileInfo->getExtension(),
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'modified' => $fileInfo->getMTime(),
|
'modified' => $fileInfo->getMTime(),
|
||||||
'size' => $fileInfo->getSize(),
|
'size' => $count_children,
|
||||||
'symlink' => false,
|
'symlink' => false,
|
||||||
'has-children' => $has_children
|
'has-children' => $count_children > 0
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user