<?php
/***************************************************************************
- * Copyright (C) 2003-2010 Polytechnique.org *
+ * Copyright (C) 2003-2014 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
return false;
}
-function smarty_function_display_address($param, &$smarty)
+function smarty_function_display_address($param, $smarty)
{
- require_once('geocoding.inc.php');
$adr = $param['adr'];
$txtad = $adr->text;
if (!$txtad) {
$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 = ' <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 != "")
{
if ($param['titre'])
{
if ($param['titre_div'])
- $txthtml .= "<div class='titre'>".pl_entity_decode($param['titre'])." ".$map.$comment."</div>\n";
+ $txthtml .= '<div class="titre">' . pl_entity_decode($param['titre']) . ' ' . $map . $mail . $comment . "</div>\n";
else
- $txthtml .= "<em>".pl_entity_decode($param['titre'])." </em>".$map.$comment."<br />\n";
+ $txthtml .= '<em>' . pl_entity_decode($param['titre']) . ' </em>' . $map . $mail . $comment . "<br />\n";
}
foreach ($lines as $line)
{
if ($adr->phones() != null) {
require_once 'function.display_phones.php';
$txthtml .= smarty_function_display_phones(array('tels' => $adr->phones()),$smarty);
- } else if ($param['phones'] != null) {
+ } else if (isset($param['phones']) && count($param['phones'])) {
require_once 'function.display_phones.php';
$txthtml .= smarty_function_display_phones(array('tels' => $param['phones']),$smarty);
}
return $txthtml;
}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
?>