input; $type = $input->get('type', null, 'string'); $catId = $input->get('catId', null, 'string'); $model = $this->getModel(); if ($type == "categories") { $records = $model->getCategory(); if ($records) { echo new JResponseJson($records); } else { echo new JResponseJson(null, JText::_('COM_HELLOWORLD_ERROR_NO_RECORDS'), true); } } else if ($type == "departement") { $records = $model->getTerritoires(); if ($records) { echo new JResponseJson($records); } else { echo new JResponseJson(null, JText::_('COM_HELLOWORLD_ERROR_NO_RECORDS'), true); } } else if ($type == "categorie") { $records = $model->getCategoriesExperience(); if ($records) { echo new JResponseJson($records); } else { echo new JResponseJson(null, JText::_('COM_HELLOWORLD_ERROR_NO_RECORDS'), true); } } else if ($type == "activite") { $records = $model->getActivite(); if ($records) { echo new JResponseJson($records); } else { echo new JResponseJson(null, JText::_('COM_HELLOWORLD_ERROR_NO_RECORDS'), true); } } else if ($type == "markers" && isset($catId)) { $records = $model->getMarkers($catId); if ($records) { echo new JResponseJson($records); } else { echo new JResponseJson(null, JText::_('COM_HELLOWORLD_ERROR_NO_RECORDS_1'), true); } } else { $records = array(); //echo new JResponseJson(null, JText::_('COM_HELLOWORLD_ERROR_NO_MAP_BOUNDS'), true); echo new JResponseJson($type); } } }