Project

General

Profile

1
<?php
2

    
3
defined('_JEXEC') or die('Access denied');
4

    
5
jimport('joomla.application.component.view');
6
jimport('joomla.environment.request');
7
jimport('joomla.log.log');
8

    
9
class OpenAireViewPerson extends JViewLegacy{
10
	const MODEL = 'search';
11
	const PAGE = 1;
12
	const SIZE = 10;
13
	const LOG = 'openaire';
14
	
15
	function display($template = NULL) {
16
		$model = $this -> getModel(self :: MODEL);
17
		$this -> itemId = JRequest :: getUInt('Itemid', 0);
18
		$this -> personId = JRequest :: getString('personId');
19
		$locale = JFactory :: getLanguage() -> getTag();
20
		JViewLegacy:: loadHelper('PiwikHelper');
21
		PiwikHelper :: logPageView('viewPerson', 'personId=' . urlencode($this -> personId) . '&locale=' . urlencode($locale));
22
		$this -> person = $model -> getPerson($this -> personId, $locale);
23
		$this -> publications = $model -> browsePublications(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, self :: PAGE, self :: SIZE, $locale, NULL, $this -> personId, FALSE);
24
		$this -> datasets = $model -> browseDatasets(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, self :: PAGE, self :: SIZE, $locale, NULL, $this -> personId, FALSE);
25
		if (count($errors = $this -> get('Errors')) > 0) {
26
			JLog :: add('Error viewing person: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG);
27
			return FALSE;
28
		}
29
		parent :: display($template);
30
	}
31
}
32

    
(2-2/2)