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.
33 lines
1.1 KiB
PHP
33 lines
1.1 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Interface for plugin API objects.
|
|
* Both CMSAPI (front-end) and AdminPluginAPI (admin) implement this.
|
|
*/
|
|
interface PluginAPIInterface
|
|
{
|
|
public function getConfig(string $key, $default = null);
|
|
|
|
/**
|
|
* Get the translations for a plugin in the current context.
|
|
*
|
|
* System plugins resolve against the admin language; content plugins
|
|
* against the current content language. The implementation handles the
|
|
* fallback to the plugin's default_language.
|
|
*
|
|
* @param string $pluginName Plugin directory name
|
|
* @param string|null $lang Override language (optional)
|
|
* @return array Translations [key => value]
|
|
*/
|
|
public function getPluginTranslations(string $pluginName, ?string $lang = null): array;
|
|
|
|
/**
|
|
* Translate a single key for a plugin in the current context.
|
|
*
|
|
* @param string $key Translation key
|
|
* @param string $pluginName Plugin directory name
|
|
* @param string|null $lang Override language (optional)
|
|
* @return string Translated string, or $key if not found
|
|
*/
|
|
public function t(string $key, string $pluginName, ?string $lang = null): string;
|
|
} |