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 OpenAireViewSearchDatasetsRaw extends JView {
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
		$locale = JFactory :: getLanguage() -> getTag();
18
		$this -> keyword = JRequest :: getString('keyword');
19
		$this -> itemId = JRequest :: getString('Itemid');
20
		$this -> size = self :: SIZE;
21
		$this -> result = ($this -> keyword == NULL) ? $model -> getDatasetStatistics($locale) : $model -> searchDatasets($this -> keyword, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, self :: PAGE, self :: SIZE, $locale);
22
		if (count($errors = $this -> get('Errors')) > 0) {
23
			JLog :: add('Error viewing raw search datasets: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG);
24
			return FALSE;
25
		}
26
		parent :: display($template);
27
	}
28
}
29

    
(2-2/2)