hideOnEmpty = (JRequest :: getString('hideOnEmpty') == 'true'); $this -> type = JRequest :: getString('type','publication'); $this -> data = new JObject(); $this -> data -> via = JText :: _('VIA_'); $this -> data -> openAireImageUrl = JUri :: base() . 'components/com_openaire/images/openairepluslogo.png'; $locale = JFactory :: getLanguage() -> getTag(); $locale = ($locale == null || strlen($locale) == 0)?"en_GB":$locale; 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; // $project = null; // foreach ($projects as $_project){ // if($_project -> code == $ga){ // $project = $_project; // $projectId = $project -> projectId; // } // // } } if($project != null){ if( $this -> type == 'publication'){ $this -> data -> title = JText :: sprintf('PUBLICATIONS_OF_PROJECT_S_S_S_', $project -> title, $project -> acronym, $project -> call); $result = $model -> browsePublications(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, $locale, $projectId, NULL,FALSE); // fetch the first publication to view how many there are... $result = $model -> browsePublications(NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, NULL, 1, $result -> totalPublications, $locale, $projectId, NULL,FALSE); // ... and then fetch them all $this -> data -> publications = $result -> publications; if (count($errors = $this -> get('Errors')) > 0) { JLog :: add('Error viewing data: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG); return FALSE; } }else{ $this -> data -> title = JText :: sprintf('DATASETS_OF_PROJECT_S_S_S_', $project -> title, $project -> acronym, $project -> call); $result = $model -> browseDatasets(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, $locale, $projectId, NULL,FALSE); // fetch the first dataset to view how many there are... $result = $model -> browseDatasets(NULL, NULL, NULL, NULL, NULL, NULL, NULL,NULL, NULL, 1, $result -> totalDatasets, $locale, $projectId, NULL,FALSE); // ... 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); } parent :: display($template); } }