]> git.joonet.de Git - adminer.git/commitdiff
Support multi-line table comments
authorJakub Vrana <jakub@vrana.cz>
Sun, 23 May 2021 09:38:04 +0000 (11:38 +0200)
committerJakub Vrana <jakub@vrana.cz>
Sun, 23 May 2021 09:38:04 +0000 (11:38 +0200)
adminer/create.inc.php
changes.txt

index 4e57f78db89ea7b445082667e3a926745b5b4ca6..03acfe4240821be0fb048f35c6973e3201e6203e 100644 (file)
@@ -185,11 +185,17 @@ edit_fields($row["fields"], $collations, "TABLE", $foreign_keys);
 <p>
 <?php echo lang('Auto Increment'); ?>: <input type="number" name="Auto_increment" size="6" value="<?php echo h($row["Auto_increment"]); ?>">
 <?php echo checkbox("defaults", 1, ($_POST ? $_POST["defaults"] : adminer_setting("defaults")), lang('Default values'), "columnShow(this.checked, 5)", "jsonly"); ?>
-<?php echo (support("comment")
-       ? checkbox("comments", 1, ($_POST ? $_POST["comments"] : adminer_setting("comments")), lang('Comment'), "editingCommentsClick(this, true);", "jsonly")
-               . ' <input name="Comment" value="' . h($row["Comment"]) . '" data-maxlength="' . (min_version(5.5) ? 2048 : 60) . '">'
+<?php
+$comments = ($_POST ? $_POST["comments"] : adminer_setting("comments"));
+echo (support("comment")
+       ? checkbox("comments", 1, $comments, lang('Comment'), "editingCommentsClick(this, true);", "jsonly")
+               . ' ' . (preg_match('~\n~', $row["Comment"])
+                       ? "<textarea name='Comment' rows='2' cols='20'" . ($comments ? "" : " class='hidden'") . ">" . h($row["Comment"]) . "</textarea>"
+                       : '<input name="Comment" value="' . h($row["Comment"]) . '" data-maxlength="' . (min_version(5.5) ? 2048 : 60) . '"' . ($comments ? "" : " class='hidden'") . '>'
+               )
        : '')
-; ?>
+;
+?>
 <p>
 <input type="submit" value="<?php echo lang('Save'); ?>">
 <?php } ?>
index d5c4c5f673f1b204ce666618cd4434c048fffe1e..a9a2c3d22a9ba7db7c32fd1cee59af38277db1b7 100644 (file)
@@ -1,4 +1,5 @@
 Adminer 4.8.2-dev:
+Support multi-line table comments
 MySQL: Use ST_SRID() instead of SRID() for MySQL 8 (PR #418)
 PostgreSQL PDO: Allow editing rows identified by boolean column (PR #380)