From d144e9c30a1ef286429a56a413f129f3766028fa Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Sat, 19 Sep 2009 19:31:16 +0000 Subject: [PATCH] Save bytes git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1114 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/include/editing.inc.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index 56f08e44..8d21b373 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -130,14 +130,15 @@ function process_field($field, $type_field) { } 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'"; + foreach (array( + 'char' => 'text', + 'date' => 'time|year', + 'binary' => 'blob', + 'enum' => 'set', + ) as $key => $val) { + if (ereg("$key|$val", $type) { + return " class='$key'"; + } } }