setState('filter.language',$app->getLanguageFilter()); $id = $app->input->get('id', 0, 'int'); $this->setId((int)$id); } function setId($id){ $this->_id = $id; $this->_data = null; } function &getData() { if (!$this->_loadData()) { $this->_initData(); } return $this->_data; } function _loadData() { if (empty($this->_data)) { // Map $where = array(); $where[] = 'a.id = '.(int) $this->_id; //$where[] = 'a.published = 1'; // Filter by language if ($this->getState('filter.language')) { $where[] = 'a.language IN ('.$this->_db->Quote(Factory::getLanguage()->getTag()).','.$this->_db->Quote('*').')'; } $where = (count($where) ? ' WHERE '. implode(' AND ', $where) : ''); $query = 'SELECT a.*' .' FROM #__phocamaps_map AS a' .' ' . $where; $this->_db->setQuery($query); $this->_data['map'] = $this->_db->loadObject(); // Marker $where = array(); $where[] = 'c.id = '.(int) $this->_id; $where[] = 'a.published = 1'; if ($this->getState('filter.language')) { $where[] = 'a.language IN ('.$this->_db->Quote(Factory::getLanguage()->getTag()).','.$this->_db->Quote('*').')'; } $where = (count($where) ? ' WHERE '. implode(' AND ', $where) : ''); $query = 'SELECT a.*, i.id as iconid, i.url as iurl, i.urls as iurls, i.object as iobject, i.objects as iobjects, i.objectshape as iobjectshape' .' FROM #__phocamaps_marker AS a' .' LEFT JOIN #__phocamaps_map AS c ON c.id = a.catid ' .' LEFT JOIN #__phocamaps_icon AS i ON i.id = a.iconext ' .' ' . $where .' ORDER BY a.ordering ASC'; $this->_db->setQuery($query); $this->_data['marker'] = $this->_db->loadObjectList(); return (boolean) $this->_data; } return true; } function _initData() { if (empty($this->_data)) { $this->_data = ''; return (boolean) $this->_data; } return true; } } ?>