]> git.joonet.de Git - adminer.git/commitdiff
Plugin which shows sql structure comments in field names title
authorAdam Kusmierz <adam@kusmierz.be>
Tue, 20 Dec 2016 08:43:55 +0000 (09:43 +0100)
committerJakub Vrana <jakub@vrana.cz>
Sat, 18 Feb 2017 16:32:40 +0000 (17:32 +0100)
plugins/struct-comments.php [new file with mode: 0644]

diff --git a/plugins/struct-comments.php b/plugins/struct-comments.php
new file mode 100644 (file)
index 0000000..919fa68
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+
+/** Show comments of sql structure in more places (mainly where you edit things)
+ * @link https://www.adminer.org/plugins/#use
+ * @author Adam KuĊ›mierz, http://kusmierz.be/
+ * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
+ * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
+ */
+class AdminerStructComments {
+
+       function fieldName(&$field, $order = 0) {
+               return '<span title="' . h($field["full_type"]) . (!empty($field["comment"]) ? ': ' . $field["comment"] : '') . '">' . h($field["field"]) . '</span>';
+       }
+}