Update all guides (NL + EN) for CodePress 2.5.2 features

- Admin guide: RBAC roles, role-based dashboard, plugin types (content/system)
- CodePress developer guide: plugin types, admin plugin API, SCSS compilation, asset serving
- Theme developer guide: SCSS sole CSS source, css_compiled read-only, guide layout
- Content manager guide: layout selection from theme.json, plugin order in frontmatter
- Both NL and EN updated with identical structure
- 35 files updated
This commit is contained in:
2026-08-12 12:05:53 +02:00
parent a9e3b023de
commit 9a5ab351ba
35 changed files with 1493 additions and 255 deletions
+49 -7
View File
@@ -2,18 +2,60 @@
## Frontend routing
Via `cms/router.php` voor PHP dev server:
Frontend routing verloopt via `cms/router.php` (PHP dev server) of `.htaccess` (Apache). Beide zorgen voor clean URLs.
```php
// Schone URLs: /nl/pagina
// Query: ?page=pagina&lang=nl
### PHP dev server
Start de server met:
```bash
php -S localhost:8080 cms/router.php
```
`cms/router.php` serveert:
- Schone URLs: `/nl/pagina``public/index.php?page=pagina&lang=nl`
- `themes/` assets
- `admin/assets/` assets
- `plugins/` assets
### Apache (live server)
`public/.htaccess` herschrijft URLs naar `public/index.php`. Asset URLs (`/themes/`, `/admin/assets/`, `/plugins/`) worden doorgestuurd naar `public/asset.php`.
`public/asset.php` serveert bestanden vanuit de juiste mappen met het juiste MIME-type:
- `/themes/<name>/assets/...``themes/<name>/assets/...`
- `/admin/assets/...``admin/theme/default/assets/...`
- `/plugins/<name>/assets/...``plugins/<name>/assets/...`
## Admin routing
Via `public/admin.php`:
Admin routing verloopt via `public/admin.php` met clean URLs:
```
/admin/dashboard → ?route=dashboard
/admin/content → ?route=content
/admin/plugins → ?route=plugins
```
`cms/router.php` of `.htaccess` zet `/admin/<route>` om naar `?route=<route>`.
### Route access control (RBAC)
Elke route wordt gecontroleerd via `AdminAuth::hasPermission($route)`:
- `admin` rol heeft wildcard `*` toegang
- Andere rollen hebben een expliciete lijst van toegestane routes in `ROLE_PERMISSIONS`
- Onbevoegde routes geven een **403 error**
## Plugin admin routing
Systeem plugins kunnen admin routes registreren. Deze worden afgehandeld door `PluginManager::handleAdminRoute($route)`:
1. Systeem plugin registreert routes via `getAdminRoutes()`
2. `PluginManager::getAdminMenuItems()` verzamelt admin menu items via `getAdminMenu()`
3. Bij een admin request zoekt `PluginManager::handleAdminRoute($route)` een plugin die de route afhandelt
4. De plugin methode `handleAdminRoute($route)` rendert de pagina inhoud
```php
// Routes: /admin/dashboard, /admin/content, etc.
// Query parameter: ?route=dashboard
// PluginManager roept deze aan voor /admin/mijn-systeem
$plugin->handleAdminRoute('mijn-systeem');
```