Add a link to password documentation.
[platal.git] / plugins / function.display_address.php
index 81fbebe..07ce7c3 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2008 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -30,8 +30,8 @@ function display_address_isIdentity($idt, $value, $test_reverse = true)
         return true;
     }
 
-    if ($test_reverse) { 
-        return display_address_isIdentity($idt, implode(' ', array_reverse(explode(' ', $value))), false); 
+    if ($test_reverse) {
+        return display_address_isIdentity($idt, implode(' ', array_reverse(explode(' ', $value))), false);
     }
     return false;
 }
@@ -59,17 +59,17 @@ function smarty_function_display_address($param, &$smarty)
 
     $txthtml = "";
     $map = "<a href=\"http://maps.google.fr/?q="
-         .   urlencode(str_replace('États-Unis d\'Amérique', 'USA', implode(", ", $lines) . " ($idt)"))
-         . "\"><img src=\"images/icons/map.gif\" alt=\"Google Maps\" title=\"Carte\"/></a>";
+        .   urlencode(implode(", ", $lines) . " ($idt)")
+        . "\"><img src=\"images/icons/map.gif\" alt=\"Google Maps\" title=\"Carte\"/></a>";
     if ($restore) {
         array_unshift($lines, $idt);
     }
     if ($param['titre'])
     {
         if ($param['titre_div'])
-            $txthtml .= "<div class='titre'>".$param['titre'].$map."</div>\n";
-    else
-           $txthtml .= "<em>".$param['titre']."</em>".$map."<br />\n";
+            $txthtml .= "<div class='titre'>".pl_entity_decode($param['titre'])."&nbsp;".$map."</div>\n";
+        else
+            $txthtml .= "<em>".pl_entity_decode($param['titre'])."&nbsp;</em>".$map."<br />\n";
     }
     foreach ($lines as $line)
     {
@@ -82,12 +82,12 @@ function smarty_function_display_address($param, &$smarty)
     if ($param['adr']['mobile'])
         $txthtml .= "<div>\n<em>Tél : </em>\n<strong>".$param['adr']['mobile']."</strong>\n</div>\n";
     if ($param['adr']['tels'] && count($param['adr']['tels'])) {
-        foreach ($param['adr']['tels'] as $tel) 
+        foreach ($param['adr']['tels'] as $tel)
             $txthtml .= "<div>\n<em>".$tel['tel_type']."&nbsp;: </em>\n<strong>".$tel['tel']."</strong>\n</div>\n";
     }
-    if (!$params['nodiv'])
-    {
-        $txthtml = "<div class='adresse'>\n".$txthtml."</div>\n";
+    if (!$param['nodiv']) {
+        $pos = $param['pos'] ? " style='float: " . $param['pos'] . "'" : '';
+        $txthtml = "<div class='adresse' $pos>\n".$txthtml."</div>\n";
     }
     return $txthtml;
 }