2026-01-13 16:35:52 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
return [
|
2026-03-10 08:21:06 +01:00
|
|
|
'debug' => true,
|
|
|
|
|
'languages' => true,
|
2026-01-13 16:35:52 +01:00
|
|
|
|
|
|
|
|
'panel' => [
|
2026-03-10 08:21:06 +01:00
|
|
|
'css' => 'assets/css/custom-panel.css',
|
2026-01-16 14:29:38 +01:00
|
|
|
'theme' => 'dark',
|
2026-03-10 08:21:06 +01:00
|
|
|
'menu' => require __DIR__ . '/menu.php',
|
2026-01-13 16:35:52 +01:00
|
|
|
],
|
|
|
|
|
|
2026-03-10 08:21:06 +01:00
|
|
|
'thumbs' => require __DIR__ . '/thumbs.php',
|
2026-03-18 17:37:22 +01:00
|
|
|
|
|
|
|
|
'routes' => [
|
|
|
|
|
[
|
|
|
|
|
'pattern' => ['(:any)/(:any)/download', 'en/(:any)/(:any)/download'],
|
|
|
|
|
'method' => 'POST',
|
|
|
|
|
'action' => function (string $parent, string $slug) {
|
|
|
|
|
$page = kirby()->page($parent . '/' . $slug);
|
|
|
|
|
if (!$page || $page->intendedTemplate()->name() !== 'white-paper') {
|
|
|
|
|
http_response_code(404);
|
|
|
|
|
header('Content-Type: application/json');
|
|
|
|
|
echo json_encode(['error' => 'Not found']);
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
// TODO: store/email form data ($kirby->request()->body())
|
|
|
|
|
header('Content-Type: application/json');
|
|
|
|
|
echo json_encode([
|
|
|
|
|
'success' => true,
|
|
|
|
|
'fileUrl' => $page->downloadFile()->toFile()?->url(),
|
|
|
|
|
]);
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
],
|
2026-03-10 08:21:06 +01:00
|
|
|
];
|