- Bug: dashboard toonde 0 content (AdminPluginAPI::getContentDir() gaf relatief pad terug zonder normalisatie) - Dynamische pad-resolutie: PluginAPIInterface uitgebreid met getProjectRoot/getContentDir/getPluginsDir/getVersionInfo; CMSAPI en AdminPluginAPI implementeren deze universeel - public/index.php media-serving gebruikt $config['content_dir'] i.p.v. hardcoded /content - Navigation en Logs plugins halen paden via de API i.p.v. hardcoded dirname(__DIR__) - WordPress-stijl docblocks toegevoegd voor alle classes, methods, properties en functies (~450 docblocks, @since 2.6.5) - Security: hardcoded plaintext-wachtwoord 'admin' verwijderd uit AdminAuth.php; bij eerste installatie wordt een cryptografisch veilig wachtwoord gegenereerd (random_bytes, 16 tekens) en eenmalig op het inlogscherm getoond - Security: git-geschiedenis schoongemaakt (admin.json, admin.json.example, admin-console/config/admin.json verwijderd uit alle commits; filter-branch over alle branches + tags, gc --prune --aggressive) - README.md, README.en.md, AGENTS.md bijgewerkt - Test-scripts bijgewerkt naar clean-URL structuur + actuele ARIA-waarden - Versie verhoogd naar 2.6.5 - Tests: pentest 29/29, WCAG 25/25, functioneel 16/16, enhanced 25/25
89 lines
2.7 KiB
PHP
89 lines
2.7 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Interface voor plugin-API-objecten.
|
|
*
|
|
* Zowel CMSAPI (front-end) als AdminPluginAPI (admin) implementeren deze interface.
|
|
*
|
|
* @since 2.6.5
|
|
*/
|
|
interface PluginAPIInterface
|
|
{
|
|
/**
|
|
* Haal een configuratiewaarde op via dot-notatie.
|
|
*
|
|
* @since 2.6.5
|
|
*
|
|
* @param string $key Configuratie-sleutel in dot-notatie (bijv. 'language.default').
|
|
* @param mixed $default Standaardwaarde indien de sleutel niet bestaat.
|
|
* @return mixed De gevonden waarde of $default indien niet gevonden.
|
|
*/
|
|
public function getConfig(string $key, $default = null);
|
|
|
|
/**
|
|
* Haal de project-rootdirectory op (absoluut, genormaliseerd).
|
|
*
|
|
* @since 2.6.5
|
|
*
|
|
* @return string Absoluut pad naar de project-root.
|
|
*/
|
|
public function getProjectRoot(): string;
|
|
|
|
/**
|
|
* Haal het pad naar de contentdirectory op (absoluut, genormaliseerd).
|
|
*
|
|
* Bij een relatieve configuratiewaarde wordt deze afgezet tegen de project-root.
|
|
*
|
|
* @since 2.6.5
|
|
*
|
|
* @return string Absoluut pad naar de contentdirectory.
|
|
*/
|
|
public function getContentDir(): string;
|
|
|
|
/**
|
|
* Haal het pad naar de pluginsdirectory op (absoluut, genormaliseerd).
|
|
*
|
|
* @since 2.6.5
|
|
*
|
|
* @return string Absoluut pad naar de pluginsdirectory.
|
|
*/
|
|
public function getPluginsDir(): string;
|
|
|
|
/**
|
|
* Haal de versie-informatie uit version.php op als associatieve array.
|
|
*
|
|
* Bevat altijd minimaal de sleutel 'version'.
|
|
*
|
|
* @since 2.6.5
|
|
*
|
|
* @return array<string,mixed> Versie-informatie met minimaal de sleutel 'version'.
|
|
*/
|
|
public function getVersionInfo(): array;
|
|
|
|
/**
|
|
* Haal de vertalingen voor een plugin op in de huidige context.
|
|
*
|
|
* System-plugins resolven tegen de admin-taal; content-plugins tegen de
|
|
* huidige content-taal. De implementatie regelt de fallback naar de
|
|
* default_language van de plugin.
|
|
*
|
|
* @since 2.6.5
|
|
*
|
|
* @param string $pluginName Plugin-directorynaam.
|
|
* @param string|null $lang Optionele override-taal.
|
|
* @return array<string,string> Vertalingen als [key => value].
|
|
*/
|
|
public function getPluginTranslations(string $pluginName, ?string $lang = null): array;
|
|
|
|
/**
|
|
* Vertaal een enkele sleutel voor een plugin in de huidige context.
|
|
*
|
|
* @since 2.6.5
|
|
*
|
|
* @param string $key Vertaalsleutel.
|
|
* @param string $pluginName Plugin-directorynaam.
|
|
* @param string|null $lang Optionele override-taal.
|
|
* @return string Vertaalde string, of $key indien niet gevonden.
|
|
*/
|
|
public function t(string $key, string $pluginName, ?string $lang = null): string;
|
|
} |