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 OpenAireViewProjectFundings extends JViewLegacy{
9
	const MODEL = 'search';
10
	const LOG = 'openaire';
11
	const SIZE = 10;
12
	
13
	function display($template = NULL) {
14
		$locale = JFactory :: getLanguage() -> getTag();
15
		$this -> itemId = JRequest :: getUInt('Itemid', 0);
16
		$project_id = JRequest :: getString('project');
17
        $publicationId = JRequest :: getString('publicationId');
18
		$this -> project = $this -> getModel(self :: MODEL) -> getProject($project_id, $locale);
19
        $this -> project -> inferred = false;
20
        $this -> publication = $this -> getModel(self :: MODEL) -> getPublication($publicationId, $locale);
21
        if ($this -> publication)
22
        foreach ($this -> publication -> projects as $project){
23
        	if ($project -> id == $project_id )
24
            {
25
            	$this -> project -> inferred = $project -> inferred;
26
                $this -> project -> trust = $project -> trust;
27
                $this -> project -> provenance = $project -> provenance;
28
			}
29
		}
30
		if (count($errors = $this -> get('Errors')) > 0) {
31
			JLog :: add('Error viewing project fundings (raw): ' . implode("\n", $errors), JLog :: ERROR, self :: LOG);
32
			return FALSE;
33
		}
34
		parent :: display($template);
35
	}
36
}
37

    
    (1-1/1)