Browse files

Save bytes

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1114 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
1 parent d4e7cda commit d144e9c30a1ef286429a56a413f129f3766028fa jakubvrana committed Sep 19, 2009
Showing with 9 additions and 8 deletions.
  1. +9 −8 adminer/include/editing.inc.php
View
17 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'";
+ }
}
}

0 comments on commit d144e9c

Please sign in to comment.