input; $projectId = $input->get('projectId',null,'string'); $ga = $input->get('ga',null,'string'); $funder = $input->get('funder','ec__________::EC', 'string'); $this -> hideOnEmpty = ($input->get('hideOnEmpty') == 'true'); $this -> type = $input->get('type','publication','string'); $this -> data = new \stdClass(); $this -> data -> via = " via "; $this -> data -> openAireImageUrl = \JUri :: base() . 'components/com_openaire/images/openairelogo.png'; $locale = "en_GB"; \JLog :: add('projectId: '.$projectId. ' Type: '.$this -> type, \JLog :: DEBUG, self::LOG); if ($projectId != null) { $model = $this -> getModel(self::MODEL); $project = $model -> getProject($projectId, $locale); }else if ($ga != null){ $model = $this -> getModel(self::MODEL); $project= $model ->getProjectByCodeId($ga, $funder, $locale); $projectId = $project -> projectId; } if($project != null){ $typeInTitle = "PUBLICATIONS"; if($this -> type == 'software') { $typeInTitle = "SOFTWARE"; }else if($this -> type == 'other') { $typeInTitle = "OTHER"; }else if($this -> type == 'dataset'){ $typeInTitle = "DATASETS"; }else if($this -> type == 'result'){ $typeInTitle = "RESEARCH_RESULTS"; $this -> type = null; }else{ $typeInTitle = "PUBLICATIONS"; $this -> type = "publication"; } \JLog :: add('Type: '.$this -> type. ' '.$typeInTitle , \JLog :: DEBUG, self::LOG); $this -> data -> title = \JText :: sprintf($typeInTitle .'_OF_PROJECT_S_S_S_', $project -> title, $project -> acronym, $project -> call); $result = $model -> searchResults($this -> type, 1, 1, $projectId); // fetch the first dataset to view how many there are... $result = $model -> searchResults($this -> type, 1, $result -> totalDatasets, $projectId); // ... and then fetch them all $this -> data -> publications = $result -> datasets; /* if (count($errors = $this -> get('Errors')) > 0) { \JLog :: add('Error viewing data: ' . implode("\n", $errors), \JLog :: ERROR, self::LOG); return FALSE; } */ } else { \JLog :: add('No project id!!!', \JLog :: ERROR, self::LOG); } // Call the parent display to display the layout file parent::display($template); } }