Umbau custom blocks
This commit is contained in:
@@ -3005,6 +3005,9 @@ class ApiKernel
|
||||
case 'account.fonts.list':
|
||||
$this->handleAccountFontsList();
|
||||
break;
|
||||
case 'blocks_custom.list':
|
||||
$this->handleBlocksCustomList();
|
||||
break;
|
||||
case 'debug.logs.list':
|
||||
$this->handleDebugLogsList();
|
||||
break;
|
||||
@@ -3090,6 +3093,24 @@ class ApiKernel
|
||||
}
|
||||
}
|
||||
|
||||
private function handleBlocksCustomList(): void
|
||||
{
|
||||
$this->requireAuth();
|
||||
$baseDir = realpath(__DIR__ . '/../public/assets/js/bridge/blocks-custom/elements');
|
||||
if (!$baseDir || !is_dir($baseDir)) {
|
||||
$this->respond(['ok' => true, 'files' => []]);
|
||||
return;
|
||||
}
|
||||
$files = glob($baseDir . '/*.js') ?: [];
|
||||
$out = [];
|
||||
foreach ($files as $file) {
|
||||
$name = basename($file);
|
||||
if ($name && $name[0] !== '.') $out[] = $name;
|
||||
}
|
||||
sort($out, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
$this->respond(['ok' => true, 'files' => $out]);
|
||||
}
|
||||
|
||||
private function lookupTableName(string $key, string $default): string
|
||||
{
|
||||
$tables = $this->conf['tables'] ?? [];
|
||||
|
||||
Reference in New Issue
Block a user