Remove media menu option and verify route handling

This commit is contained in:
2026-06-23 16:20:29 +02:00
parent f5d95fd344
commit d97c67c6a9
60 changed files with 115 additions and 0 deletions

30
cms/core/config.php Normal file
View File

@@ -0,0 +1,30 @@
<?php
// Simple configuration loader
$configJsonPath = __DIR__ . '/../../config.json';
if (file_exists($configJsonPath)) {
$jsonContent = file_get_contents($configJsonPath);
$config = json_decode($jsonContent, true);
if (json_last_error() === JSON_ERROR_NONE && is_array($config)) {
// Convert relative paths to absolute
$projectRoot = __DIR__ . '/../../';
if (isset($config['content_dir']) && strpos($config['content_dir'], '/') !== 0) {
$config['content_dir'] = $projectRoot . $config['content_dir'];
}
if (isset($config['templates_dir']) && strpos($config['templates_dir'], '/') !== 0) {
$config['templates_dir'] = $projectRoot . $config['templates_dir'];
}
return $config;
}
}
// Fallback to minimal config
return [
'site_title' => 'CodePress',
'content_dir' => __DIR__ . '/../../content',
'templates_dir' => __DIR__ . '/../templates',
'default_page' => 'auto'
];