function _displayGmap($tpl = null) { $params =& JFactory::getApplication()->getParams(); JHTML::_('behavior.mootools'); $document =& JFactory::getDocument(); $document->addScript('http://maps.google.com/maps/api/js?sensor=false'); $document->addScript(JURI::root() . '/components/com_redevent/assets/js/venuemap.js'); JText::script("COM_REDEVENT_GET_DIRECTIONS"); //add css file if (!$params->get('custom_css')) { $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css'); } else { $document->addStyleSheet($params->get('custom_css')); } //Get Data from the model $row = $this->Get('Data'); // echo '<pre>';print_r($row); echo '</pre>';exit; $address = array(); if ($row->street) { $address[] = $row->street; } if ($row->city) { $address[] = $row->city; } if ($row->country) { $address[] = redEVENTHelperCountries::getCountryName($row->country); } $address = implode(',', $address); JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, array('locdescription', 'locmage', 'countryimg', 'targetlink')); $row->target = JRoute::_('index.php?option=com_redevent&view=venueevents&id=' . $row->slug); $this->assignRef('row', $row); $this->assignRef('address', $address); parent::display($tpl); }
function _displayGmap($tpl = null) { $row = $this->Get('Data'); // echo '<pre>';print_r($row); echo '</pre>';exit; $address = array(); if ($row->street) { $address[] = $row->street; } if ($row->city) { $address[] = $row->city; } if ($row->country) { $address[] = redEVENTHelperCountries::getCountryName($row->country); } $address = implode(',', $address); $resp = new stdclass(); $resp->name = $row->venue; $resp->address = $address; $resp->latitude = $row->latitude || $row->longitude ? $row->latitude : 'null'; $resp->longitude = $row->latitude || $row->longitude ? $row->longitude : 'null'; if (function_exists('json_encode')) { echo json_encode($resp); } else { echo JText::_('COM_REDEVENT_ERROR_JSON_IS_NOT_ENABLED'); } exit; }
function _getTag_venue_country() { return redEVENTHelperCountries::getCountryName($this->getEvent()->getData()->country); }
/** * get venues countries * @return array */ function getCountries() { $venues = $this->getData(); $countries = array(); foreach ((array) $venues as $v) { $countries[] = $v->country; } if (!count($countries)) { return array(); } $countries = array_unique($countries); $countrycoords = redEVENTHelperCountries::getCountrycoordArray(); $res = array(); foreach ($countries as $c) { $country = new stdclass(); $country->name = redEVENTHelperCountries::getCountryName($c); $country->flag = redEVENTHelperCountries::getCountryFlag($c); $country->flagurl = redEVENTHelperCountries::getIsoFlag($c); $country->latitude = redEVENTHelperCountries::getLatitude($c); $country->longitude = redEVENTHelperCountries::getLongitude($c); $res[] = $country; } return $res; }