Merge pull request #78 from Roy-Orbison/project-class
<body> class for project-specific styles
This commit is contained in:
commit
0fe04741c2
4 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue