Move menu to footer

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@53 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2007-07-06 08:47:20 +00:00
parent bab08c9dec
commit 09041b7c54
3 changed files with 24 additions and 20 deletions

View file

@ -10,7 +10,7 @@ if (isset($_POST["server"])) {
} }
if (isset($_GET["logout"]) || !@mysql_connect($_GET["server"], $_SESSION["usernames"][$_GET["server"]], $_SESSION["passwords"][$_GET["server"]])) { if (isset($_GET["logout"]) || !@mysql_connect($_GET["server"], $_SESSION["usernames"][$_GET["server"]], $_SESSION["passwords"][$_GET["server"]])) {
page_header(lang('Login'), "auth"); page_header(lang('Login'));
if (isset($_GET["logout"])) { if (isset($_GET["logout"])) {
echo "<p class='message'>" . lang('Logout successful.') . "</p>\n"; echo "<p class='message'>" . lang('Logout successful.') . "</p>\n";
} elseif (isset($_SESSION["usernames"][$_GET["server"]])) { } elseif (isset($_SESSION["usernames"][$_GET["server"]])) {

View file

@ -1,12 +1,12 @@
<?php <?php
if (!(strlen($_GET["db"]) ? mysql_select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]))) { if (!(strlen($_GET["db"]) ? mysql_select_db($_GET["db"]) : isset($_GET["sql"]) || isset($_GET["dump"]) || isset($_GET["database"]))) {
page_header(lang('Select database'), "db"); page_header(lang('Select database'));
if (strlen($_GET["db"])) { if (strlen($_GET["db"])) {
echo "<p class='error'>" . lang('Invalid database.') . "</p>\n"; echo "<p class='error'>" . lang('Invalid database.') . "</p>\n";
} else { } else {
echo '<a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Create new database') . '</a>'; echo '<a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Create new database') . '</a>';
} }
page_footer(); page_footer("db");
exit; exit;
} }
mysql_query("SET CHARACTER SET utf8"); mysql_query("SET CHARACTER SET utf8");

View file

@ -1,12 +1,11 @@
<?php <?php
function page_header($title, $missing = false) { function page_header($title) {
global $SELF;
header("Content-Type: text/html; charset=utf-8"); 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"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="cs"> <html xmlns="http://www.w3.org/1999/xhtml" lang="cs">
<head> <head>
<title><?php echo lang('phpMinAdmin') . ($title ? " - $title" : ""); ?></title> <title><?php echo lang('phpMinAdmin') . " - $title"; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css"> <style type="text/css">
BODY { color: Black; background-color: White; } BODY { color: Black; background-color: White; }
@ -14,15 +13,32 @@ A { color: Blue; }
A:visited { color: Navy; } A:visited { color: Navy; }
H1 { font-size: 150%; margin: 0; } H1 { font-size: 150%; margin: 0; }
H2 { font-size: 150%; margin-top: 0; } H2 { font-size: 150%; margin-top: 0; }
FIELDSET { float: left; padding: .5em; margin: 0; }
.error { color: Red; } .error { color: Red; }
.message { color: Green; } .message { color: Green; }
#menu { float: left; width: 15em; overflow: auto; white-space: nowrap; } #menu { position: absolute; top: 8px; left: 8px; width: 15em; overflow: auto; white-space: nowrap; }
#content { margin-left: 16em; } #content { margin-left: 16em; }
</style> </style>
</head> </head>
<body> <body>
<div id="content">
<?php
echo "<h2>$title</h2>\n";
if ($_SESSION["message"]) {
echo "<p class='message'>$_SESSION[message]</p>\n";
$_SESSION["message"] = "";
}
}
function page_footer($missing = false) {
global $SELF;
ob_flush();
flush();
?>
</div>
<div id="menu"> <div id="menu">
<h1><a href="<?php echo (strlen($SELF) > 1 ? htmlspecialchars(substr($SELF, 0, -1)) : "."); ?>"><?php echo lang('phpMinAdmin'); ?></a></h1> <h1><a href="<?php echo (strlen($SELF) > 1 ? htmlspecialchars(substr($SELF, 0, -1)) : "."); ?>"><?php echo lang('phpMinAdmin'); ?></a></h1>
<?php switch_lang(); ?> <?php switch_lang(); ?>
@ -36,6 +52,7 @@ H2 { font-size: 150%; margin-top: 0; }
<p><?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /><?php } ?> <p><?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /><?php } ?>
<select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option> <select name="db" onchange="this.form.submit();"><option value="">(<?php echo lang('database'); ?>)</option>
<?php <?php
flush();
$result = mysql_query("SHOW DATABASES"); $result = mysql_query("SHOW DATABASES");
while ($row = mysql_fetch_row($result)) { while ($row = mysql_fetch_row($result)) {
echo "<option" . ($row[0] == $_GET["db"] ? " selected='selected'" : "") . ">" . htmlspecialchars($row[0]) . "</option>\n"; echo "<option" . ($row[0] == $_GET["db"] ? " selected='selected'" : "") . ">" . htmlspecialchars($row[0]) . "</option>\n";
@ -65,19 +82,6 @@ H2 { font-size: 150%; margin-top: 0; }
?> ?>
</div> </div>
<div id="content">
<?php
echo "<h2>$title</h2>\n";
if ($_SESSION["message"]) {
echo "<p class='message'>$_SESSION[message]</p>\n";
$_SESSION["message"] = "";
}
}
function page_footer() {
?>
</div>
</body> </body>
</html> </html>
<?php <?php