Esempio n. 1
0
 /**
  * Method to get the Venues
  *
  * @access public
  * @return array
  */
 function &getData()
 {
     $mainframe =& JFactory::getApplication();
     $menu =& JSite::getMenu();
     $item = $menu->getActive();
     $params =& $menu->getParams($item->id);
     $elsettings =& redEVENTHelper::config();
     // Lets load the content if it doesn't already exist
     if (empty($this->_data)) {
         $query = $this->_buildQuery();
         // Get a reference to the global cache object.
         $cache =& JFactory::getCache('redevent');
         $this->_data = $cache->call(array('RedeventModelCountriesmap', '_getResultList'), $query);
         $countrycoords = redEVENTHelperCountries::getCountrycoordArray();
         $k = 0;
         for ($i = 0; $i < count($this->_data); $i++) {
             $country =& $this->_data[$i];
             $country->flag = REOutput::getFlag($country->iso2);
             $country->flagurl = REOutput::getFlagUrl($country->iso2);
             $country->latitude = $countrycoords[$country->iso2][0];
             $country->longitude = $countrycoords[$country->iso2][1];
             //create target link
             $country->targetlink = JRoute::_(JURI::base() . 'index.php?option=com_redevent&view=countryevents&filter_country=' . $country->iso2);
             $k = 1 - $k;
         }
     }
     return $this->_data;
 }