Esempio n. 1
0
function genFlag($country)
{
    return '<img src="' . genFlagUrl($country) . '" />';
}
Esempio n. 2
0
 function _getCountriesData($fLatMin, $fLatMax, $fLngMin, $fLngMax, $sMapClassInstanceName)
 {
     $a = $this->_oDb->getCountriesByBounds((double) $fLatMin, (double) $fLatMax, (double) $fLngMin, (double) $fLngMax);
     if (!preg_match('/^[A-Za-z0-9]+$/', $sMapClassInstanceName)) {
         return '';
     }
     $aRet = array();
     foreach ($a as $r) {
         $sFlagUrl = genFlagUrl($r['country']);
         $aVars = array('url_flag' => $sFlagUrl, 'country' => _t($GLOBALS['aPreValues']['Country'][$r['country']]['LKey']), 'num' => sprintf(_t('_bx_map_%d_members'), $r['num']), 'lat' => $r['lat'], 'lng' => $r['lng'], 'zoom' => BX_MAP_ZOOM_CITIES, 'map_instance_name' => $sMapClassInstanceName);
         $sHtml = $this->_oTemplate->parseHtmlByName('popup_country', $aVars);
         $aRet[] = array('lat' => $r['lat'], 'lng' => $r['lng'], 'data' => $sHtml, 'icon' => array('w' => 18, 'h' => 12, 'sw' => 20, 'sh' => 14, 'sd' => 1, 'url' => $sFlagUrl));
     }
     $oParser = new Services_JSON();
     return $oParser->encode($aRet);
 }