v2.5.1: Admin theme refactor, Navigation plugin, user roles, guide restructure

- Reorganize admin into admin/theme/default/ (views + assets)
- Rename GuideNav to Navigation plugin (essential, protected)
- Plugin assets support (SCSS/CSS) loaded after theme CSS
- User roles: Admin, Content Manager, BI Manager, Site Admin
- Role-based access control (RBAC) for admin routes and sidebar
- Guide restructure: sub-topics in separate folders with sidebar nav
- Dynamic breadcrumb for homepage and subdirectories
- Fix theme path traversal (../../ -> ../) in admin.php
- Fix CodeMirror mode load order (xml -> css -> js -> htmlmixed -> php)
- Fix editor-toolbar.js null checks for plugin edit pages
- Layout select from theme.json with live frontmatter update
- Footer sticky at bottom of viewport (min-height: 100vh)
- Breadcrumb color fix (var(--nav-font) -> var(--header-bg))
- Remove language switcher from guide pages
- Update README.md and README.en.md
- Bump version to 2.5.1
This commit is contained in:
2026-08-10 15:36:29 +02:00
parent 7fc3847bbb
commit 3a55ea4db6
210 changed files with 11033 additions and 9140 deletions
@@ -0,0 +1,11 @@
# CMS Architectuur
```
codepress/
├── cms/core/ # Core engine
├── admin/ # Admin console
├── themes/ # Thema's
├── plugins/ # Plugins
├── content/ # Content
└── public/ # Web root
```
@@ -0,0 +1,34 @@
# Beveiliging
## XSS preventie
```php
// Altijd escapen
echo htmlspecialchars($userInput, ENT_QUOTES, 'UTF-8');
// In Twig (automatisch)
{{ userVariable }}
```
## CSRF tokens
```php
// Genereren
$csrf = $auth->getCsrfToken();
// Verifiëren
if (!$auth->verifyCsrf($_POST['csrf_token'])) {
die('Ongeldige CSRF token');
}
```
## Path traversal preventie
```php
// Gebruik realpath() en check prefix
$realPath = realpath($filePath);
$realContentDir = realpath($contentDir);
if (strpos($realPath, $realContentDir) !== 0) {
die('Ongeldig pad');
}
```
@@ -0,0 +1,32 @@
# Core Classes
## CodePressCMS.php
Hoofd CMS class in `cms/core/class/CodePressCMS.php`:
```php
$cms = new CodePressCMS();
$cms->init();
$cms->renderPage($pagePath);
```
## ThemeManager.php
Themabeheer in `cms/core/class/ThemeManager.php`:
```php
$themeManager = new ThemeManager($config);
$themeManager->getActiveTheme();
$themeManager->renderTwig($template, $data);
$themeManager->compileCss($force);
```
## PluginManager.php
Plugin systeem in `cms/core/class/PluginManager.php`:
```php
$pluginManager = new PluginManager();
$pluginManager->loadPlugins($enabledPlugins);
$pluginManager->executeHook($name, $params);
```
+23
View File
@@ -0,0 +1,23 @@
# Debugging
## Logging
```php
// Admin logging
adminLog($config, 'info', 'Bericht tekst');
// LogManager
LogManager::log(LogManager::EVENT_ADMIN, 'info', 'Bericht');
```
## Cache uitschakelen
In `config.json`:
```json
{
"cache": {
"enabled": false
}
}
```
@@ -0,0 +1,19 @@
# Performance
## OPcache inschakelen
In `php.ini`:
```ini
opcache.enable=1
opcache.memory_consumption=128
opcache.max_accelerated_files=10000
```
## SCSS caching
SCSS wordt gecompileerd met caching:
```php
$themeManager->compileCss(false); // Gebruik cache indien mogelijk
```
@@ -0,0 +1,43 @@
# Plugin Development
## Plugin structuur
```
plugins/MijnPlugin/
├── plugin.json # Plugin metadata
├── plugin.php # Plugin code
└── config.json # Optionele configuratie
```
## plugin.json
```json
{
"name": "Mijn Plugin",
"version": "1.0.0",
"author": "Jouw Naam",
"description": "Beschrijving"
}
```
## plugin.php voorbeeld
```php
<?php
/**
* Plugin: MijnPlugin
*/
echo '<div class="mijn-plugin">Hello World</div>';
```
## CMSAPI gebruiken
```php
<?php
require_once '../../cms/core/class/PluginManager.php';
$api = PluginManager::getAPI();
$config = $api->getConfig();
$content = $api->getContent();
```
+19
View File
@@ -0,0 +1,19 @@
# Routing
## Frontend routing
Via `cms/router.php` voor PHP dev server:
```php
// Schone URLs: /nl/pagina
// Query: ?page=pagina&lang=nl
```
## Admin routing
Via `public/admin.php`:
```php
// Routes: /admin/dashboard, /admin/content, etc.
// Query parameter: ?route=dashboard
```
+22
View File
@@ -0,0 +1,22 @@
# Testing
## Penetration tests
```bash
cd cli/test/pentest
./security-test.sh
```
## Accessibility tests
```bash
cd cli/test
./accessibility.sh
```
## Functionele tests
```bash
cd cli/test/functional
./content-tests.sh
```