]> git.joonet.de Git - adminer.git/commitdiff
Plugins: Method bodyClass() to add <body class> (fix #309)
authorJakub Vrana <jakub@vrana.cz>
Sun, 13 Apr 2025 06:24:16 +0000 (08:24 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sun, 13 Apr 2025 06:24:16 +0000 (08:24 +0200)
CHANGELOG.md
adminer/include/adminer.inc.php
adminer/include/design.inc.php
editor/include/adminer.inc.php

index ea162b8dd48ac9491a4127ebd75322df99ee8891..9662611f824e01df6c04f014d2cc455426afe19f 100644 (file)
@@ -1,4 +1,5 @@
 ## Adminer dev
+- Plugins: Method bodyClass() to add &lt;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
index 9770999007bf4454242d6d014c0bfc49d00f6895..c58e6dbcee1ba997ae3df1eb47dfc9a53c7ee757 100644 (file)
@@ -108,6 +108,11 @@ class Adminer {
                return true;
        }
 
+       /** Print extra classes in <body class>; must start with a space */
+       function bodyClass(): void {
+               echo " adminer";
+       }
+
        /** Get URLs of the CSS files
        * @return list<string>
        */
index 8b1a19375106e82e772026d6562793eecd3ed32e..5469b5bc8a66064062afbb61335653d4d07dc40b 100644 (file)
@@ -57,7 +57,9 @@ function page_header(string $title, string $error = "", $breadcrumb = array(), s
        foreach ($css as $val) {
                echo "<link rel='stylesheet'" . (preg_match('~-dark\.~', $val) && !$dark ? $media : "") . " href='" . h($val) . "'>\n";
        }
-       echo "\n<body class='" . lang('ltr') . " nojs'>\n";
+       echo "\n<body class='" . lang('ltr') . " nojs";
+       adminer()->bodyClass();
+       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));
index 0f2b0990aa06ba4008a9ffe40eb359121491cad3..7aa478af9354d3b9e124440c2f2a334db14ec147 100644 (file)
@@ -70,6 +70,10 @@ class Adminer {
                return true;
        }
 
+       function bodyClass(): void {
+               echo " editor";
+       }
+
        function css() {
                $return = array();
                foreach (array("", "-dark") as $mode) {