Plugin internationalisatie: plugins hebben eigen language/ mappen. Systeem plugins volgen admin taal (admin.php), content plugins volgen content taal (site.php). Fallback chain: geselecteerd -> plugin default_language -> CMS default. PluginManager/AdminPluginAPI/CMSAPI uitgebreid met getPluginTranslations()/t(). plugin.json settings ondersteunen label_key/help_key/option_label_key. Plugin uniformiteit: alle 6 plugins hebben uniforme structuur (README.md, assets/.gitkeep, language/nl|en/). plugins/README.md herschreven. guide plugin-development.md (NL+EN) volledig herschreven. Plugin editor vernieuwd: geneste bestandsbrowser zijbalk, nieuw bestand aanmaken, uploaden naar assets/, verwijderen en verplaatsen. Nieuwe routes: plugins-file-upload, plugins-file-delete, plugins-file-move. Path-traversal bescherming + protected plugins geblokkeerd. Media invoegen in editor: nieuw /admin/media-list JSON endpoint + herbruikbare _media-modal.twig include. Plugin-context scant assets/ map. editor-toolbar.js modeMap uitgebreid voor css/scss/js/json. Plugin overzicht knoppen: alleen iconen met title/aria-label. Tests: pentest 30/30, WCAG 2.1 AA 25/25.
82 lines
5.3 KiB
Twig
82 lines
5.3 KiB
Twig
{% extends "layouts/admin.twig" %}
|
|
|
|
{% block title %}{{ ta.plugins|default('Plugins') }} - {{ ta.admin_title|default('CodePress Admin') }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
|
<h2><i class="bi bi-plug"></i> {{ ta.plugins|default('Plugins') }}</h2>
|
|
<a href="/admin/plugins-new" class="btn btn-primary btn-sm">
|
|
<i class="bi bi-plus-lg"></i> {{ ta.new_plugin|default('Nieuwe plugin') }}
|
|
</a>
|
|
</div>
|
|
|
|
<div class="row g-4">
|
|
{% for plugin in plugins %}
|
|
<div class="col-md-6 col-lg-4">
|
|
<div class="card shadow-sm h-100 {% if plugin.type == 'system' %}border-primary{% elseif plugin.type == 'content' %}border-success{% endif %}">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<span class="fw-bold">
|
|
{% if plugin.type == 'system' %}<i class="bi bi-gear-fill text-primary"></i>
|
|
{% elseif plugin.type == 'content' %}<i class="bi bi-puzzle-fill text-success"></i>
|
|
{% else %}<i class="bi bi-plug-fill"></i>{% endif %}
|
|
{{ plugin.name|default(plugin.name) }}
|
|
</span>
|
|
<div class="d-flex gap-1">
|
|
{% if plugin.type == 'system' %}
|
|
<span class="badge bg-primary">{{ ta.plugin_type_system|default('Systeem') }}</span>
|
|
{% elseif plugin.type == 'content' %}
|
|
<span class="badge bg-success">{{ ta.plugin_type_content|default('Content') }}</span>
|
|
{% endif %}
|
|
<span class="badge bg-{{ plugin.enabled ? 'success' : 'secondary' }}">{{ plugin.enabled ? ta.active|default('Actief') : ta.inactive|default('Inactief') }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="card-text text-muted mb-2">{{ plugin.description|default(ta.no_description|default('Geen beschrijving')) }}</p>
|
|
<p class="small text-muted mb-3">
|
|
{% if plugin.version %}<span class="badge bg-info">v{{ plugin.version }}</span>{% endif %}
|
|
{% if plugin.author %}<span class="badge bg-secondary">{{ plugin.author }}</span>{% endif %}
|
|
</p>
|
|
</div>
|
|
<div class="card-footer bg-white">
|
|
<div class="btn-group w-100" role="group" aria-label="{{ ta.plugin_actions|default('Plugin acties') }}">
|
|
{% if plugin.protected or plugin.essential %}
|
|
<span class="btn btn-sm btn-outline-secondary disabled" title="{{ ta.essential_title|default('Essentiële plugin - kan niet worden bewerkt, gedeactiveerd of verwijderd') }}" aria-label="{{ ta.essential|default('Essentieel') }}">
|
|
<i class="bi bi-shield-check"></i>
|
|
</span>
|
|
{% else %}
|
|
<a href="/admin/plugins-edit?plugin={{ plugin.name|url_encode }}" class="btn btn-sm btn-outline-primary" title="{{ ta.edit|default('Bewerken') }}" aria-label="{{ ta.edit|default('Bewerken') }}">
|
|
<i class="bi bi-pencil"></i>
|
|
</a>
|
|
{% if plugin.hasConfig %}
|
|
<a href="/admin/plugins-config?plugin={{ plugin.name|url_encode }}" class="btn btn-sm btn-outline-info" title="{{ ta.config|default('Configuratie') }}" aria-label="{{ ta.config|default('Configuratie') }}">
|
|
<i class="bi bi-gear"></i>
|
|
</a>
|
|
{% endif %}
|
|
<form method="POST" action="/admin/plugins-toggle" class="d-inline">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
<input type="hidden" name="plugin" value="{{ plugin.name }}">
|
|
<button type="submit" class="btn btn-sm btn-{{ plugin.enabled ? 'outline-warning' : 'outline-success' }}" title="{{ plugin.enabled ? ta.deactivate|default('Deactiveren') : ta.activate|default('Activeren') }}" aria-label="{{ plugin.enabled ? ta.deactivate|default('Deactiveren') : ta.activate|default('Activeren') }}">
|
|
<i class="bi bi-{{ plugin.enabled ? 'pause' : 'play' }}"></i>
|
|
</button>
|
|
</form>
|
|
<form method="POST" action="/admin/plugins-delete" class="d-inline" onsubmit="return confirm('{{ ta.confirm_delete_plugin|default('Weet je zeker dat je deze plugin wilt verwijderen?') }}')">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
|
|
<input type="hidden" name="plugin" value="{{ plugin.name }}">
|
|
<button type="submit" class="btn btn-sm btn-outline-danger" title="{{ ta.delete|default('Verwijderen') }}" aria-label="{{ ta.delete|default('Verwijderen') }}">
|
|
<i class="bi bi-trash"></i>
|
|
</button>
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<div class="col-12">
|
|
<div class="alert alert-info">
|
|
<i class="bi bi-info-circle"></i> {{ ta.no_plugins|default('Geen plugins gevonden. Maak een nieuwe plugin aan om te beginnen.') }}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endblock %} |