"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, will be HTML escaped
* @return null
*/
function page_header($title, $error = "", $breadcrumb = array(), $title2 = "") {
global $LANG, $adminer, $connection, $drivers;
header("Content-Type: text/html; charset=utf-8");
$adminer->headers();
$title_all = $title . ($title2 != "" ? ": " . h($title2) : "");
$title_page = strip_tags($title_all . (SERVER != "" && SERVER != "localhost" ? h(" - " . SERVER) : "") . " - " . $adminer->name());
if (is_ajax()) {
header("X-AJAX-Title: " . rawurlencode($title_page));
} else {
?>
' . $drivers[DRIVER] . ' » ';
$link = substr(preg_replace('~(db|ns)=[^&]*&~', '', ME), 0, -1);
$server = (SERVER != "" ? h(SERVER) : lang('Server'));
if ($breadcrumb === false) {
echo "$server\n";
} else {
echo "
$server » ";
if ($_GET["ns"] != "" || (DB != "" && is_array($breadcrumb))) {
echo '
' . h(DB) . ' » ';
}
if (is_array($breadcrumb)) {
if ($_GET["ns"] != "") {
echo '
' . h($_GET["ns"]) . ' » ';
}
foreach ($breadcrumb as $key => $val) {
$desc = (is_array($val) ? $val[1] : $val);
if ($desc != "") {
echo '
' . h($desc) . ' » ';
}
}
}
echo "$title\n";
}
}
echo "
\n";
echo "
$title_all
\n";
restart_session();
$uri = preg_replace('~^[^?]*~', '', $_SERVER["REQUEST_URI"]);
$messages = $_SESSION["messages"][$uri];
if ($messages) {
echo "
" . implode("
\n
", $messages) . "
\n";
unset($_SESSION["messages"][$uri]);
}
$databases = &get_session("dbs");
if (DB != "" && $databases && !in_array(DB, $databases, true)) {
$databases = null;
}
if ($error) {
echo "
$error
\n";
}
define("PAGE_HEADER", 1);
}
/** Print HTML footer
* @param string "auth", "db", "ns"
* @return null
*/
function page_footer($missing = "") {
global $adminer;
if (!is_ajax()) {
?>