mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 11:26:04 +01:00
Implemented filters in folderlisting task for parents field
This commit is contained in:
@@ -1443,10 +1443,10 @@ class AdminController extends AdminBaseController
|
|||||||
$is_page = $data['page'] ?? true;
|
$is_page = $data['page'] ?? true;
|
||||||
$route = $data['route'] ?? null;
|
$route = $data['route'] ?? null;
|
||||||
$leaf_route = $data['leaf_route'] ?? null;
|
$leaf_route = $data['leaf_route'] ?? null;
|
||||||
$filters = isset($data['filters']) ? $default_filters + json_decode($data['filters']) : $default_filters;
|
|
||||||
$sortby = $data['sortby'] ?? 'filename';
|
$sortby = $data['sortby'] ?? 'filename';
|
||||||
$order = $data['order'] ?? SORT_ASC;
|
$order = $data['order'] ?? SORT_ASC;
|
||||||
$initial = $data['initial'] ?? null;
|
$initial = $data['initial'] ?? null;
|
||||||
|
$filters = isset($data['filters']) ? $default_filters + json_decode($data['filters']) : $default_filters;
|
||||||
$filter_type = (array) $filters['type'];
|
$filter_type = (array) $filters['type'];
|
||||||
|
|
||||||
$status = 'error';
|
$status = 'error';
|
||||||
@@ -1490,6 +1490,19 @@ class AdminController extends AdminBaseController
|
|||||||
$path = file_exists($try_path) ? $try_path : null;
|
$path = file_exists($try_path) ? $try_path : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$blueprintsData = $this->admin->page(true);
|
||||||
|
|
||||||
|
if (null !== $blueprintsData) {
|
||||||
|
if (method_exists($blueprintsData, 'blueprints')) {
|
||||||
|
$settings = $blueprintsData->blueprints()->schema()->getProperty($data['field']);
|
||||||
|
} elseif (method_exists($blueprintsData, 'getBlueprint')) {
|
||||||
|
$settings = $blueprintsData->getBlueprint()->schema()->getProperty($data['field']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$filters = array_merge([], $filters, ($settings['filters'] ?? []));
|
||||||
|
$filter_type = $filters['type'] ?? $filter_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($path) {
|
if ($path) {
|
||||||
/** @var \SplFileInfo $fileInfo */
|
/** @var \SplFileInfo $fileInfo */
|
||||||
|
|||||||
Reference in New Issue
Block a user