From d6e3fc710d67838fb13ee5157f9d8d8a0e6b2b22 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Wed, 22 Jul 2009 13:58:54 +0000 Subject: [PATCH] Link e-mails git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@878 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/select.inc.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 98ef9e81..2f2987f0 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -304,9 +304,10 @@ if (!$columns) { $unique_idf = implode('&', unique_idf($row, $indexes)); //! don't use aggregation functions echo '' . (count($select) != count($group) || information_schema($_GET["db"]) ? '' : ' ' . lang('edit') . ''); foreach ($row as $key => $val) { - if (strlen(adminer_field_name($fields, $key))) { - if (strlen($val) && (!isset($email_fields[$key]) || $email_fields[$key])) { - $email_fields[$key] = is_email($val); //! filled e-mails may be contained on other pages + $name = adminer_field_name($fields, $key); + if (strlen($name)) { + if (strlen($val) && (!isset($email_fields[$key]) || strlen($email_fields[$key]))) { + $email_fields[$key] = (is_email($val) ? $name : ""); //! filled e-mails may be contained on other pages } $link = ""; if (!isset($val)) { @@ -337,6 +338,9 @@ if (!$columns) { } } } + if (!$link && is_email($val)) { + $link = "mailto:$val"; + } $val = adminer_select_val($val, $link); echo "$val"; } @@ -383,13 +387,13 @@ if (!$columns) { echo "
" . lang('CSV Import') . "
\n"; //! Editor only - $email_fields = array_filter($email_fields); + $email_fields = array_filter($email_fields); //! should use strlen but compile.php doesn't support array_filter if ($email_fields) { echo '
' . lang('E-mail') . "
\n"; }