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
jimport('joomla.utilities.utility');
8

    
9
class OpenAireViewPrintPublication extends JView {
10
	const SEARCH = 'search';
11
	const PIWIK = 'piwik';
12
	const LOG = 'openaire';
13
	
14
	function display($template = NULL) {
15
		$search = $this -> getModel(self :: SEARCH);
16
		$locale = JFactory :: getLanguage() -> getTag();
17
		$this -> itemId = JRequest :: getUInt('Itemid', 0);
18
		$this -> publicationId = JRequest :: getString('publicationId');
19
		$this -> action = JRequest :: getString('action');
20
		$this -> statisticsExistUrl = $search -> getPublicationStatisticsExistUrl();
21
		$this -> statisticsChartUrl = $search -> getPublicationStatisticsChartUrl();
22
		$this -> getModel(self :: PIWIK) -> track('printPublication', 'publicationId=' . urlencode($this -> publicationId) . '&locale=' . urlencode($locale));
23
		$this -> publication = $search -> getPublication($this -> publicationId, $locale);
24
		if (count($errors = $this -> get('Errors')) > 0) {
25
			JLog :: add('Error viewing print publication: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG);
26
			return FALSE;
27
		}
28
		parent :: display($template);
29
	}
30
}
31

    
(2-2/2)