Project

General

Profile

1 18092 thanos.pap
<?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 25039 thanos.pap
	const SEARCH = 'search';
11
	const PIWIK = 'piwik';
12 18092 thanos.pap
	const LOG = 'openaire';
13
14
	function display($template = NULL) {
15 25039 thanos.pap
		$search = $this -> getModel(self :: SEARCH);
16 18092 thanos.pap
		$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 25039 thanos.pap
		$this -> getModel(self :: PIWIK) -> track('printPublication', 'publicationId=' . urlencode($this -> publicationId) . '&locale=' . urlencode($locale));
23 18092 thanos.pap
		$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
}