getTag(); $this -> itemId = JRequest :: getUInt('Itemid', 0); $this -> id = JRequest :: getString('id'); $term = JRequest :: getString('term'); $type = JRequest :: getString('type'); $parent = JRequest :: getString('parent'); $funder = JRequest :: getString('funder'); $claimModel = $this->getModel(self :: CLAIM_MODEL); $limit = JRequest :: getUInt('limit', self :: SIZE); $this -> communities = $claimModel -> getContexts(); $data = array(); if ($type == "root"){ list ($id, $category) = explode("::", $parent); foreach ($this -> communities[$id] -> categories[$id. "::" . $category] -> concepts as $concept){ if (!$concept -> claim) continue; $data_t = new stdClass(); $data_t -> id = $concept -> id; $data_t -> text = $concept -> name; $data_t -> children = count($concept -> concepts)?true:false; $data_t -> type = "root"; $data[] = $data_t; } }else{ $concept = $claimModel -> getConcept($this -> id , 1); $concepts = $concept -> concepts[count($concept -> concepts) - 1] -> concepts; foreach ($concepts as $concept){ if (!$concept -> claim) continue; $data_t = new stdClass(); $data_t -> id = $concept -> id; $data_t -> text = $concept -> name; $data_t -> children = count($concept -> concepts)?true:false; $data_t -> type = "concept"; $data[] = $data_t; } } $this -> communities = $data; $doc = JFactory::getDocument(); $doc->setMimeEncoding('application/json'); if (count($errors = $this -> get('Errors')) > 0) { JLog :: add('Error viewing communities (raw): ' . implode("\n", $errors), JLog :: ERROR, self :: LOG); return FALSE; } parent :: display($template); } }