]> git.joonet.de Git - adminer.git/commitdiff
Non-MySQL binary types
authorJakub Vrana <jakub@vrana.cz>
Wed, 26 May 2010 16:07:02 +0000 (18:07 +0200)
committerJakub Vrana <jakub@vrana.cz>
Wed, 26 May 2010 16:10:11 +0000 (18:10 +0200)
adminer/include/adminer.inc.php
adminer/include/functions.inc.php
adminer/select.inc.php

index ecca3d8751e287e521308dac402c61e47372d1f9..f2466c08c65271452df426c5dd754a9a75b3d228 100644 (file)
@@ -151,7 +151,7 @@ document.getElementById('username').focus();
        */
        function selectVal($val, $link, $field) {
                $return = ($val != "<i>NULL</i>" && $field["type"] == "char" ? "<code>$val</code>" : $val);
-               if (ereg('binary|blob|bytea', $field["type"]) && !is_utf8($val)) {
+               if (ereg('binary|blob|bytea|raw|file', $field["type"]) && !is_utf8($val)) {
                        $return = lang('%d byte(s)', strlen($val));
                }
                return ($link ? "<a href='$link'>$return</a>" : $return);
index ab06932ba63a77559269ecff0278f9610c9fd97a..743ecfd0c2ed7d46b9663de74a73c4cb00ff22f8 100644 (file)
@@ -562,9 +562,9 @@ function input($field, $value, $function) {
                                $checked = (is_int($value) ? ($value >> $i) & 1 : in_array($val, explode(",", $value), true));
                                echo " <label><input type='checkbox' name='fields[$name][$i]' value='" . (1 << $i) . "'" . ($checked ? ' checked' : '') . "$onchange>" . h($val) . '</label>';
                        }
-               } elseif (ereg('binary|blob|bytea', $field["type"]) && ini_bool("file_uploads")) {
+               } elseif (ereg('binary|blob|bytea|raw|file', $field["type"]) && ini_bool("file_uploads")) {
                        echo "<input type='file' name='fields-$name'$onchange>";
-               } elseif (ereg('text|blob', $field["type"])) {
+               } elseif (ereg('text|lob', $field["type"])) {
                        echo "<textarea " . ($jush != "sqlite" || ereg("\n", $value) ? "cols='50' rows='12'" : "cols='30' rows='1' style='height: 1.2em;'") . "$attrs>" . h($value) . '</textarea>'; // 1.2em - line-height
                } else {
                        // int(3) is only a display hint
@@ -604,7 +604,7 @@ function process_input($field) {
        if ($field["type"] == "set") {
                return array_sum((array) $value);
        }
-       if (ereg('binary|blob|bytea', $field["type"]) && ini_bool("file_uploads")) {
+       if (ereg('binary|blob|bytea|raw|file', $field["type"]) && ini_bool("file_uploads")) {
                $file = get_file("fields-$idf");
                if (!is_string($file)) {
                        return false; //! report errors
index 2380fa26400d262b084dd9973f86450f60cf7958..df2eed787d9048dfc178c4a6ebd34034f82e73f0 100644 (file)
@@ -12,7 +12,7 @@ foreach ($fields as $key => $field) {
        $name = $adminer->fieldName($field);
        if (isset($field["privileges"]["select"]) && $name != "") {
                $columns[$key] = html_entity_decode(strip_tags($name));
-               if (ereg('text|clob|blob', $field["type"])) {
+               if (ereg('text|lob', $field["type"])) {
                        $text_length = $adminer->selectLengthProcess();
                }
        }
@@ -280,7 +280,7 @@ if (!$columns) {
                                                if (!isset($val)) {
                                                        $val = "<i>NULL</i>";
                                                } else {
-                                                       if (ereg('binary|blob|bytea', $field["type"]) && $val != "") {
+                                                       if (ereg('binary|blob|bytea|raw|file', $field["type"]) && $val != "") {
                                                                $link = h(ME . 'download=' . urlencode($TABLE) . '&field=' . urlencode($key) . $unique_idf);
                                                        }
                                                        if ($val == "") {
@@ -331,7 +331,7 @@ if (!$columns) {
                                                $h_value = h(isset($value) ? $value : $row[$key]);
                                                $long = strpos($val, "<i>...</i>");
                                                $editable = is_utf8($val) && !$long && $rows[$n][$key] == $row[$key] && !$functions[$key];
-                                               $text = ereg('text|blob', $field["type"]);
+                                               $text = ereg('text|lob', $field["type"]);
                                                echo (($_GET["modify"] && $editable) || isset($value)
                                                        ? "<td>" . ($text ? "<textarea name='$id' cols='30' rows='" . (substr_count($row[$key], "\n") + 1) . "'>$h_value</textarea>" : "<input name='$id' value='$h_value' size='$lengths[$key]'>")
                                                        : "<td id='$id' ondblclick=\"" . ($editable ? "selectDblClick(this, event" . ($text ? ", 1" : "") . ")" : "alert('" . ($long ? lang('Increase text length to modify this value.') : lang('Use edit link to modify this value.')) . "')") . ";\">" . $adminer->selectVal($val, $link, $field)