]> git.joonet.de Git - adminer.git/commitdiff
Use  
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 11 Jun 2009 11:17:53 +0000 (11:17 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Thu, 11 Jun 2009 11:17:53 +0000 (11:17 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@667 7c3ca157-0c34-0410-bff1-cbf682f78f5c

event.inc.php
include/editing.inc.php
include/functions.inc.php
index.php
privileges.inc.php
processlist.inc.php
select.inc.php
table.inc.php
user.inc.php

index 94fdd51d67c47ef65f17a6cb0d4887c9a2d7ec69..4eb53b42c67df0bd5571c88606cc01013023152c 100644 (file)
@@ -43,7 +43,7 @@ if ($_POST) {
 <tr><th><?php echo lang('Every'); ?></th><td><input name="INTERVAL_VALUE" value="<?php echo htmlspecialchars($row["INTERVAL_VALUE"]); ?>" size="6" /> <select name="INTERVAL_FIELD"><?php echo optionlist($intervals, $row["INTERVAL_FIELD"]); ?></select></td></tr>
 <tr><th><?php echo lang('Status'); ?></th><td><select name="STATUS"><?php echo optionlist($statuses, $row["STATUS"]); ?></select></td></tr>
 <tr><th><?php echo lang('Comment'); ?></th><td><input name="EVENT_COMMENT" value="<?php echo htmlspecialchars($row["EVENT_COMMENT"]); ?>" maxlength="64" /></td></tr>
-<tr><th></th><td><label><input type="checkbox" name="ON_COMPLETION" value="PRESERVE"<?php echo ($row["ON_COMPLETION"] == "PRESERVE" ? " checked='checked'" : ""); ?> /><?php echo lang('On completion preserve'); ?></label></td></tr>
+<tr><th>&nbsp;</th><td><label><input type="checkbox" name="ON_COMPLETION" value="PRESERVE"<?php echo ($row["ON_COMPLETION"] == "PRESERVE" ? " checked='checked'" : ""); ?> /><?php echo lang('On completion preserve'); ?></label></td></tr>
 </table>
 <p><textarea name="EVENT_DEFINITION" rows="10" cols="80" style="width: 98%;"><?php echo htmlspecialchars($row["EVENT_DEFINITION"]); ?></textarea></p>
 <p>
index f40ffb6e1b80e0d0a3450e1646083591f21d0534..a55e9612059f0962f3db3414d92503cc380c82f1 100644 (file)
@@ -4,7 +4,7 @@ function input($name, $field, $value, $separator = "</td><td>") { //! pass empty
        $name = htmlspecialchars(bracket_escape($name));
        echo "<td" . ($separator ? " class='function'" : "") . ">";
        if ($field["type"] == "enum") {
-               echo $separator . (isset($_GET["select"]) ? ' <label><input type="radio" name="fields[' . $name . ']" value="-1" checked="checked" /><em>' . lang('original') . '</em></label>' : "");
+               echo ($separator ? "&nbsp;$separator" : "") . (isset($_GET["select"]) ? ' <label><input type="radio" name="fields[' . $name . ']" value="-1" checked="checked" /><em>' . lang('original') . '</em></label>' : "");
                if ($field["null"] || isset($_GET["default"])) {
                        echo ' <label><input type="radio" name="fields[' . $name . ']" value=""' . (($field["null"] ? isset($value) : strlen($value)) || isset($_GET["select"]) ? '' : ' checked="checked"') . ' />' . ($field["null"] ? '<em>NULL</em>' : '') . '</label>';
                }
@@ -42,7 +42,7 @@ function input($name, $field, $value, $separator = "</td><td>") { //! pass empty
                if ($field["null"] || isset($_GET["default"])) {
                        array_unshift($options, "NULL");
                }
-               echo (count($options) > 1 || isset($_GET["select"]) ? '<select name="function[' . $name . ']">' . (isset($_GET["select"]) ? '<option value="orig">' . lang('original') . '</option>' : '') . optionlist($options, (isset($value) ? (string) $_POST["function"][$name] : null)) . '</select>' : "") . $separator;
+               echo (count($options) > 1 || isset($_GET["select"]) ? '<select name="function[' . $name . ']">' . (isset($_GET["select"]) ? '<option value="orig">' . lang('original') . '</option>' : '') . optionlist($options, (isset($value) ? (string) $_POST["function"][$name] : null)) . '</select>' : ($separator ? "&nbsp;" : "")) . $separator;
                if ($field["type"] == "set") { //! 64 bits
                        preg_match_all("~'((?:[^']+|'')*)'~", $field["length"], $matches);
                        foreach ($matches[1] as $i => $val) {
index 330b06cf986ec56ff7cfd9f0766f7f5c21ec797e..34e32a304091117abf8682dfe73ffaf176247cec 100644 (file)
@@ -201,6 +201,8 @@ function select($result, $dbh2 = null) {
                                } else {
                                        if ($blobs[$key] && !is_utf8($val)) {
                                                $val = "<i>" . lang('%d byte(s)', strlen($val)) . "</i>"; //! link to download
+                                       } elseif (!strlen(trim($val))) {
+                                               $val = "&nbsp;";
                                        } else {
                                                $val = nl2br(htmlspecialchars($val));
                                                if ($types[$key] == 254) {
index 8b91c6b6bc0d4b87052ee21926f726b859002b82..02b5273723a0536e8533e0d517f1dd7e7ed47ff2 100644 (file)
--- a/index.php
+++ b/index.php
@@ -176,11 +176,11 @@ if (isset($_GET["download"])) {
                                                echo '<input type="checkbox" name="tables[]" value="' . htmlspecialchars($row["Name"]) . '"' . (in_array($row["Name"], (array) $_POST["tables"], true) ? ' checked="checked"' : '') . ' onclick="form_uncheck(\'check-all\');" /></td><th><a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . "</a></th><td>$row[Engine]</td><td>$row[Collation]</td>";
                                                foreach (array("Data_length" => "create", "Index_length" => "indexes", "Data_free" => "edit", "Auto_increment" => "create", "Rows" => "select") as $key => $link) {
                                                        $val = number_format($row[$key], 0, '.', lang(','));
-                                                       echo '<td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($row["Name"]) . '">' . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val) . '</a>' : '') . '</td>';
+                                                       echo '<td align="right">' . (strlen($row[$key]) ? '<a href="' . htmlspecialchars("$SELF$link=") . urlencode($row["Name"]) . '">' . ($key == "Rows" && $row["Engine"] == "InnoDB" && $val ? lang('~ %s', $val) : $val) . '</a>' : '&nbsp;') . '</td>';
                                                }
-                                               echo "<td>" . htmlspecialchars($row["Comment"]) . "</td>";
+                                               echo "<td>" . (strlen(trim($row["Comment"])) ? htmlspecialchars($row["Comment"]) : "&nbsp;") . "</td>";
                                        } else {
-                                               echo '<th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="8"><a href="' . htmlspecialchars($SELF) . "select=" . urlencode($row["Name"]) . '">' . lang('View') . '</a></td>';
+                                               echo '&nbsp;</td><th><a href="' . htmlspecialchars($SELF) . 'view=' . urlencode($row["Name"]) . '">' . htmlspecialchars($row["Name"]) . '</a></th><td colspan="8"><a href="' . htmlspecialchars($SELF) . "select=" . urlencode($row["Name"]) . '">' . lang('View') . '</a></td>';
                                        }
                                        echo "</tr>\n";
                                }
index 5d1a6140e3381c3892d7d60cd55c526d93f91ec5..c026b3788c19bbad88bf72685c9e34f4fbb5747d 100644 (file)
@@ -15,7 +15,7 @@ if (!$result) {
        $result = $dbh->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
 }
 echo "<table cellspacing='0'>\n";
-echo "<thead><tr><th></th><th>" . lang('Username') . "</th><th>" . lang('Server') . "</th></tr></thead>\n";
+echo "<thead><tr><th>&nbsp;</th><th>" . lang('Username') . "</th><th>" . lang('Server') . "</th></tr></thead>\n";
 while ($row = $result->fetch_assoc()) {
        echo '<tr' . odd() . '><td><a href="' . htmlspecialchars($SELF) . 'user=' . urlencode($row["User"]) . '&amp;host=' . urlencode($row["Host"]) . '">' . lang('edit') . '</a></td><td>' . htmlspecialchars($row["User"]) . "</td><td>" . htmlspecialchars($row["Host"]) . "</td></tr>\n";
 }
index b5c881507a870eebc8111b4b9d03ec576bae9baf..aea5c2c41073aecf6a18cb929770c5bbbaddaca1 100644 (file)
@@ -17,7 +17,7 @@ page_header(lang('Process list'), $error);
 $result = $dbh->query("SHOW PROCESSLIST");
 for ($i=0; $row = $result->fetch_assoc(); $i++) {
        if (!$i) {
-               echo "<thead><tr lang='en'><th></th><th>" . implode("</th><th>", array_keys($row)) . "</th></tr></thead>\n";
+               echo "<thead><tr lang='en'><th>&nbsp;</th><th>" . implode("</th><th>", array_keys($row)) . "</th></tr></thead>\n";
        }
        echo "<tr" . odd() . "><td><input type='checkbox' name='kill[]' value='$row[Id]' /></td><td>" . implode("</td><td>", $row) . "</td></tr>\n";
 }
index 59556f2d84cf7d90a63c7a3749d342d58acb88e2..b6a93752f0492e6bbf389ec335df6a558a24433e 100644 (file)
@@ -249,7 +249,9 @@ if (!$columns) {
                                        } elseif (preg_match('~blob|binary~', $fields[$key]["type"]) && !is_utf8($val)) {
                                                $val = '<a href="' . htmlspecialchars($SELF) . 'download=' . urlencode($_GET["select"]) . '&amp;field=' . urlencode($key) . '&amp;' . $unique_idf . '">' . lang('%d byte(s)', strlen($val)) . '</a>';
                                        } else {
-                                               if (intval($text_length) > 0 && preg_match('~blob|text~', $fields[$key]["type"])) {
+                                               if (!strlen(trim($val))) {
+                                                       $val = "&nbsp;";
+                                               } elseif (intval($text_length) > 0 && preg_match('~blob|text~', $fields[$key]["type"])) {
                                                        $val = shorten_utf8($val, intval($text_length));
                                                } else {
                                                        $val = nl2br(htmlspecialchars($val));
index 7c13a05db8f7e7d57ed749dbfde1356758dd3865..682730bd763329de0d1fee9c79ba1dd4b5665ced 100644 (file)
@@ -52,7 +52,7 @@ if ($result) {
                                $link = (strlen($foreign_key["db"]) ? "<strong>" . htmlspecialchars($foreign_key["db"]) . "</strong>." : "") . htmlspecialchars($foreign_key["table"]);
                                echo '<td><a href="' . htmlspecialchars(strlen($foreign_key["db"]) ? preg_replace('~db=[^&]*~', "db=" . urlencode($foreign_key["db"]), $SELF) : $SELF) . "table=" . urlencode($foreign_key["table"]) . "\">$link</a>";
                                echo "(<em>" . implode("</em>, <em>", array_map('htmlspecialchars', $foreign_key["target"])) . "</em>)</td>";
-                               echo '<td>' . (!strlen($foreign_key["db"]) ? '<a href="' . htmlspecialchars($SELF) . 'foreign=' . urlencode($_GET["table"]) . '&amp;name=' . urlencode($name) . '">' . lang('Alter') . '</a>' : '') . '</td>';
+                               echo '<td>' . (!strlen($foreign_key["db"]) ? '<a href="' . htmlspecialchars($SELF) . 'foreign=' . urlencode($_GET["table"]) . '&amp;name=' . urlencode($name) . '">' . lang('Alter') . '</a>' : '&nbsp;') . '</td>';
                                echo "</tr>\n";
                        }
                        echo "</table>\n";
index 75be75231caa47256d4d11c67645b8b9c4513938..b7dc681cf602fe295216b42839e8e26f6118e350 100644 (file)
@@ -162,7 +162,7 @@ foreach (array(
                        $name = '"grants[' . $i . '][' . htmlspecialchars(strtoupper($privilege)) . ']"';
                        $value = $grant[strtoupper($privilege)];
                        if ($context == "Server Admin" && $object != (isset($grants["*.*"]) ? "*.*" : "")) {
-                               echo "<td></td>";
+                               echo "<td>&nbsp;</td>";
                        } elseif (isset($_GET["grant"])) {
                                echo "<td><select name=$name><option></option><option value='1'" . ($value ? " selected='selected'" : "") . ">" . lang('Grant') . "</option><option value='0'" . ($value == "0" ? " selected='selected'" : "") . ">" . lang('Revoke') . "</option></select></td>";
                        } else {