if (strlen($_GET["db"])) {
echo "<input type='submit' name='drop' value='" . lang('Drop') . "'$confirm />\n";
} elseif (!$_POST["add_x"]) {
- echo "<input type='image' name='add' src='plus.gif' alt='+' title='" . lang('Add next') . "' />\n";
+ echo "<input type='image' name='add' src='../adminer/plus.gif' alt='+' title='" . lang('Add next') . "' />\n";
}
?>
</p>
<?php
class AdminerBase {
+ function name() {
+ return lang('Adminer');
+ }
+
+ function server() {
+ return $_GET["server"];
+ }
+
+ function username() {
+ return $_SESSION["usernames"][$_GET["server"]];
+ }
+
+ function password() {
+ return $_SESSION["passwords"][$_GET["server"]];
+ }
+
function table_list($row) {
global $SELF;
echo '<a href="' . htmlspecialchars($SELF) . 'select=' . urlencode($row["Name"]) . '">' . lang('select') . '</a> ';
}
}
+
+$adminer = (class_exists("Adminer") ? new Adminer : new AdminerBase);
<?php
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
- global $SELF, $LANG, $VERSION;
+ global $SELF, $LANG, $VERSION, $adminer;
header("Content-Type: text/html; charset=utf-8");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="robots" content="noindex" />
-<title><?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . (strlen($_GET["server"]) && $_GET["server"] != "localhost" ? htmlspecialchars("- $_GET[server]") : "") . " - " . lang('Adminer'); ?></title>
+<title><?php echo $title . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . (strlen($_GET["server"]) && $_GET["server"] != "localhost" ? htmlspecialchars("- $_GET[server]") : "") . " - " . $adminer->name(); ?></title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
-<link rel="stylesheet" type="text/css" href="default.css<?php // Ondrej Valka, http://valka.info ?>" />
+<link rel="stylesheet" type="text/css" href="../adminer/default.css<?php // Ondrej Valka, http://valka.info ?>" />
<?php if (file_exists("adminer.css")) { ?>
<link rel="stylesheet" type="text/css" href="adminer.css" />
<?php } ?>
</head>
<body onload="load_jush();<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verify_version('$VERSION');"); ?>">
-<script type="text/javascript" src="functions.js"></script>
+<script type="text/javascript" src="../adminer/functions.js"></script>
<div id="content">
<?php
<?php switch_lang(); ?>
<div id="menu">
-<h1><a href="http://www.adminer.org/" class="h1"><?php echo lang('Adminer'); ?></a> <?php echo $VERSION; ?>
+<h1><a href="http://www.adminer.org/" class="h1"><?php echo $adminer->name(); ?></a> <?php echo $VERSION; ?>
<a href='http://www.adminer.org/#download' id="version"><?php echo (version_compare($VERSION, $_COOKIE["adminer_version"]) < 0 ? htmlspecialchars($_COOKIE["adminer_version"]) : ""); ?></a>
</h1>
<?php if ($missing != "auth") { ?>
<td><input type="radio" name="auto_increment_col" value="" /><?php echo lang('Auto Increment'); ?></td>
<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><?php echo lang('Comment'); ?></td>
<?php } ?>
-<td><?php echo "<input type='image' name='add[0]' src='plus.gif' alt='+' title='" . lang("Add next") . "' />"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script></td>
+<td><?php echo "<input type='image' name='add[0]' src='../adminer/plus.gif' alt='+' title='" . lang("Add next") . "' />"; ?><script type="text/javascript">row_count = <?php echo count($fields); ?>;</script></td>
</tr></thead>
<?php
foreach ($fields as $i => $field) {
<td<?php echo ($column_comments ? "" : " class='hidden'"); ?>><input name="fields[<?php echo $i; ?>][comment]" value="<?php echo htmlspecialchars($field["comment"]); ?>" maxlength="255" /></td>
<?php } ?>
<?php
- echo "<td class='nowrap'><input type='image' name='add[$i]' src='plus.gif' alt='+' title='" . lang('Add next') . "' onclick='var x = editing_add_row(this, $allowed); if (x) { x.focus(); x.onchange = function () { }; } return !x;' />";
- echo " <input type='image' name='drop_col[$i]' src='cross.gif' alt='x' title='" . lang('Remove') . "' onclick='return !editing_remove_row(this);' />";
- echo " <input type='image' name='up[$i]' src='up.gif' alt='^' title='" . lang('Move up') . "' />";
- echo " <input type='image' name='down[$i]' src='down.gif' alt='v' title='" . lang('Move down') . "' />";
+ echo "<td class='nowrap'><input type='image' name='add[$i]' src='../adminer/plus.gif' alt='+' title='" . lang('Add next') . "' onclick='var x = editing_add_row(this, $allowed); if (x) { x.focus(); x.onchange = function () { }; } return !x;' />";
+ echo " <input type='image' name='drop_col[$i]' src='../adminer/cross.gif' alt='x' title='" . lang('Remove') . "' onclick='return !editing_remove_row(this);' />";
+ echo " <input type='image' name='up[$i]' src='../adminer/up.gif' alt='^' title='" . lang('Move up') . "' />";
+ echo " <input type='image' name='down[$i]' src='../adminer/down.gif' alt='v' title='" . lang('Move down') . "' />";
echo "</td>\n</tr>\n";
}
return $column_comments;
$unsigned = array("unsigned", "zerofill", "unsigned zerofill");
function connect() {
+ global $adminer;
$dbh = new Min_DB;
- if ($dbh->connect($_GET["server"], $_SESSION["usernames"][$_GET["server"]], $_SESSION["passwords"][$_GET["server"]])) {
+ if ($dbh->connect($adminer->server(), $adminer->username(), $adminer->password())) {
$dbh->query("SET SQL_QUOTE_SHOW_CREATE=1");
$dbh->query("SET NAMES utf8");
return $dbh;
include "./include/editing.inc.php";
include "./include/export.inc.php";
-$adminer = (class_exists("Adminer") ? new Adminer : new AdminerBase);
$on_actions = array("RESTRICT", "CASCADE", "SET NULL", "NO ACTION");
$enum_length = '\'(?:\'\'|[^\'\\\\]+|\\\\.)*\'|"(?:""|[^"\\\\]+|\\\\.)*"';
$inout = array("IN", "OUT", "INOUT");
$left1 = $left - $table_pos[$name][1];
$i = 0;
foreach ($columns as $target) {
- echo '<div class="references" title="' . htmlspecialchars($target_name) . "\" id='refd$left-" . ($i++) . "' style='left: $left1" . "em; top: " . $table["fields"][$target]["pos"] . "em; height: 1.25em; background: url(arrow.gif) no-repeat right center;'><div style='height: .5em; border-bottom: 1px solid Gray; width: " . (-$left1) . "em;'></div></div>\n";
+ echo '<div class="references" title="' . htmlspecialchars($target_name) . "\" id='refd$left-" . ($i++) . "' style='left: $left1" . "em; top: " . $table["fields"][$target]["pos"] . "em; height: 1.25em; background: url(../adminer/arrow.gif) no-repeat right center;'><div style='height: .5em; border-bottom: 1px solid Gray; width: " . (-$left1) . "em;'></div></div>\n";
}
}
}