Optimize size
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@502 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
80ebf88293
commit
9edb147a8e
|
@ -35,7 +35,7 @@ function toggle(id) {
|
||||||
}
|
}
|
||||||
foreach ($breadcrumb as $key => $val) {
|
foreach ($breadcrumb as $key => $val) {
|
||||||
if (strlen($val)) {
|
if (strlen($val)) {
|
||||||
echo '<a href="' . htmlspecialchars($SELF) . "$key=" . ($key != "privileges" ? urlencode($val) : "") . '">' . htmlspecialchars($val) . '</a> » ';
|
echo '<a href="' . htmlspecialchars("$SELF$key=") . ($key != "privileges" ? urlencode($val) : "") . '">' . htmlspecialchars($val) . '</a> » ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
$where = where($_GET);
|
$where = where($_GET);
|
||||||
|
$update = ($where && !$_GET["clone"]);
|
||||||
$fields = fields($_GET["edit"]);
|
$fields = fields($_GET["edit"]);
|
||||||
foreach ($fields as $name => $field) {
|
foreach ($fields as $name => $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]);
|
unset($fields[$name]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +30,7 @@ if ($_POST && !$error) {
|
||||||
}
|
}
|
||||||
if (isset($_GET["default"])) {
|
if (isset($_GET["default"])) {
|
||||||
query_redirect("ALTER TABLE " . idf_escape($_GET["edit"]) . implode(",", $set), $location, lang('Default values has been set.'));
|
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.'));
|
query_redirect("UPDATE " . idf_escape($_GET["edit"]) . " SET " . implode(", ", $set) . " WHERE " . implode(" AND ", $where) . " LIMIT 1", $location, lang('Item has been updated.'));
|
||||||
} else {
|
} else {
|
||||||
query_redirect("INSERT INTO " . idf_escape($_GET["edit"]) . " SET " . implode(", ", $set), $location, lang('Item has been inserted.'));
|
query_redirect("INSERT INTO " . idf_escape($_GET["edit"]) . " SET " . implode(", ", $set), $location, lang('Item has been inserted.'));
|
||||||
|
@ -94,8 +95,8 @@ if ($fields) {
|
||||||
<input type="hidden" name="token" value="<?php echo $token; ?>" />
|
<input type="hidden" name="token" value="<?php echo $token; ?>" />
|
||||||
<?php if ($fields) { ?>
|
<?php if ($fields) { ?>
|
||||||
<input type="submit" value="<?php echo lang('Save'); ?>" />
|
<input type="submit" value="<?php echo lang('Save'); ?>" />
|
||||||
<?php if (!isset($_GET["default"])) { ?><input type="submit" name="insert" value="<?php echo ($where && !$_GET["clone"] ? lang('Save and continue edit') : lang('Save and insert next')); ?>" /><?php } ?>
|
<?php if (!isset($_GET["default"])) { ?><input type="submit" name="insert" value="<?php echo ($update ? lang('Save and continue edit') : lang('Save and insert next')); ?>" /><?php } ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if ($where && !$_GET["clone"]) { ?> <input type="submit" name="delete" value="<?php echo lang('Delete'); ?>" onclick="return confirm('<?php echo lang('Are you sure?'); ?>');" /><?php } ?>
|
<?php if ($update) { ?> <input type="submit" name="delete" value="<?php echo lang('Delete'); ?>" onclick="return confirm('<?php echo lang('Are you sure?'); ?>');" /><?php } ?>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -159,9 +159,8 @@ if (isset($_GET["download"])) {
|
||||||
while ($row = $result->fetch_assoc()) {
|
while ($row = $result->fetch_assoc()) {
|
||||||
echo '<tr class="nowrap"><td>' . (isset($row["Rows"]) ? '<input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . '"' . (in_array($row["Name"], (array) $_POST["tables"], true) ? ' checked="checked"' : '') . ' /></td><th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th><td align='left'>$row[Engine]</td><td align='left'>$row[Collation]" : ' </td><th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="6">' . lang('View'));
|
echo '<tr class="nowrap"><td>' . (isset($row["Rows"]) ? '<input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . '"' . (in_array($row["Name"], (array) $_POST["tables"], true) ? ' checked="checked"' : '') . ' /></td><th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th><td align='left'>$row[Engine]</td><td align='left'>$row[Collation]" : ' </td><th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="6">' . lang('View'));
|
||||||
$row["count"] = $mysql->result($mysql->query("SELECT COUNT(*) FROM " . idf_escape($row["Name"])));
|
$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) {
|
foreach ((isset($row["Rows"]) ? array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create") : array()) + array("count" => "select") as $key => $link) {
|
||||||
$num = (strlen($row[$key]) ? number_format($row[$key], 0, '.', lang(',')) : ' ');
|
echo '</td><td align="right">' . (isset($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($row["Name"]) . '">' . number_format($row[$key], 0, '.', lang(',')) . '</a>' : ' ');
|
||||||
echo '</td><td align="right">' . ($link ? '<a href="' . htmlspecialchars($SELF) . "$link=" . urlencode($row["Name"]) . '">' . "$num</a>" : $num);
|
|
||||||
}
|
}
|
||||||
echo "</td></tr>\n";
|
echo "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
@ -181,8 +180,8 @@ if (isset($_GET["download"])) {
|
||||||
while ($row = $result->fetch_assoc()) {
|
while ($row = $result->fetch_assoc()) {
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<td>" . htmlspecialchars($row["ROUTINE_TYPE"]) . "</td>";
|
echo "<td>" . htmlspecialchars($row["ROUTINE_TYPE"]) . "</td>";
|
||||||
echo '<th><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf' : 'call') . '=' . urlencode($row["ROUTINE_NAME"]) . '">' . htmlspecialchars($row["ROUTINE_NAME"]) . '</a></th>';
|
echo '<th><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'callf=' : 'call=') . urlencode($row["ROUTINE_NAME"]) . '">' . htmlspecialchars($row["ROUTINE_NAME"]) . '</a></th>';
|
||||||
echo '<td><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function' : 'procedure') . '=' . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a></td>";
|
echo '<td><a href="' . htmlspecialchars($SELF) . ($row["ROUTINE_TYPE"] == "FUNCTION" ? 'function=' : 'procedure=') . urlencode($row["ROUTINE_NAME"]) . '">' . lang('Alter') . "</a></td>";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
}
|
}
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
|
|
Loading…
Reference in a new issue