Last active
July 24, 2020 15:30
-
-
Save lm/7399831 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AdminerColors | |
{ | |
function head() | |
{ | |
static $colors = array( | |
'127.0.0.1' => '#ED1C24', | |
'localhost' => '#009245', | |
'dev.kdyby.org' => '#F7931E', | |
'www.kdyby.org' => '#ED1C24', | |
); | |
if (!isset($colors[$_GET['server']])) { | |
return; | |
} | |
echo '<style> | |
#menu { border-left: 1em solid ' . $colors[$_GET['server']] . '; min-height: 100% } | |
#menu h1 a { color: ' . $colors[$_GET['server']] . ' } | |
#content { margin-left: 22em } | |
#breadcrumb { left: 22em } | |
</style>'; | |
} | |
} | |
function adminer_object() | |
{ | |
// required to run any plugin | |
include_once __DIR__ . "/plugins/plugin.php"; | |
// autoloader | |
foreach (glob("plugins/*.php") as $filename) { | |
include_once "./$filename"; | |
} | |
$plugins = array( | |
// specify enabled plugins here | |
new AdminerTablesFilter, | |
new AdminerColors, | |
); | |
return new AdminerPlugin($plugins); | |
} | |
// include original Adminer or Adminer Editor | |
include __DIR__ . "/adminer.php"; |
Author
lm
commented
Nov 10, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment