]> git.joonet.de Git - adminer.git/commitdiff
Breadcrumbs
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 26 Jul 2007 10:45:49 +0000 (10:45 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 26 Jul 2007 10:45:49 +0000 (10:45 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@262 7c3ca157-0c34-0410-bff1-cbf682f78f5c

13 files changed:
abstraction.inc.php
auth.inc.php
connect.inc.php
create.inc.php
createv.inc.php
database.inc.php
design.inc.php
edit.inc.php
foreign.inc.php
index.php
indexes.inc.php
schema.inc.php
trigger.inc.php

index a86f98567951b3d3c10855c3571a320513dcbbbf..1b55f35a40edf3b0a9aa8699994e2883a1037a2a 100644 (file)
@@ -189,7 +189,7 @@ if (extension_loaded("mysqli")) {
        $mysql = new Min_PDO_MySQL;
 
 } else {
-       page_header(lang('No MySQL extension'));
+       page_header(lang('No MySQL extension'), null);
        echo "<p class='error'>" . lang('None of supported PHP extensions (%s) are available.', 'mysqli, mysql, pdo') . "</p>\n";
        page_footer("auth");
        exit;
index 9a19018d4ed145572b2d52f924a8a52c7a4c8867..461280df6aa2ca64965e619212d8d5df5e538b9e 100644 (file)
@@ -37,7 +37,7 @@ function auth_error() {
                $_POST["token"] = token();
        }
        unset($_SESSION["usernames"][$_GET["server"]]);
-       page_header(lang('Login'));
+       page_header(lang('Login'), null);
        if (isset($username)) {
                echo "<p class='error'>" . lang('Invalid credentials.') . "</p>\n";
        } elseif (isset($_POST["server"])) {
index 3b7e87e918992095efa4534c7572878afa10e12f..8580df3d2fabf58335d0f66bf810d00a4d914d9f 100644 (file)
@@ -3,7 +3,7 @@ if (!(strlen($_GET["db"]) ? $mysql->select_db($_GET["db"]) : isset($_GET["sql"])
        if (strlen($_GET["db"])) {
                unset($_SESSION["databases"][$_GET["server"]]);
        }
-       page_header(lang('Select database'));
+       page_header(lang('Select database'), (strlen($_GET["db"]) ? false : null));
        if (strlen($_GET["db"])) {
                echo "<p class='error'>" . lang('Invalid database.') . "</p>\n";
        } else {
index 2ac1a29f0e20bd4db4657fb1f8a3256e0c11b789..7257c62a312cdcd9f6683cb4dbd60cb39543b689 100644 (file)
@@ -54,7 +54,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"]) {
        }
        $error = $mysql->error;
 }
-page_header(strlen($_GET["create"]) ? lang('Alter table') . ': ' . htmlspecialchars($_GET["create"]) : lang('Create table'));
+page_header(strlen($_GET["create"]) ? lang('Alter table') : lang('Create table'), array("table" => $_GET["create"]), $_GET["create"]);
 
 $engines = array();
 $result = $mysql->query("SHOW ENGINES");
index 415253ed8bf2edec2452bf8a9bdcc00faa7078d9..2e78ce09cb1bbb186d4477f1f1cb6c400a3bb6eb 100644 (file)
@@ -9,7 +9,7 @@ if ($_POST && !$error) {
        $error = $mysql->error;
 }
 
-page_header(strlen($_GET["createv"]) ? lang('Alter view') . ": " . htmlspecialchars($_GET["createv"]) : lang('Create view'));
+page_header(strlen($_GET["createv"]) ? lang('Alter view') : lang('Create view'), array("view" => $_GET["createv"]), $_GET["createv"]);
 
 if ($_POST) {
        $row = $_POST;
index b13b203249c29515cad2ccfaeeb3b4a25bb05365..bb4a3304f7e520a9f41150f4e88f9fae9d310602 100644 (file)
@@ -29,7 +29,7 @@ if ($_POST && !$error) {
        $error = $mysql->error;
 }
 
-page_header(strlen($_GET["db"]) ? lang('Alter database') . ": " . htmlspecialchars($_GET["db"]) : lang('Create database'));
+page_header(strlen($_GET["db"]) ? lang('Alter database') : lang('Create database'), array(), $_GET["db"]);
 $collations = collations();
 
 if ($_POST) {
index 1d2da28c183d07840df935ac9fbbb5e3d9d06921..2978fdd9dd910bb664cf9fd353021b28bfacc5c7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
-function page_header($title) {
-       global $LANG;
+function page_header($title, $breadcrumb = array(), $title2 = "") {
+       global $SELF, $LANG;
        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">
@@ -9,7 +9,7 @@ function page_header($title) {
 <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 lang('phpMinAdmin') . " - $title"; ?></title>
+<title><?php echo lang('phpMinAdmin') . " - $title" . (strlen($title2) ? ": " . htmlspecialchars($title2) : ""); ?></title>
 <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
 <link rel="stylesheet" type="text/css" href="default.css" />
 <?php if ($_COOKIE["highlight"] == "jush") { ?>
@@ -23,7 +23,22 @@ function page_header($title) {
 
 <div id="content">
 <?php
-       echo "<h2>$title</h2>\n";
+       if (isset($breadcrumb)) {
+               $link = substr(preg_replace('~db=[^&]*&~', '', $SELF), 0, -1);
+               echo '<p><a href="' . (strlen($link) ? htmlspecialchars($link) : ".") . '">' . (isset($_GET["server"]) ? htmlspecialchars($_GET["server"]) : lang('Server')) . '</a> &gt; ';
+               if (is_array($breadcrumb)) {
+                       if (strlen($_GET["db"])) {
+                               echo '<a href="' . substr($SELF, 0, -1) . '">' . htmlspecialchars($_GET["db"]) . '</a> &gt; ';
+                       }
+                       foreach ($breadcrumb as $key => $val) {
+                               if (strlen($val)) {
+                                       echo '<a href="' . htmlspecialchars($SELF) . "$key=" . urlencode($val) . '">' . htmlspecialchars($val) . '</a> &gt; ';
+                               }
+                       }
+               }
+               echo "$title</p>\n";
+       }
+       echo "<h2>$title" . (strlen($title2) ? ": " . htmlspecialchars($title2) : "") . "</h2>\n";
        if ($_SESSION["message"]) {
                echo "<p class='message'>$_SESSION[message]</p>\n";
                $_SESSION["message"] = "";
@@ -39,7 +54,7 @@ function page_footer($missing = false) {
 </div>
 
 <div id="menu">
-<h1><a href="<?php echo ($missing == "auth" ? "http://phpminadmin.sourceforge.net" : (strlen($SELF) > 1 ? htmlspecialchars(substr($SELF, 0, -1)) : ".")); ?>"><?php echo lang('phpMinAdmin'); ?></a></h1>
+<h1><a href="http://phpminadmin.sourceforge.net"><?php echo lang('phpMinAdmin'); ?></a></h1>
 <?php switch_lang(); ?>
 <?php if ($missing != "auth") { ?>
 <p>
index 701ffe51bf81f58a610fa055153f1c55a73ea5e6..a4db711ab421365b56265923ba7752b733dbc85c 100644 (file)
@@ -41,7 +41,7 @@ if ($_POST && !$error) {
        }
        $error = $mysql->error;
 }
-page_header((isset($_GET["default"]) ? lang('Default values') : ($_GET["where"] ? lang('Edit') : lang('Insert'))) . ": " . htmlspecialchars($_GET["edit"]));
+page_header((isset($_GET["default"]) ? lang('Default values') : ($_GET["where"] ? lang('Edit') : lang('Insert'))) . ": " . htmlspecialchars($_GET["edit"]), array((isset($_GET["default"]) ? "table" : "select") => $_GET["edit"]));
 
 if ($_POST) {
        echo "<p class='error'>" . lang('Error during saving') . ": " . htmlspecialchars($error) . "</p>\n";
index 00ce8a6b0f7f85480b1e1997051d9cffdb49e5d3..16967a6c46f2bcbf0af5d5ddb780d043c53bb872 100644 (file)
@@ -25,7 +25,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-
        $error = $mysql->error;
 }
 
-page_header(lang('Foreign key') . ": " . htmlspecialchars($_GET["foreign"]));
+page_header(lang('Foreign key'), array("table" => $_GET["foreign"]), $_GET["foreign"]);
 
 $tables = array();
 $result = $mysql->query("SHOW TABLE STATUS");
index 1e61b5953a97827c13dc43954620ea6f73262caf..ed64cc8742bca07facfe0f616bcc2a9483dbaedc 100644 (file)
--- a/index.php
+++ b/index.php
@@ -79,11 +79,11 @@ if (isset($_GET["dump"])) {
                        include "./processlist.inc.php";
                } else {
                        $TOKENS = array();
-                       page_header(htmlspecialchars(lang('Database') . ": " . $_GET["db"]));
+                       page_header(lang('Database') . ": " . htmlspecialchars($_GET["db"]), false);
                        echo '<p><a href="' . htmlspecialchars($SELF) . 'database=">' . lang('Alter database') . "</a></p>\n";
                        echo '<p><a href="' . htmlspecialchars($SELF) . 'schema=">' . lang('Database schema') . "</a></p>\n";
                        if ($mysql->server_info >= 5) {
-                               echo '<p><a href="' . htmlspecialchars($SELF) . 'procedure=">' . lang('Create view') . "</a></p>\n";
+                               echo '<p><a href="' . htmlspecialchars($SELF) . 'createv=">' . lang('Create view') . "</a></p>\n";
                                echo "<h3>" . lang('Routines') . "</h3>\n";
                                $result = $mysql->query("SELECT * FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = '" . $mysql->escape_string($_GET["db"]) . "'");
                                if ($result->num_rows) {
index f914b46977b7bf10911e44a71f5d4057d177b11d..8da04392150f8f23452d76e0ca5f63723fb10bcb 100644 (file)
@@ -38,7 +38,7 @@ if ($_POST && !$error && !$_POST["add"]) {
        }
        $error = $mysql->error;
 }
-page_header(lang('Indexes') . ': ' . htmlspecialchars($_GET["indexes"]));
+page_header(lang('Indexes'), array("table" => $_GET["indexes"]), $_GET["indexes"]);
 
 $fields = array_keys(fields($_GET["indexes"]));
 if ($_POST) {
index 1b60cdde2e4c8e94588de5bf0d830ca9e68250c6..bd3e1fae6d2839a9593cfaee256fec42c65fb2a6 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-page_header(lang('Database schema') . ": " . htmlspecialchars($_GET["db"]));
+page_header(lang('Database schema'), array(), $_GET["db"]);
 
 $schema = array();
 $result = $mysql->query("SHOW TABLE STATUS");
index acd21518c8e7e42bae8b3949a0591e7b9297228d..4731ff20784a6c5924940338e4904d63e0a3775d 100644 (file)
@@ -16,7 +16,7 @@ if ($_POST && !$error) {
        $error = $mysql->error;
 }
 
-page_header(strlen($_GET["name"]) ? lang('Alter trigger') . ": " . htmlspecialchars($_GET["name"]) : lang('Create trigger'));
+page_header(strlen($_GET["name"]) ? lang('Alter trigger') . ": " . htmlspecialchars($_GET["name"]) : lang('Create trigger'), array("table" => $_GET["trigger"]));
 
 if ($_POST) {
        $row = $_POST;