2007-07-02 05:51:26 +00:00
|
|
|
<?php
|
2010-04-21 12:01:32 +00:00
|
|
|
/** Print HTML header
|
|
|
|
* @param string used in title, breadcrumb and heading
|
|
|
|
* @param string
|
|
|
|
* @param mixed array("key" => "link=desc", "key2" => array("link", "desc")), null for nothing, false for driver only, true for driver and server
|
|
|
|
* @param string used after colon in title and heading
|
|
|
|
* @return null
|
|
|
|
*/
|
2008-04-10 14:37:10 +00:00
|
|
|
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
|
2010-10-13 15:53:59 +00:00
|
|
|
global $LANG, $HTTPS, $adminer, $connection, $drivers;
|
2007-07-02 05:51:26 +00:00
|
|
|
header("Content-Type: text/html; charset=utf-8");
|
2010-10-17 20:13:32 +00:00
|
|
|
$adminer->headers();
|
2010-11-18 11:17:06 +00:00
|
|
|
$title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
|
2010-11-22 17:13:07 +00:00
|
|
|
$title_page = $title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name();
|
|
|
|
if (is_ajax()) {
|
|
|
|
header("X-AJAX-Title: " . rawurlencode($title_page));
|
2010-11-23 10:50:53 +00:00
|
|
|
if ($_GET["ajax"]) {
|
|
|
|
header("X-AJAX-Redirect: " . remove_from_uri("ajax"));
|
|
|
|
}
|
2010-11-22 17:13:07 +00:00
|
|
|
} else {
|
2010-10-16 23:51:56 +00:00
|
|
|
$protocol = ($HTTPS ? "https" : "http");
|
|
|
|
?>
|
2009-07-15 15:08:48 +00:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
2010-11-11 09:12:26 +00:00
|
|
|
<html lang="<?php echo $LANG; ?>" dir="<?php echo lang('ltr'); ?>">
|
2009-07-11 20:30:40 +00:00
|
|
|
<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">
|
2010-11-22 17:13:07 +00:00
|
|
|
<title><?php echo $title_page; ?></title>
|
2009-09-23 09:56:07 +00:00
|
|
|
<link rel="shortcut icon" type="image/x-icon" href="../adminer/static/favicon.ico">
|
|
|
|
<link rel="stylesheet" type="text/css" href="../adminer/static/default.css<?php // Ondrej Valka, http://valka.info ?>">
|
2009-06-08 19:02:30 +00:00
|
|
|
<?php if (file_exists("adminer.css")) { ?>
|
2009-07-11 20:30:40 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="adminer.css">
|
2009-05-29 14:53:42 +00:00
|
|
|
<?php } ?>
|
2007-07-02 05:51:26 +00:00
|
|
|
|
2010-11-26 09:26:08 +00:00
|
|
|
<body class="<?php echo lang('ltr'); ?>"<?php if (isset($_GET["username"])) { ?> onclick="return bodyClick(event, '<?php echo js_escape(DB); ?>');"<?php } ?> onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>', '<?php echo $protocol; ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion('$protocol');"); ?>">
|
2009-09-23 09:56:07 +00:00
|
|
|
<script type="text/javascript" src="../adminer/static/functions.js"></script>
|
|
|
|
<script type="text/javascript" src="static/editing.js"></script>
|
2007-07-02 05:51:26 +00:00
|
|
|
|
2007-07-06 08:47:20 +00:00
|
|
|
<div id="content">
|
|
|
|
<?php
|
2010-11-18 11:17:06 +00:00
|
|
|
}
|
|
|
|
if (isset($breadcrumb)) {
|
|
|
|
$link = substr(preg_replace('~(username|db|ns)=[^&]*&~', '', ME), 0, -1);
|
|
|
|
echo '<p id="breadcrumb"><a href="' . ($link ? h($link) : ".") . '">' . $drivers[DRIVER] . '</a> » ';
|
|
|
|
$link = substr(preg_replace('~(db|ns)=[^&]*&~', '', ME), 0, -1);
|
|
|
|
$server = (SERVER != "" ? h(SERVER) : lang('Server'));
|
|
|
|
if ($breadcrumb === false) {
|
|
|
|
echo "$server\n";
|
|
|
|
} else {
|
|
|
|
echo "<a href='" . ($link ? h($link) : ".") . "'>$server</a> » ";
|
|
|
|
if ($_GET["ns"] != "" || (DB != "" && is_array($breadcrumb))) {
|
|
|
|
echo '<a href="' . h($link . "&db=" . urlencode(DB) . (support("scheme") ? "&ns=" : "")) . '">' . h(DB) . '</a> » ';
|
|
|
|
}
|
|
|
|
if (is_array($breadcrumb)) {
|
|
|
|
if ($_GET["ns"] != "") {
|
|
|
|
echo '<a href="' . h(substr(ME, 0, -1)) . '">' . h($_GET["ns"]) . '</a> » ';
|
2010-04-21 12:01:32 +00:00
|
|
|
}
|
2010-11-18 11:17:06 +00:00
|
|
|
foreach ($breadcrumb as $key => $val) {
|
|
|
|
$desc = (is_array($val) ? $val[1] : $val);
|
|
|
|
if ($desc != "") {
|
|
|
|
echo '<a href="' . h(ME . "$key=") . urlencode(is_array($val) ? $val[0] : $val) . '">' . h($desc) . '</a> » ';
|
2010-04-21 12:01:32 +00:00
|
|
|
}
|
2007-07-26 10:45:49 +00:00
|
|
|
}
|
|
|
|
}
|
2010-11-18 11:17:06 +00:00
|
|
|
echo "$title\n";
|
2007-07-26 10:45:49 +00:00
|
|
|
}
|
|
|
|
}
|
2010-11-18 11:17:06 +00:00
|
|
|
echo "<h2>$title_all</h2>\n";
|
2009-11-02 22:09:23 +00:00
|
|
|
restart_session();
|
2008-04-18 12:01:53 +00:00
|
|
|
if ($_SESSION["messages"]) {
|
2009-06-25 12:46:15 +00:00
|
|
|
echo "<div class='message'>" . implode("</div>\n<div class='message'>", $_SESSION["messages"]) . "</div>\n";
|
2008-04-18 12:01:53 +00:00
|
|
|
$_SESSION["messages"] = array();
|
2007-07-06 08:47:20 +00:00
|
|
|
}
|
2010-10-15 08:58:08 +00:00
|
|
|
$databases = &get_session("dbs");
|
2010-01-09 23:33:41 +00:00
|
|
|
if (DB != "" && $databases && !in_array(DB, $databases, true)) {
|
2008-10-02 15:25:12 +00:00
|
|
|
$databases = null;
|
|
|
|
}
|
2008-04-10 14:37:10 +00:00
|
|
|
if ($error) {
|
2009-06-15 11:57:40 +00:00
|
|
|
echo "<div class='error'>$error</div>\n";
|
2008-04-10 14:37:10 +00:00
|
|
|
}
|
2010-11-25 09:40:16 +00:00
|
|
|
define("PAGE_HEADER", 1);
|
2007-07-06 08:47:20 +00:00
|
|
|
}
|
|
|
|
|
2010-04-21 12:01:32 +00:00
|
|
|
/** Print HTML footer
|
2010-10-18 00:15:58 +00:00
|
|
|
* @param string "auth", "db", "ns"
|
2010-04-21 12:01:32 +00:00
|
|
|
* @return null
|
|
|
|
*/
|
|
|
|
function page_footer($missing = "") {
|
2009-09-19 20:16:15 +00:00
|
|
|
global $adminer;
|
2010-10-18 11:57:22 +00:00
|
|
|
if (!is_ajax()) {
|
2010-10-16 23:51:56 +00:00
|
|
|
?>
|
|
|
|
</div>
|
2007-07-06 08:47:20 +00:00
|
|
|
|
2007-08-09 16:47:06 +00:00
|
|
|
<?php switch_lang(); ?>
|
2007-07-02 05:51:26 +00:00
|
|
|
<div id="menu">
|
2009-07-27 11:25:37 +00:00
|
|
|
<?php $adminer->navigation($missing); ?>
|
2007-07-02 05:51:26 +00:00
|
|
|
</div>
|
|
|
|
<?php
|
2010-10-16 23:51:56 +00:00
|
|
|
}
|
2007-07-02 05:51:26 +00:00
|
|
|
}
|