1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-16 11:34:10 +02:00

Display images in Editor

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@898 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-07-24 10:14:36 +00:00
parent 78e49f0106
commit 97b8c7b666
3 changed files with 15 additions and 8 deletions

View File

@@ -108,10 +108,14 @@ function adminer_row_descriptions($rows, $foreign_keys) {
}
function adminer_select_val($val, $link, $field) {
return call_adminer('select_val', ($link
? "<a href=\"$link\">$val</a>"
: ($val == "<i>NULL</i>" ? "&nbsp;" : $val)
), $val, $link);
$return = ($val == "<i>NULL</i>" ? "&nbsp;" : $val);
if (ereg('blob|binary', $field["type"]) && !is_utf8($val)) {
$return = lang('%d byte(s)', strlen($val));
if (ereg("^(GIF|\xFF\xD8\xFF|\x89\x50\x4E\x47\x0D\x0A\x1A\x0A)", $val)) { // GIF|JPG|PNG, getimagetype() works with filename
$return = "<img src=\"$link\" alt='$return'>";
}
}
return call_adminer('select_val', ($link ? "<a href=\"$link\">$return</a>" : $return), $val, $link);
}
function adminer_message_query($query) {