New features: - ContentBackup class with ZIP backup/restore and git versioning - Admin backup & restore page (content-backup.twig) with git init/commit/log/restore - Plugin type system: system (blue) vs content (green) with visual badges - PluginAPIInterface + AdminPluginAPI for plugin architecture - Essential plugin flag (cannot edit/deactivate/delete) Improvements: - Consolidated enabled_plugins config (removed plugins.enabled) - Removed Analytics/Logging toggles from admin config page - Fixed Dashboard plugin Twig comments rendered as text - Updated 20 guide files (NL+EN): configuratie, plugins, plugin-development, core-classes, theme-json, layouts, scss-styling, admin-beheerder, nieuw-thema, architectuur - Improved accessibility test script (grep -E, min/max checks) Cleanup: - Removed unused classes: ARIAComponents, AccessibilityManager, ContentSecurityPolicy, etc. - Removed vendor packages: mustache/mustache, php-mqtt/client - Removed old templates: logs.twig, statistics.twig (now plugins) - Moved language files to language/ directory Tests: - Pentest: 30/30 passed, 0 vulnerabilities - WCAG 2.1 AA: 25/25 passed, 100% compliance
76 lines
2.5 KiB
PHP
76 lines
2.5 KiB
PHP
<?php
|
|
|
|
class HTMLBlock
|
|
{
|
|
private array $config;
|
|
private ?PluginAPIInterface $api = null;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->config = [
|
|
'title' => 'HTML Block Plugin',
|
|
'type' => 'content',
|
|
];
|
|
}
|
|
|
|
public function setAPI(PluginAPIInterface $api): void
|
|
{
|
|
$this->api = $api;
|
|
}
|
|
|
|
public function getSidebarContent(): string
|
|
{
|
|
$currentPage = $this->api ? $this->api->getCurrentPageTitle() : 'Onbekend';
|
|
$isHomepage = $this->api ? $this->api->isHomepage() : false;
|
|
$currentLang = $this->api ? $this->api->getCurrentLanguage() : 'nl';
|
|
|
|
$content = '
|
|
<p class="mb-2"><strong>Huidige pagina:</strong> ' . htmlspecialchars($currentPage) . '</p>
|
|
<p class="mb-2"><strong>Taal:</strong> ' . strtoupper($currentLang) . '</p>
|
|
<p class="mb-3"><strong>Homepage:</strong> ' . ($isHomepage ? 'Ja' : 'Nee') . '</p>';
|
|
|
|
// Add page-specific content
|
|
if ($this->api) {
|
|
$fileInfo = $this->api->getCurrentPageFileInfo();
|
|
if ($fileInfo) {
|
|
$content .= '
|
|
<div class="alert alert-info mb-3">
|
|
<small>
|
|
<strong>Bestandsinfo:</strong><br>
|
|
Aangemaakt: ' . htmlspecialchars($fileInfo['created']) . '<br>
|
|
Gewijzigd: ' . htmlspecialchars($fileInfo['modified']) . '
|
|
</small>
|
|
</div>';
|
|
}
|
|
|
|
// Add quick navigation
|
|
$menu = $this->api->getMenu();
|
|
if (!empty($menu)) {
|
|
$content .= '
|
|
<h6>Quick Navigation</h6>
|
|
<ul class="list-unstyled mb-3">';
|
|
|
|
foreach ($menu as $item) {
|
|
if ($item['type'] === 'file') {
|
|
$url = $this->api->createUrl($item['path']);
|
|
$content .= '<li><a href="' . htmlspecialchars($url) . '" class="text-decoration-none">📄 ' . htmlspecialchars($item['title']) . '</a></li>';
|
|
}
|
|
}
|
|
|
|
$content .= '</ul>';
|
|
}
|
|
}
|
|
|
|
return $content;
|
|
}
|
|
|
|
public function getConfig(): array
|
|
{
|
|
return $this->config;
|
|
}
|
|
|
|
public function setConfig(array $config): void
|
|
{
|
|
$this->config = array_merge($this->config, $config);
|
|
}
|
|
} |