Exemplo n.º 1
0
function buildGeocacheHtml(lib\Objects\GeoCache\GeoCache $geocache, $html)
{
    $ocConfig = \lib\Objects\OcConfig\OcConfig::instance();
    $html = mb_ereg_replace('{cacheimage}', '<img src="' . $geocache->getCacheIcon() . '" width="16" />', $html);
    $html = mb_ereg_replace('{cachestatus}', htmlspecialchars(tr($geocache->getStatusTranslationIdentifier()), ENT_COMPAT, 'UTF-8'), $html);
    $html = mb_ereg_replace('{cacheid}', htmlspecialchars(urlencode($geocache->getCacheId()), ENT_COMPAT, 'UTF-8'), $html);
    if ($geocache->getDateActivate() === null) {
        $html = mb_ereg_replace('{date}', tr('no_time_indicated'), $html);
    } else {
        $html = mb_ereg_replace('{date}', $geocache->getDateActivate()->format($ocConfig->getDateFormat()), $html);
    }
    $html = mb_ereg_replace('{cachename}', htmlspecialchars($geocache->getCacheName(), ENT_COMPAT, 'UTF-8'), $html);
    $html = mb_ereg_replace('{wpname}', htmlspecialchars($geocache->getWaypointId(), ENT_COMPAT, 'UTF-8'), $html);
    return $html;
}