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 OpenAireViewIngestion2 extends JViewLegacy{
10
	const MODEL = 'search';
11
	const OPENAIRE_COMPATIBLE = 'openaire';
12
	const NOT_OPENAIRE_COMPATIBLE = 'notCompatible';
13
	const LOG = 'openaire';
14
	
15
	function display($template = NULL) {
16
		$model = $this -> getModel(self :: MODEL);	
17
		$this -> itemId = JRequest :: getUInt('Itemid', 0);
18
		$institutionId = JRequest :: getString('institutionId');
19
		$locale = JFactory :: getLanguage() -> getTag();
20
		JViewLegacy:: loadHelper('PiwikHelper');
21
		PiwikHelper :: logPageView('searchOrganizationDatasources', 'organization=' . urlencode($institutionId) . '&locale=' . urlencode($locale));
22
		$this -> institution = $model -> getOrganization($institutionId, $locale);
23
		$this -> result = $model -> getOrganizationDatasources($institutionId, 1, $locale);
24
		$this -> result = ($this -> result == NULL) ? NULL : $model -> getOrganizationDatasources($institutionId, $this -> result -> totalDatasources, $locale);
25
		if (count($errors = $this -> get('Errors')) > 0) {
26
			JLog :: add('Error viewing ingestion2: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG);
27
			return FALSE;
28
		}
29
		parent :: display($template);
30
	}
31
}
32

    
(2-2/2)