1
|
<?php
|
2
|
|
3
|
defined('_JEXEC') or die('Access denied');
|
4
|
|
5
|
jimport('joomla.application.component.helper');
|
6
|
jimport('joomla.application.component.view');
|
7
|
jimport('joomla.environment.request');
|
8
|
jimport('joomla.log.log');
|
9
|
|
10
|
class OpenAireViewRepositories extends JViewLegacy{
|
11
|
const MODEL = 'search';
|
12
|
const UNKNOWN = 'unknown';
|
13
|
const NON_COMPATIBLE = 'non compatible';
|
14
|
const LOG = 'openaire';
|
15
|
|
16
|
function display($template = NULL) {
|
17
|
$locale = JFactory :: getLanguage() -> getTag();
|
18
|
|
19
|
$parameters = JComponentHelper :: getParams('com_openaire');
|
20
|
//comma seperated :
|
21
|
//publicationRepositories,publicationRepositoryAggregators,dataRepositories,dataRepositoryAggregators,journals,journalRepositoryAggregators
|
22
|
/*
|
23
|
Publication Repositories
|
24
|
Publication Repository Aggregators
|
25
|
Data Repositories
|
26
|
Data Repository Aggregators
|
27
|
Journals
|
28
|
Journal Aggregators
|
29
|
*/
|
30
|
//comma seperated : 2.0,2.0plus,3.0,basic
|
31
|
|
32
|
|
33
|
$this -> itemId = JRequest :: getUInt('Itemid', 0);
|
34
|
$search = $this -> getModel(self :: MODEL);
|
35
|
JViewLegacy:: loadHelper('PiwikHelper');
|
36
|
PiwikHelper :: logPageView('viewCompatibleDatasources', 'locale=' . urlencode($locale));
|
37
|
$this -> repositories = $search -> getCompatibleDatasources($locale);
|
38
|
if (count($errors = $this -> get('Errors')) > 0) {
|
39
|
JLog :: add('Error viewing repositories: ' . implode("\n", $errors), JLog :: ERROR, self :: LOG);
|
40
|
return FALSE;
|
41
|
}
|
42
|
parent :: display($template);
|
43
|
}
|
44
|
function getType($type){
|
45
|
switch ($type) {
|
46
|
case 'pubsrepository::unknown':
|
47
|
return 'Publication Repository';
|
48
|
case 'pubsrepository::institutional':
|
49
|
return 'Institutional Repository';
|
50
|
case 'pubsrepository::thematic':
|
51
|
return 'Thematic Repository';
|
52
|
case 'aggregator::pubsrepository::unknown':
|
53
|
return 'Publication Repository Aggregator';
|
54
|
case 'aggregator::pubsrepository::institutional':
|
55
|
return 'Instittional Repository Aggregator';
|
56
|
case 'datarepository::unknown':
|
57
|
return 'Data Repository';
|
58
|
case 'aggregator::datarepository':
|
59
|
return 'Data Repository Aggregator';
|
60
|
case 'pubsrepository::journal':
|
61
|
return 'Journal';
|
62
|
case 'aggregator::pubsrepository::journals':
|
63
|
return 'Journal Aggregator';
|
64
|
case 'crissystem':
|
65
|
return 'Cris System';
|
66
|
case 'pubscatalogue::unknown':
|
67
|
return 'Publication Catalogue';
|
68
|
default:
|
69
|
return $type;
|
70
|
}
|
71
|
|
72
|
|
73
|
}
|
74
|
|
75
|
}
|
76
|
|