Merge remote branch 'origin/platal-1.0.0'
[platal.git] / plugins / function.display_phones.php
index b676d50..39728ed 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2010 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -25,23 +25,11 @@ function smarty_function_display_phones($param, &$smarty)
     if (count($param['tels'])) {
         foreach ($param['tels'] as $tel) {
             $tel_type = ($param['dcd'] ? 'Dernier ' : '');
-            switch ($tel['tel_type']) {
-              case 'fixed':
-                $tel_type .= 'Tél';
-                break;
-              case 'fax':
-                $tel_type .= 'Fax';
-                break;
-              case 'mobile':
-                $tel_type .= 'Mob';
-                break;
-              default:
-                $tel_type .= $tel['tel_type'];
-            }
-            $txthtml .= "<div>\n<em>" . $tel_type . "&nbsp;: </em>\n<strong>" . $tel['tel'] . "</strong>\n";
+            $tel_type .= $tel->displayType(true);
+            $txthtml .= "<div>\n<em>" . $tel_type . "&nbsp;: </em>\n<strong>" . $tel->display . "</strong>\n";
             $comment = "";
-            if ($tel['comment'] != "") {
-                $commentHtml = str_replace(array('&', '"'), array('&amp;', '&quot;'), $tel['comment']);
+            if ($tel->comment != "") {
+                $commentHtml = str_replace(array('&', '"'), array('&amp;', '&quot;'), $tel->comment);
                 $commentJs = str_replace(array('\\', '\''), array('\\\\', '\\\''), $commentHtml);
                 $txthtml .= "<img style=\"margin-left: 5px;\" src=\"images/icons/comments.gif\""
                             . " onmouseover=\"return overlib('"