Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Separate type_class

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@824 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
commit 3015aed76b47df78436733b7bd8126272c5822fb 1 parent acaa05d
jakubvrana authored
Showing with 13 additions and 13 deletions.
  1. +12 −0 adminer/include/editing.inc.php
  2. +1 −13 adminer/schema.inc.php
12 adminer/include/editing.inc.php
View
@@ -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;
14 adminer/schema.inc.php
View
@@ -62,19 +62,7 @@
echo "<div class='table' style='top: " . $table["pos"][0] . "em; left: " . $table["pos"][1] . "em;' onmousedown='schema_mousedown(this, event);'>";
echo '<a href="' . htmlspecialchars($SELF) . 'table=' . urlencode($name) . '"><strong>' . htmlspecialchars($name) . "</strong></a><br>\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 = "<span class='char'$title>$val</span>";
- } elseif (ereg('date|time|year', $field["type"])) {
- $val = "<span class='date'$title>$val</span>";
- } elseif (ereg('binary|blob', $field["type"])) {
- $val = "<span class='binary'$title>$val</span>";
- } elseif (ereg('enum|set', $field["type"])) {
- $val = "<span class='enum'$title>$val</span>";
- } else {
- $val = "<span$title>$val</span>";
- }
+ $val = '<span' . type_class($field["type"]) . ' title="' . htmlspecialchars($field["full_type"] . ($field["null"] ? " " . lang('NULL') : '')) . '">' . htmlspecialchars($field["field"]) . '</span>';
echo ($field["primary"] ? "<em>$val</em>" : $val) . "<br>\n";
}
foreach ((array) $table["references"] as $target_name => $refs) {
Please sign in to comment.
Something went wrong with that request. Please try again.