From 9edb147a8eb645959b7a4a7de37f975d79c14f40 Mon Sep 17 00:00:00 2001
From: jakubvrana
Date: Sat, 27 Sep 2008 08:52:18 +0000
Subject: [PATCH] Optimize size
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@502 7c3ca157-0c34-0410-bff1-cbf682f78f5c
---
design.inc.php | 2 +-
edit.inc.php | 9 +++++----
index.php | 9 ++++-----
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/design.inc.php b/design.inc.php
index 433d36a5..7518b175 100644
--- a/design.inc.php
+++ b/design.inc.php
@@ -35,7 +35,7 @@ function toggle(id) {
}
foreach ($breadcrumb as $key => $val) {
if (strlen($val)) {
- echo '' . htmlspecialchars($val) . ' » ';
+ echo '' . htmlspecialchars($val) . ' » ';
}
}
}
diff --git a/edit.inc.php b/edit.inc.php
index 053cb64c..564b88a7 100644
--- a/edit.inc.php
+++ b/edit.inc.php
@@ -1,8 +1,9 @@
$field) {
- if (isset($_GET["default"]) ? $field["auto_increment"] || preg_match('~text|blob~', $field["type"]) : !isset($field["privileges"][$where && !$_GET["clone"] ? "update" : "insert"])) {
+ if (isset($_GET["default"]) ? $field["auto_increment"] || preg_match('~text|blob~', $field["type"]) : !isset($field["privileges"][$update ? "update" : "insert"])) {
unset($fields[$name]);
}
}
@@ -29,7 +30,7 @@ if ($_POST && !$error) {
}
if (isset($_GET["default"])) {
query_redirect("ALTER TABLE " . idf_escape($_GET["edit"]) . implode(",", $set), $location, lang('Default values has been set.'));
- } elseif ($where && !$_GET["clone"]) {
+ } elseif ($update) {
query_redirect("UPDATE " . idf_escape($_GET["edit"]) . " SET " . implode(", ", $set) . " WHERE " . implode(" AND ", $where) . " LIMIT 1", $location, lang('Item has been updated.'));
} else {
query_redirect("INSERT INTO " . idf_escape($_GET["edit"]) . " SET " . implode(", ", $set), $location, lang('Item has been inserted.'));
@@ -94,8 +95,8 @@ if ($fields) {
-" />
+
-
+
diff --git a/index.php b/index.php
index fe6f5bfe..87fd6edb 100644
--- a/index.php
+++ b/index.php
@@ -159,9 +159,8 @@ if (isset($_GET["download"])) {
while ($row = $result->fetch_assoc()) {
echo '' . (isset($row["Rows"]) ? ' | ' . htmlspecialchars($row["Name"]) . " | $row[Engine] | $row[Collation]" : ' | ' . htmlspecialchars($row["Name"]) . ' | ' . lang('View'));
$row["count"] = $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($row["Name"])));
- foreach ((isset($row["Rows"]) ? array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "", "Auto_increment" => "") : array()) + array("count" => "select") as $key => $link) {
- $num = (strlen($row[$key]) ? number_format($row[$key], 0, '.', lang(',')) : ' ');
- echo ' | ' . ($link ? '' . "$num" : $num);
+ foreach ((isset($row["Rows"]) ? array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create") : array()) + array("count" => "select") as $key => $link) {
+ echo ' | ' . (isset($row[$key]) ? '' . number_format($row[$key], 0, '.', lang(',')) . '' : ' ');
}
echo " |
\n";
}
@@ -181,8 +180,8 @@ if (isset($_GET["download"])) {
while ($row = $result->fetch_assoc()) {
echo "";
echo "" . htmlspecialchars($row["ROUTINE_TYPE"]) . " | ";
- echo '' . htmlspecialchars($row["ROUTINE_NAME"]) . ' | ';
- echo '' . lang('Alter') . " | ";
+ echo '' . htmlspecialchars($row["ROUTINE_NAME"]) . ' | ';
+ echo '' . lang('Alter') . " | ";
echo "
\n";
}
echo "\n";