Displays mail icon if an adress can receive snail mail.
authorStéphane Jacob <sj@m4x.org>
Mon, 28 Nov 2011 13:28:40 +0000 (14:28 +0100)
committerStéphane Jacob <sj@m4x.org>
Mon, 28 Nov 2011 14:31:26 +0000 (15:31 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
htdocs/images/icons/email_open.gif [new file with mode: 0644]
plugins/function.display_address.php

diff --git a/htdocs/images/icons/email_open.gif b/htdocs/images/icons/email_open.gif
new file mode 100644 (file)
index 0000000..2b72ce7
Binary files /dev/null and b/htdocs/images/icons/email_open.gif differ
index 02e1edc..6728ee1 100644 (file)
@@ -69,6 +69,11 @@ function smarty_function_display_address($param, $smarty)
     $map = "<a href=\"http://maps.google.fr/?q="
         .   urlencode(implode(", ", $lines) . " ($idt)")
         . "\"><img src=\"images/icons/map.gif\" alt=\"Google Maps\" title=\"Carte\"/></a>";
+    if ($adr->flags->hasflag('mail')) {
+        $mail = '&nbsp;<img src="images/icons/email_open.gif" alt="Adresse courier" title="On peut lui envoyer du courier à cette adresse." />';
+    } else {
+        $mail = '';
+    }
     $comment = "";
     if ($adr->comment != "")
     {
@@ -89,9 +94,9 @@ function smarty_function_display_address($param, $smarty)
     if ($param['titre'])
     {
         if ($param['titre_div'])
-            $txthtml .= "<div class='titre'>".pl_entity_decode($param['titre'])."&nbsp;".$map.$comment."</div>\n";
+            $txthtml .= '<div class="titre">' . pl_entity_decode($param['titre']) . '&nbsp;' . $map . $mail . $comment . "</div>\n";
         else
-            $txthtml .= "<em>".pl_entity_decode($param['titre'])."&nbsp;</em>".$map.$comment."<br />\n";
+            $txthtml .= '<em>' . pl_entity_decode($param['titre']) . '&nbsp;</em>' . $map . $mail . $comment . "<br />\n";
     }
     foreach ($lines as $line)
     {