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-04-21 12:01:32 +00:00
|
|
|
global $LANG, $VERSION, $adminer, $connection, $drivers;
|
2007-07-02 05:51:26 +00:00
|
|
|
header("Content-Type: text/html; charset=utf-8");
|
2010-04-21 12:01:32 +00:00
|
|
|
header("X-Frame-Options: deny"); // ClickJacking protection in IE8, Safari 4, Chrome 2, Firefox NoScript plugin
|
2010-01-09 23:33:41 +00:00
|
|
|
$title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
|
2007-07-12 10:09:37 +00:00
|
|
|
?>
|
2009-07-15 15:08:48 +00:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
|
2009-07-11 20:30:40 +00:00
|
|
|
<html lang="<?php echo $LANG; ?>">
|
|
|
|
<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-04-21 12:01:32 +00:00
|
|
|
<title><?php echo $title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name(); ?></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-04-21 12:01:32 +00:00
|
|
|
<body onload="bodyLoad('<?php echo (is_object($connection) ? substr($connection->server_info, 0, 3) : ""); ?>');<?php echo (isset($_COOKIE["adminer_version"]) ? "" : " verifyVersion();"); ?>">
|
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
|
2007-07-26 10:45:49 +00:00
|
|
|
if (isset($breadcrumb)) {
|
2010-04-21 12:01:32 +00:00
|
|
|
$link = substr(preg_replace('~(username|db)=[^&]*&~', '', ME), 0, -1);
|
|
|
|
echo '<p id="breadcrumb"><a href="' . ($link ? h($link) : ".") . '">' . $drivers[DRIVER] . '</a> » ';
|
2009-07-30 08:12:54 +00:00
|
|
|
$link = substr(preg_replace('~db=[^&]*&~', '', ME), 0, -1);
|
2010-04-21 12:01:32 +00:00
|
|
|
$server = (SERVER != "" ? h(SERVER) : lang('Server'));
|
|
|
|
if ($breadcrumb === false) {
|
|
|
|
echo "$server\n";
|
|
|
|
} else {
|
|
|
|
echo "<a href='" . ($link ? h($link) : ".") . "'>$server</a> » ";
|
|
|
|
if (is_array($breadcrumb)) {
|
|
|
|
if (DB != "") {
|
|
|
|
echo '<a href="' . h(substr(ME, 0, -1)) . '">' . h(DB) . '</a> » ';
|
|
|
|
}
|
|
|
|
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> » ';
|
|
|
|
}
|
2007-07-26 10:45:49 +00:00
|
|
|
}
|
|
|
|
}
|
2010-04-21 12:01:32 +00:00
|
|
|
echo "$title\n";
|
2007-07-26 10:45:49 +00:00
|
|
|
}
|
|
|
|
}
|
2009-09-22 15:08:26 +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-04-21 12:01:32 +00:00
|
|
|
$databases = &get_session("databases");
|
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
|
|
|
}
|
2007-07-06 08:47:20 +00:00
|
|
|
}
|
|
|
|
|
2010-04-21 12:01:32 +00:00
|
|
|
/** Print HTML footer
|
|
|
|
* @param string auth|db
|
|
|
|
* @return null
|
|
|
|
*/
|
|
|
|
function page_footer($missing = "") {
|
2009-09-19 20:16:15 +00:00
|
|
|
global $adminer;
|
2007-07-12 10:09:37 +00:00
|
|
|
?>
|
2007-07-06 08:47:20 +00:00
|
|
|
</div>
|
|
|
|
|
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-04-21 12:01:32 +00:00
|
|
|
// don't wait for code after footer
|
|
|
|
session_write_close();
|
|
|
|
ob_flush();
|
|
|
|
flush();
|
2007-07-02 05:51:26 +00:00
|
|
|
}
|