From 3015aed76b47df78436733b7bd8126272c5822fb Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Tue, 14 Jul 2009 08:45:24 +0000 Subject: [PATCH] Separate type_class git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@824 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/include/editing.inc.php | 12 ++++++++++++ adminer/schema.inc.php | 14 +------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index b8ef821e..7bd2e960 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -38,6 +38,18 @@ function process_type($field, $collate = "COLLATE") { ; } +function type_class($type) { + if (ereg('char|text', $type)) { + return " class='char'"; + } elseif (ereg('date|time|year', $type)) { + return " class='date'"; + } elseif (ereg('binary|blob', $type)) { + return " class='binary'"; + } elseif (ereg('enum|set', $type)) { + return " class='enum'"; + } +} + function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $foreign_keys = array()) { global $inout; $column_comments = false; diff --git a/adminer/schema.inc.php b/adminer/schema.inc.php index 6452561a..bcc91dc6 100644 --- a/adminer/schema.inc.php +++ b/adminer/schema.inc.php @@ -62,19 +62,7 @@ foreach ($schema as $name => $table) { echo "
"; echo '' . htmlspecialchars($name) . "
\n"; foreach ($table["fields"] as $field) { - $val = htmlspecialchars($field["field"]); - $title = ' title="' . htmlspecialchars($field["full_type"] . ($field["null"] ? " " . lang('NULL') : '')) . '"'; - if (ereg('char|text', $field["type"])) { - $val = "$val"; - } elseif (ereg('date|time|year', $field["type"])) { - $val = "$val"; - } elseif (ereg('binary|blob', $field["type"])) { - $val = "$val"; - } elseif (ereg('enum|set', $field["type"])) { - $val = "$val"; - } else { - $val = "$val"; - } + $val = '' . htmlspecialchars($field["field"]) . ''; echo ($field["primary"] ? "$val" : $val) . "
\n"; } foreach ((array) $table["references"] as $target_name => $refs) {