1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-14 02:23:59 +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

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