1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-09 16:17:48 +02:00

Plugin to auto-include adminer.js when present

This commit is contained in:
Roy-Orbison
2023-08-07 14:39:29 +09:30
committed by Jakub Vrana
parent 47a9453ace
commit 652a09bb91

20
plugins/adminer.js.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
/**
* Enables auto-detection and inclusion of adminer.js, like adminer.css
*
* @author Roy Orbitson, https://github.com/Roy-Orbison
*
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
class AdminerDotJs
{
const FileName = "adminer.js";
function head() {
if (file_exists(self::FileName)) {
echo script_src(self::FileName . "?v=" . crc32(file_get_contents(self::FileName))), "\n";
}
}
}