1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-18 04:11:27 +02:00

Rename $driver to $jush

This commit is contained in:
Jakub Vrana
2010-05-07 15:44:22 +02:00
parent 6217dcf717
commit e6726941dc
19 changed files with 48 additions and 48 deletions

View File

@@ -122,8 +122,8 @@ document.getElementById('username').focus();
* @return string
*/
function selectQuery($query) {
global $driver;
return "<p><code class='jush-$driver'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
global $jush;
return "<p><code class='jush-$jush'>" . h(str_replace("\n", " ", $query)) . "</code> <a href='" . h(ME) . "sql=" . urlencode($query) . "'>" . lang('Edit') . "</a>\n";
}
/** Description of a row in a table
@@ -383,12 +383,12 @@ document.getElementById('username').focus();
* @return string
*/
function messageQuery($query) {
global $driver;
global $jush;
restart_session();
$id = "sql-" . count($_SESSION["messages"]);
$history = &get_session("history");
$history[DB][] = (strlen($query) > 1e6 ? ereg_replace('[\x80-\xFF]+$', '', substr($query, 0, 1e6)) . "\n..." : $query); // [\x80-\xFF] - valid UTF-8, \n - can end by one-line comment
return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre class='jush-$driver'>" . shorten_utf8($query, 1000) . '</pre><p><a href="' . h(ME . 'sql=&history=' . (count($history[DB]) - 1)) . '">' . lang('Edit') . '</a></div>';
return " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><div id='$id' class='hidden'><pre class='jush-$jush'>" . shorten_utf8($query, 1000) . '</pre><p><a href="' . h(ME . 'sql=&history=' . (count($history[DB]) - 1)) . '">' . lang('Edit') . '</a></div>';
}
/** Functions displayed in edit form
@@ -481,7 +481,7 @@ document.getElementById('username').focus();
* @return null
*/
function navigation($missing) {
global $VERSION, $connection, $token, $driver, $drivers;
global $VERSION, $connection, $token, $jush, $drivers;
?>
<h1>
<a href="http://www.adminer.org/" id="h1"><?php echo $this->name(); ?></a>
@@ -491,7 +491,7 @@ document.getElementById('username').focus();
<?php
if ($missing == "auth") {
$first = true;
foreach ((array) $_SESSION["passwords"] as $key => $servers) { // $driver is global variable
foreach ((array) $_SESSION["passwords"] as $driver => $servers) {
foreach ($servers as $server => $usernames) {
foreach ($usernames as $username => $password) {
if (isset($password)) {
@@ -499,7 +499,7 @@ document.getElementById('username').focus();
echo "<p>\n";
$first = false;
}
echo "<a href='" . h(auth_url($key, $server, $username)) . "'>($drivers[$key]) " . h($username . ($server != "" ? "@$server" : "")) . "</a><br>\n";
echo "<a href='" . h(auth_url($driver, $server, $username)) . "'>($drivers[$driver]) " . h($username . ($server != "" ? "@$server" : "")) . "</a><br>\n";
}
}
}
@@ -539,9 +539,9 @@ document.getElementById('username').focus();
$links[] = preg_quote($table, '/');
}
echo "<script type='text/javascript'>\n";
echo "var jushLinks = { $driver: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
echo "var jushLinks = { $jush: [ '" . addcslashes(h(ME), "\\'/") . "table=\$&', /\\b(" . implode("|", $links) . ")\\b/g ] };\n";
foreach (array("bac", "bra", "sqlite_quo", "mssql_bra") as $val) {
echo "jushLinks.$val = jushLinks.$driver;\n";
echo "jushLinks.$val = jushLinks.$jush;\n";
}
echo "</script>\n";
}

View File

@@ -43,8 +43,8 @@ if (isset($_POST["server"])) {
redirect(substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1), lang('Logout successful.'));
}
} elseif ($_COOKIE["adminer_permanent"]) {
list($server, $username, $cipher, $system) = array_map('base64_decode', explode(":", $_COOKIE["adminer_permanent"])); // $driver is a global variable
if ($server == SERVER && $username === $_GET["username"] && $system == DRIVER) {
list($server, $username, $cipher, $driver) = array_map('base64_decode', explode(":", $_COOKIE["adminer_permanent"]));
if ($server == SERVER && $username === $_GET["username"] && $driver == DRIVER) {
session_regenerate_id(); // defense against session fixation
set_session("passwords", decrypt_string($cipher, $adminer->permanentLogin()));
}

View File

@@ -100,8 +100,8 @@ DROP PROCEDURE adminer_alter;
}
function dump_data($table, $style, $select = "") {
global $connection, $driver;
$max_packet = ($driver == "sqlite" ? 0 : 1048576); // default, minimum is 1024
global $connection, $jush;
$max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024
if ($style) {
if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") {
echo "TRUNCATE " . idf_escape($table) . ";\n";

View File

@@ -517,7 +517,7 @@ function enum_input($type, $name, $field, $value) {
* @return null
*/
function input($field, $value, $function) {
global $types, $adminer, $driver;
global $types, $adminer, $jush;
$name = h(bracket_escape($field["field"]));
echo "<td class='function'>";
$functions = (isset($_GET["select"]) ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
@@ -549,7 +549,7 @@ function input($field, $value, $function) {
} elseif (ereg('binary|blob|bytea', $field["type"]) && ini_bool("file_uploads")) {
echo "<input type='file' name='fields-$name'$onchange>";
} elseif (ereg('text|blob', $field["type"])) {
echo "<textarea " . ($driver != "sqlite" || ereg("\n", $value) ? "cols='50' rows='12'" : "cols='30' rows='1' style='height: 1.2em;'") . "$attrs>" . h($value) . '</textarea>'; // 1.2em - line-height
echo "<textarea " . ($jush != "sqlite" || ereg("\n", $value) ? "cols='50' rows='12'" : "cols='30' rows='1' style='height: 1.2em;'") . "$attrs>" . h($value) . '</textarea>'; // 1.2em - line-height
} else {
// int(3) is only a display hint
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^([0-9]+)(,([0-9]+))?$~', $field["length"], $match) ? ($match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));