1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-05 14:17:26 +02:00

Plugins: Method bodyClass() to add <body class> (fix #309)

This commit is contained in:
Jakub Vrana
2025-04-13 08:24:16 +02:00
parent 71f2578af6
commit 5867b0724f
4 changed files with 15 additions and 3 deletions

View 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

View 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>
*/

View 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));

View File

@@ -70,6 +70,10 @@ class Adminer {
return true;
}
function bodyClass(): void {
echo " editor";
}
function css() {
$return = array();
foreach (array("", "-dark") as $mode) {