diff --git a/CHANGELOG.md b/CHANGELOG.md index ea162b8d..9662611f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## Adminer dev +- Plugins: Method bodyClass() to add <body class> ## Adminer 5.2.1 (released 2025-04-11) - Fix search anywhere (bug #1004, regression from 5.1.1) @@ -48,8 +49,8 @@ - CSS: Allow more custom styles with dark mode (bug #925) - CSS: Increase maximum width of string edit (bug #930) - CSS: Increase space after SQL result (bug #937) -- Plugins: autoload plugins from adminer-plugins/ -- Plugins: configure plugins with adminer-plugins.php +- Plugins: Autoload plugins from adminer-plugins/ +- Plugins: Configure plugins with adminer-plugins.php - Plugins: Display loaded plugins in server overview - New plugin: AI prompt in SQL command generating the queries with Google Gemini - New plugin: Verify new versions from GitHub diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 97709990..c58e6dbc 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -108,6 +108,11 @@ class Adminer { return true; } + /** Print extra classes in ; must start with a space */ + function bodyClass(): void { + echo " adminer"; + } + /** Get URLs of the CSS files * @return list */ diff --git a/adminer/include/design.inc.php b/adminer/include/design.inc.php index 8b1a1937..5469b5bc 100644 --- a/adminer/include/design.inc.php +++ b/adminer/include/design.inc.php @@ -57,7 +57,9 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s foreach ($css as $val) { echo "\n"; } - echo "\n\n"; + echo "\nbodyClass(); + echo "'>\n"; $filename = get_temp_dir() . "/adminer.version"; if (!$_COOKIE["adminer_version"] && function_exists('openssl_verify') && file_exists($filename) && filemtime($filename) + 86400 > time()) { // 86400 - 1 day in seconds $version = unserialize(file_get_contents($filename)); diff --git a/editor/include/adminer.inc.php b/editor/include/adminer.inc.php index 0f2b0990..7aa478af 100644 --- a/editor/include/adminer.inc.php +++ b/editor/include/adminer.inc.php @@ -70,6 +70,10 @@ class Adminer { return true; } + function bodyClass(): void { + echo " editor"; + } + function css() { $return = array(); foreach (array("", "-dark") as $mode) {