<body> class for project-specific styles

Signed-off-by: Lucas Sandery <lucas-sandery@users.noreply.github.com>
This commit is contained in:
Lucas Sandery 2018-02-10 03:30:45 +10:30 committed by Roy Orbitson
parent 7a3e3e5b4c
commit 12d431fca7
4 changed files with 5 additions and 1 deletions

View file

@ -32,7 +32,7 @@ function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
<?php } ?>
<?php } ?>
<body class="<?php echo lang('ltr'); ?> nojs">
<body class="<?php echo lang('ltr'); ?> nojs <?php echo $GLOBALS['project']; ?>">
<?php
$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

View file

@ -7,6 +7,7 @@
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
$GLOBALS['project'] = basename(dirname(__FILE__));
include "./include/bootstrap.inc.php";
include "./include/tmpfile.inc.php";

View file

@ -65,6 +65,7 @@ header("Cache-Control: immutable");
$return = preg_replace('~^if \(isset\(\$_GET\["' . $driver . '"]\)\) \{(.*)^}~ms', '\1', $return);
}
if (basename($match[2]) != "lang.inc.php" || !$_SESSION["lang"]) {
$return = str_replace('<?php echo $GLOBALS[\'project\']; ?>', $project, $return);
if (basename($match[2]) == "lang.inc.php") {
$return = str_replace('function lang($idf, $number = null) {', 'function lang($idf, $number = null) {
if (is_string($idf)) { // compiled version uses numbers, string comes from a plugin
@ -388,6 +389,7 @@ include dirname(__FILE__) . "/adminer/include/driver.inc.php";
$features = array("call" => "routine", "dump", "event", "privileges", "procedure" => "routine", "processlist", "routine", "scheme", "sequence", "status", "trigger", "type", "user" => "privileges", "variables", "view");
$lang_ids = array(); // global variable simplifies usage in a callback function
$file = file_get_contents(dirname(__FILE__) . "/$project/index.php");
$file = preg_replace('/\\$GLOBALS\\[\'project\'\\][^;]+;\\s+/', '', $file);
if ($driver) {
$_GET[$driver] = true; // to load the driver
include_once dirname(__FILE__) . "/adminer/drivers/$driver.inc.php";

View file

@ -7,6 +7,7 @@
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
*/
$GLOBALS['project'] = basename(dirname(__FILE__));
include "../adminer/include/bootstrap.inc.php";
$drivers[DRIVER] = lang('Login');