Project

General

Profile

1
<?php
2

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

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

    
8
class OpenAireViewArticle extends JViewLegacy {
9
	const MODEL = 'search';
10
	const OPEN_ACCESS = 'OPEN';
11
	const EMBARGO_ACCESS = 'EMBARGO';
12
	const RESTRICTED_ACCESS = 'RESTRICTED';
13
	const CLOSED_ACCESS = 'CLOSED';
14
	const DOI = 'doi';
15
	const ARXIV = 'arXiv';
16
	const PMC = 'pmc';
17
	const PMID = 'pmid';
18
	const PMID_URL = 'http://europepmc.org/articles/';
19
	const DOI_URL = 'http://dx.doi.org/';
20
	const PMC_URL = 'http://europepmc.org/articles/';
21
	const ARXIV_URL = 'http://arxiv.org/abs/';
22
	const OTHER_RESOURCES = 'Other Resources';
23
	const UNKNOWN_REPOSITORY = 'Unknown Repository';
24
	const MAX_RELATED = 10;
25
	const MAX_AUTHORS = 30;
26
	const LOG = 'openaire';
27
	
28
	function display($template = NULL) {
29
		$search = $this -> getModel(self :: MODEL);
30
		$locale = JFactory :: getLanguage() -> getTag();
31
		$this -> itemId = JRequest :: getUInt('Itemid', 0);
32
		$this -> articleId = JRequest :: getString('articleId');
33
		$this -> statisticsExistUrl = $search -> getPublicationStatisticsExistUrl();
34
		$this -> statisticsChartUrl = $search -> getPublicationStatisticsChartUrl();
35
		$this -> article =($this -> articleId==NULL||$this -> articleId=="")?NULL: $search -> getPublication($this -> articleId, $locale);
36
		$this -> logged = (JFactory::getUser()->guest?false:true);
37
		JViewLegacy :: loadHelper('PiwikHelper');
38
		PiwikHelper :: logPageView('viewPublication', 'publicationId=' . urlencode($this -> articleId) . '&locale=' . urlencode($locale));
39
		if (count($errors = $this -> get('Errors')) > 0) {
40
			JLog :: add('Error viewing article: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG);
41
			return FALSE;
42
		}
43
		parent :: display($template);
44
	}
45
}
46

    
(2-2/2)