Project

General

Profile

1
<?php
2

    
3
defined('_JEXEC') or die('Access denied');
4
jimport('joomla.environment.uri');
5
jimport('joomla.html.html');
6
jimport('joomla.methods');
7

    
8
JHtml :: _('behavior.mootools');
9
JView :: loadHelper('PublicationHelper');
10
JView :: loadHelper('DatasetHelper');
11
JHtml :: _('behavior.mootools');
12

    
13

    
14
$document = JFactory :: getDocument();
15
$document -> addStyleSheet(JRoute :: _(JURI :: base() . 'components/com_openaire/css/SqueezeBox.css'));
16
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/citeproc/loadabbrevs.js'));
17
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/citeproc/xmle4x.js'));
18
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/citeproc/xmldom.js'));
19
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/citeproc/loadlocale.js'));
20
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/citeproc/loadsys.js'));
21
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/citeproc/loadcsl.js'));
22
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/citeproc/citeproc.js'));
23
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/article.js'));
24
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/SqueezeBox.js'));
25
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/tabcontent.js'));
26
$document -> addScript(JRoute :: _(JURI :: base() . 'components/com_openaire/js/tooltip.js'));
27
$document -> addStyleSheet(JRoute :: _(JURI :: base() . 'components/com_openaire/css/tabcontent.css'));
28
$document -> addStyleSheet(JRoute :: _(JURI :: base() . 'components/com_openaire/css/tooltip/tooltip1.css'));
29
$document -> addScript( 'https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js');
30

    
31
$application = JFactory :: getApplication();
32
$user = JFactory :: getUser();
33
$parameters = JComponentHelper :: getParams('com_openaire');
34
$canonicalUrl = JRoute :: _('index.php?option=com_openaire&view=article&articleId=' . $this -> articleId);
35

    
36
?>
37

    
38
<div class="system">
39
	<input id="article" type="hidden" value="<?php echo(htmlentities(json_encode($this -> article)));?>"></input>
40
	<input id="url" type="hidden" value="<?php echo($canonicalUrl); ?>"></input>
41
	<input id="piwikUrl" type="hidden" value="<?php echo($parameters -> get('piwikUrl')); ?>" />
42
	<input id="piwikSiteId" type="hidden" value="<?php echo($parameters -> get('piwikSiteId')); ?>" />
43
	<input id="user" type="hidden" value="<?php echo($user -> email); ?>" />
44
	<input id="session" type="hidden" value="<?php echo(JFactory :: getSession() -> getId()); ?>" />
45
	<input id="publicationId" type="hidden" value="<?php echo($this -> articleId); ?>" />
46
	<input id="locale" type="hidden" value="<?php echo(JFactory :: getLanguage() -> getTag()); ?>" />
47
	<div class="flowWrapper">
48
		<?php if (($this -> articleId == NULL) || ($this -> article == NULL) || ($this -> article -> title == NULL)) { ?>
49
			<div class="error"><?php echo(JText :: _('ERROR_RETRIEVING_PUBLICATION')); ?></div>
50
		<?php } else {
51
			$document -> addCustomTag('<meta name="citation_title" value="' . $this -> article -> title . '" />');
52
			foreach ($this -> article -> authors as $author) {
53
				if (($author -> fullName != NULL) || (($author -> lastName != NULL) && ($author -> firstName != NULL))) {
54
					$document -> addCustomTag('<meta name="citation_author" value="' . (($author -> fullName == NULL) ? ($author -> lastName . ', ' . $author -> firstName) : $author -> fullName) . '" />');
55
				}
56
			}
57
			if ($this -> article -> date != NULL) {
58
				$document -> addCustomTag('<meta name="citation_publication_date" value="' . date('Y/m/d', $this -> article -> date) . '" />');
59
			}
60
			foreach ($this -> article -> datasources as $datasource) {
61
				if ($datasource -> url != NULL) {
62
					$document -> addCustomTag('<meta name="citation_pdf_url" value="' . $datasource -> url . '" />');
63
				}
64
			}
65
			$document -> addCustomTag('<link rel="canonical" href="' . $canonicalUrl . '" />'); ?>
66
			<div class="innerLeft">
67
				<div class="publication">
68
					<div class="publicationIcon">
69
					<!-- NMI should this be in input submit? to avoid bots -->
70
						<span style="float:right">
71
						<a class="button-default button-primary-add openClaimBox" href="<?php $url = JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=claiminline&tmpl=modal&activePublicationId=' . $this -> article -> id); echo $url;?>"><?php echo(JText :: _('LINK_TO_PROJECT')); ?></a>
72
						<a class="button-default button-primary-add openClaimBox" href="<?php $url = JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=claiminline2&tmpl=modal&activePublicationId=' . $this -> article -> id); echo $url;?>"><?php echo(JText :: _('LINK_TO_DATA')); ?></a>
73
						</span>
74
						
75
					</div>	
76
					<div class="pubTitle">
77
						<?php switch ($this -> article -> accessMode) {
78
						case OpenAireViewArticle :: OPEN_ACCESS:
79
							$accessModeClass = 'openAccess';
80
							$accessModeTitle = JText :: _('OPEN_ACCESS');
81
							break;
82
						case OpenAireViewArticle :: EMBARGO_ACCESS:
83
							$accessModeClass = 'embargoAccess';
84
							$accessModeTitle = JText :: _('EMBARGO_ACCESS');
85
							break;
86
						case OpenAireViewArticle :: RESTRICTED_ACCESS:
87
							$accessModeClass = 'restrictedAccess';
88
							$accessModeTitle = JText :: _('RESTRICTED_ACCESS');
89
							break;
90
						case OpenAireViewArticle :: CLOSED_ACCESS:
91
							$accessModeClass = 'closedAccess';
92
							$accessModeTitle = JText :: _('CLOSED_ACCESS');
93
							break;
94
						default:
95
							$accessModeClass = NULL;
96
							$accessModeTitle = NULL;
97
						} ?>
98
						<h3<?php echo((($accessModeClass == NULL) ? '' : (' class="' . $accessModeClass . '"')) . (($accessModeTitle == NULL) ? '' : (' title="' . $accessModeTitle . '"'))); ?>><?php echo((($this -> article -> url == NULL) ? '' : ('<a target="_blank" class="icon-external" href="' . $this -> article -> url . '">')) . $this -> article -> title . (($this -> article -> url == NULL) ? '' : '</a>')); ?></h3>
99
					</div>
100
					<?php if (($this -> article -> authors != NULL) || ($this -> article -> year != NULL)) { ?>				
101
						<div class="infoline">
102
							<?php $itemId = $this -> itemId;
103
							echo(implode('; ', array_filter(array_map(function ($author) use ($itemId) {return (($author == NULL) || ((($author -> lastName == NULL) || ($author -> firstName == NULL)) && ($author -> fullName == NULL))) ? '' : ('<span class="auth">' . (($author -> id == NULL) ? '' : ('<a href="' . JRoute :: _('index.php?option=com_openaire&view=person&Itemid=' . $itemId . '&personId=' . $author -> id) . '">')) . ((($author -> lastName == NULL) || ($author -> firstName == NULL)) ? $author -> fullName : ($author -> lastName . ', ' . $author -> firstName)) . (($author -> id == NULL) ? '' : '</a>') . '</span>');}, $this -> article -> authors))));
104
							if ($this -> article -> year!= NULL) { ?>
105
								<span class="date">(<?php echo($this -> article -> year); ?>)</span>
106
							<?php } ?>
107
						</div>
108
					<?php }
109
					if ($this -> article -> publisher != NULL) { ?>
110
						<div class="dcinfo">
111
							<span class="dchdr"> <?php echo (JText :: _('PUBLISHER_') . '</span>  ' . $this -> article -> publisher); ?>
112
						</div>
113
					<?php }
114
					if ($this -> article -> languages != NULL) { ?>
115
						<div class="dcinfo">
116
							<span class="dchdr"> <?php echo( JText :: _('LANGUAGES_') . '</span>  ' . implode(', ', $this -> article -> languages)); ?>
117
						</div>
118
					<?php }
119
					if ($this -> article -> type != NULL) { ?>
120
						<div class="dcinfo">
121
							<span class="dchdr"> <?php echo(JText :: _('TYPES_'). '</span> ' . implode(",", $this -> article -> type)); ?>
122
							<!--<?php echo(JText :: _('TYPES_') . ' ' . implode(",", $this -> article -> type)); ?> -->
123
						</div>
124
					<?php }
125
					if ($this -> article -> subjects != NULL) {						
126
					 ?>
127
					<?php $subjects_clean = array(); 
128
					$subjects_inferred= array(); 
129
					foreach ($this->article->subjects as $subject){
130
						$subjects_clean[] = ("<span class=\"subject_item\">".$subject->title."</span>");												
131
					}
132
					foreach ($this->article->inferredSubjects as $key => $subjects){																
133
						foreach($subjects as  $subject){
134
							$subjects_inferred[$key][] = ("<span class=\"subject_item inferred\">" . $subject->title."</span>");
135
						}
136
					}
137
					/* NMI following commented out line contains tooltips. Leave for later use */						
138
						/* NMI group by classification scheme and in each scheme sort by higher trust level*/
139
					//foreach ($this->article->subjects as $subject){
140
						//if ($subject->inferred == false) $subjects_clean[] = ("<span class=\"subject_item\">".$subject->title."</span>");
141
						/* NMI following commented out line contains tooltips. Leave for later use */
142
						/*if ($subject->inferred == true) $subjects_inferred[] = ("<span class=\"subject_item".($subject->inferred?" inferred":"")."\">" . str_replace("::", "/", $subject->title). ($subject->inferred == true?" <span class='inferred'><img src='templates/yoo_solar/styles/openaire/images/box_info_ok.png'></span><div style='display: none'><div class='inferred-popup' id='popup-". uniqid(). "'>trust: $subject->trust, provenance: $subject->provenance </div></div>":"") . "</span>");*/
143
						/* NMI group by classification scheme and in each scheme sort by higher trust level*/
144
						//if ($subject->inferred == true) $subjects_inferred[] = ("<span class=\"subject_item".($subject->inferred?" inferred":"")."\">" . $subject->title. "</span>");
145
					//}
146
					if($subjects_inferred!=null||$subjects_clean!=null){
147
					?>
148
 						<div class="dcinfo">							 
149
							<!--<span class="dchdr"><?php echo(JHTML::tooltip('This is a tooltip attached to text', '', '', JText :: _('SUBJECTS_')) . '</span>  ' . implode(', ', $subjects_clean)); ?>-->
150
							<span class="dchdr"><?php echo  (JText :: _('SUBJECTS_') . '</span>  ' . implode(', ', $subjects_clean)); ?>
151
						</div>
152
						 
153
						<!-- Check out this: https://beta.openaire.eu/search/publication?articleId=od________18::719f54c785ecac578e13db2a400a8fb1
154
							even though there is no inferred subject it shows the outside borders and header. Same happens in identifiers in some cases -->
155
						<?php 
156
						}
157
						if($subjects_inferred!=null){ ?>
158
							<div class="dcinfo">
159
								<div class="inferred_section">
160
								<!-- NMI tooltip must be nicer. Do something -->
161
								<!--<a title="<?php echo(JText :: _('INFERRED_SUBJECTS_TOOLTIP')); ?>" class="inferred-popup"><span class="tooltip-info"><?php echo(JText :: _('INFERRED_SUBJECTS_')); ?></span></a> 
162
								<?php echo(implode(', ', $subjects_inferred)); ?>
163
								-->
164
								<?php
165
									foreach($subjects_inferred as $taxonomy => $taxonomySubjects){
166
								?>
167
								<span class="dchdr"><a><?php echo(JText :: _($taxonomy).":"); ?></a> </span>
168
										<!--
169
										<a title="<?php echo(JText :: _('INFERRED_SUBJECTS_TOOLTIP')); ?>" class="inferred-popup"><span class="tooltip-info"><?php echo(JText :: _($taxonomy).":"); ?></span></a> 
170
										-->
171
								<?php
172
										echo(implode(', ', $taxonomySubjects)."<br>"); 
173
									}
174
								?>
175
								</div>
176
							</div>
177
							
178
						<?php }}
179
					if ($this -> article -> embargoEndDate != NULL) { ?>
180
						<div class="dcinfo">
181
							<?php echo(PublicationHelper :: _formatEmbargoEndDate($this -> article -> embargoEndDate)); ?>
182
						</div>
183
					<?php }
184
					if ($this -> article -> pids != NULL) { 
185
						$pidsToShow=array_filter(array_map(function ($pid) {
186
 								switch ($pid -> clazz) {
187
								case OpenAireViewArticle :: DOI:
188
									return ($pid -> value == NULL) ? '' : ('<a target="_blank" class="icon-external" href="' . OpenAireViewArticle :: DOI_URL . urlencode($pid -> value) . '">' . ((substr($pid -> value, 0, strlen($pid -> clazz . ':')) == ($pid -> clazz . ':')) ? $pid -> value : ($pid -> clazz . ':' . $pid -> value)) . '</a>');
189
								case OpenAireViewArticle :: PMC:
190
									return ($pid -> value == NULL) ? '' : ('<a target="_blank" class="icon-external" href="' . OpenAireViewArticle :: PMC_URL . urlencode($pid -> value) . '">' . ((substr($pid -> value, 0, strlen($pid -> clazz . ':')) == ($pid -> clazz . ':')) ? $pid -> value : ($pid -> clazz . ':' . $pid -> value)) . '</a>');
191
								//case OpenAireViewArticle :: ARXIV:
192
									//return ($pid -> value == NULL) ? '' : ('<a target="_blank" class="icon-external" href="' . OpenAireViewArticle :: ARXIV_URL . urlencode($pid -> value) . '">' . ((substr($pid -> value, 0, strlen($pid -> clazz . ':')) == ($pid -> clazz . ':')) ? $pid -> value : ($pid -> clazz . ':' . $pid -> value)) . '</a>');								
193
								default:
194
									return '';
195
								}
196
							}, $this -> article -> pids));
197
						if ($pidsToShow != NULL) { 
198
							?> 
199
							<div class="dcinfo">
200
								<!-- TODO add more cases for other article types -->
201
								<span class="dchdr"><?php echo(JText :: _('IDENTIFIERS_')."</span>" . implode(', ',$pidsToShow));?>
202
							</div>
203
					<?php }
204
					}
205
					if ($this -> article -> description != NULL) { ?>
206
						<div class="description">
207
							<?php echo($this -> article -> description); ?>
208
						</div>
209
					<?php } ?>
210
					<p>&nbsp;</p>
211
					<div  class="slideshow tabs" data-widgetkit="slideshow" data-options="{&quot;style&quot;:&quot;tabs&quot;,&quot;autoplay&quot;:0,&quot;interval&quot;:5000,&quot;width&quot;:&quot;auto&quot;,&quot;height&quot;:&quot;auto&quot;,&quot;duration&quot;:500,&quot;index&quot;:0,&quot;order&quot;:&quot;default&quot;,&quot;navigation&quot;:&quot;left&quot;,&quot;animated&quot;:&quot;fade&quot;}">
212
						<div class="nav-container nav-left clearfix">
213
							<ul class="tabs" persist="true">
214
								<li class="selected"><a rel="citationsTab">Citations</a></li>
215
								<li ><a rel="datatab"><?php echo(JText :: _('RELATED_DATA')); ?></a></li>
216
							<!-- Related publications title tab  -->
217
							<!--<li><a rel="publtab"><?php echo(JText :: _('RELATED_PUBLICATIONS')); ?></a></li>  -->
218
                                <li><a rel="similartab"><?php echo(JText :: _('SIMILAR_PUBLICATIONS')); ?></a></li>
219
								<li><a rel="statstab"><?php echo(JText :: _('METRICS')); ?></a></li>
220
							</ul>
221
						</div>
222
						<div class="tabcontents">
223
							<div id="citationsTab" class="tabcontent">
224
								<?php if (($this -> article -> citations == NULL)) { ?>
225
									<!--//TODO add this to .ini
226
									 <div class="box-info"><?php echo(JText :: _('NO_CITATIONS_STAY_TUNED_')); ?></div>-->
227
									<div class="box-info">No citation.</div>
228
								<?php } else { ?>
229
									<!--//TODO add this to .ini
230
 									<blockquote class="blockquote-nopad"><?php echo(JText :: _('CITATIONS_TECHNOLOGY')); ?></blockquote>
231
									-->
232
									<blockquote class="blockquote-nopad">CITATIONS_TECHNOLOGY</blockquote>
233
								
234
									<div class="searchResults">
235
									 
236
										 <?php 			
237
										/* Remove the usort if citations are sorted from db*/
238
										 //usort($this -> article -> citations , function ($citation1, $citation2) {return explode("]",explode("[",$citation1 -> title)[1])[0] - explode("]",explode("[",$citation2 -> title)[1])[0] ;});										  
239
											foreach (array_slice($this -> article -> citations, 0, OpenAireViewArticle :: MAX_RELATED) as $citation) {														 
240
																echo(PublicationHelper :: formatCitationLinks($citation));								
241
											}
242
											if (count($this -> article -> citations) > OpenAireViewArticle :: MAX_RELATED) { ?>
243
												<div class="pageController">
244
													<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($this -> article -> citations)); ?></a>
245
												</div>
246
												<div class="more">
247
													<?php foreach (array_slice($this -> article -> citations, OpenAireViewArticle :: MAX_RELATED) as $citation) {
248
														  echo(PublicationHelper :: formatCitationLinks($citation));								
249
													} ?>
250
												</div>
251
											<?php } ?>
252
									</div>
253
									
254
								<?php } ?>
255
							</div>
256
							<div id="datatab" class="tabcontent">
257
								<!-- NMI should this be in input submit? to avoid bots -->
258
								<div style="text-align: right;">
259
									<a class="button-default button-primary-add openClaimBox" href="<?php $url = JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=claiminline2&tmpl=modal&activePublicationId=' . $this -> article -> id); echo $url;?>"><?php echo(JText :: _('LINK_TO_DATA')); ?></a>
260
								</div>
261
								
262
								<!-- NMI this has 3 sections: harvested, claimed, inferred, so enclose each in a respective div: section_harvested, section_claimed, section_inferred 
263
								In each section a dataset can be either an internal one (i.e., in OpenAIRE index as an entity) or external (link in publication DC). These should be 
264
								surrounded by <span class="internal-dataset> or <span class="external-dataset" which may be in the helper>  
265
								For the inferred content we should have the capability of sorting by trust level descending, or showing a meter bar: include title of publisation
266
								in <span class="show_trust" width=X%> where X is the trust level -->
267
								
268
								<?php if (($this -> article -> relatedDatasets == NULL) && ($this -> article -> externalDatasets == NULL)) { ?>
269
									<div class="box-info"><?php echo(JText :: _('NO_RELATED_DATA_STAY_TUNED_')); ?></div>
270
								<?php } else { 
271
								$inferredRelatedDatasets=array();
272
								$harvestedRelatedDatasets=array();
273
								$claimedRelatedDatasets=array();
274
								$otherRelatedDatasets=array();
275
								foreach ($this -> article -> relatedDatasets as $relatedDataset ){
276
									if($relatedDataset->provenance!=null){
277
 										if(strpos($relatedDataset->provenance,'iis')!==false){
278
											$inferredRelatedDatasets[]=$relatedDataset;
279
 										}else if(strpos($relatedDataset->provenance,'sysimport')!==false){
280
											$harvestedRelatedDatasets[]=$relatedDataset;
281
										}else if(strpos($relatedDataset->provenance,'user')!==false){
282
											$claimedRelatedDatasets[]=$relatedDataset;
283
										
284
										}else{
285
											$otherRelatedDatasets[]=$relatedDataset;
286
										}
287
									}
288
								}
289
								$externalInferredDatasets=array();
290
								$externalHarvestedDatasets=array();
291
								$externalClaimedDatasets=array();
292
								$externalOtherDatasets=array();
293
								foreach ($this -> article -> externalDatasets as $externalDataset ){
294
									if($externalDataset->provenance!=null){
295
										if(strpos($externalDataset->provenance,'iis')!==false){
296
											$externalInferredDatasets[]=$externalDataset;
297
										}else if(strpos($relatedDataset->provenance,'sysimport')!==false){
298
											$externalHarvestedDatasets[]=$externalDataset;
299
										}else if(strpos($relatedDataset->provenance,'user')!==false){
300
											$externalClaimedDatasets[]=$externalDataset;
301
										
302
										}else{
303
											$externalOtherDatasets[]=$externalDataset;
304
										}
305
									}
306
								}
307
								if($harvestedRelatedDatasets!=null||$externalHarvestedDatasets!=null){?>										 							
308
									<div class="section_harvested">
309
										<blockquote class="blockquote-nopad"><?php echo(JText :: _('RELATED_DATA_TECHNOLOGY')); ?></blockquote>										
310
									<?php if($harvestedRelatedDatasets!=null){ 
311
										usort($harvestedRelatedDatasets, function ($a, $b) {if ($a->trust == $b->trust) {return 0;}return ($a->trust > $b->trust) ? -1 : 1;});
312
										?>
313
										 
314
										<span class="internal-dataset">
315
										<div class="searchResults">
316
											<?php foreach (array_slice($harvestedRelatedDatasets, 0, OpenAireViewArticle :: MAX_RELATED) as $relatedDataset) {
317
													/* NMI this is a sample, width must be a parameter. This code could be in the datahelper php file. DO the same in the similar documents */												
318
													
319
													echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
320
													echo(DatasetHelper :: formatDataset($relatedDataset, $this -> itemId));												
321
											}
322
											if (count($harvestedRelatedDatasets) > OpenAireViewArticle :: MAX_RELATED) { ?>
323
												<div class="pageController">
324
													<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($harvestedRelatedDatasets)); ?></a>
325
												</div>
326
												<div class="more">
327
													<?php foreach (array_slice($harvestedRelatedDatasets, OpenAireViewArticle :: MAX_RELATED) as $relatedDataset) {
328
														echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
329
														echo(DatasetHelper :: formatDataset($relatedDataset, $this -> itemId));
330
													} ?>
331
												</div>
332
											<?php } ?>
333
										
334
										</div>  
335
										</span>
336
										<?php } ?>
337
										
338
										<?php 
339
											if($externalHarvestedDatasets!=null){
340
												usort($externalHarvestedDatasets, function ($a, $b) {if ($a->trust == $b->trust) {return 0;}return ($a->trust > $b->trust) ? -1 : 1;});
341
												 ?>
342
												 
343
										<span class="external-dataset">
344
										<div class="searchResults">
345
											<?php foreach (array_slice($externalHarvestedDatasets, 0, OpenAireViewArticle :: MAX_RELATED) as $externalDataset) {
346
												echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
347
												echo(DatasetHelper :: formatDataset($externalDataset, $this -> itemId));
348
											}
349
											if (count($externalHarvestedDatasets) > OpenAireViewArticle :: MAX_RELATED) { ?>
350
												<div class="pageController">
351
													<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($externalHarvestedDatasets)); ?></a>
352
												</div>
353
												<div class="more">
354
													<?php foreach (array_slice($externalHarvestedDatasets, OpenAireViewArticle :: MAX_RELATED) as $externalDataset) {
355
														echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
356
														echo(DatasetHelper :: formatDataset($externalDataset, $this -> itemId));
357
													} ?>
358
												</div>
359
											<?php } ?>
360
										</div> 
361
										</span>
362
										<?php } ?>
363
											
364
									</div>	
365
								<?php } 
366
								if($claimedRelatedDatasets!=null||$externalClaimedDatasets!=null){?>									
367
								?>
368
									<div class="section_claimed">
369
											<blockquote class="blockquote-nopad"><?php echo(JText :: _('RELATED_DATA_TECHNOLOGY')); ?></blockquote>										
370
									<?php if($claimedRelatedDatasets!=null){
371
										usort($claimedRelatedDatasets, function ($a, $b) {if ($a->trust == $b->trust) {return 0;}return ($a->trust > $b->trust) ? -1 : 1;});
372
										 ?>
373
										 
374
										<span class="internal-dataset">
375
										<div class="searchResults">
376
											<?php foreach (array_slice($claimedRelatedDatasets, 0, OpenAireViewArticle :: MAX_RELATED) as $relatedDataset) {									
377
													echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
378
													echo(DatasetHelper :: formatDataset($relatedDataset, $this -> itemId));												
379
											}
380
											if (count($claimedRelatedDatasets) > OpenAireViewArticle :: MAX_RELATED) { ?>
381
												<div class="pageController">
382
													<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($claimedRelatedDatasets)); ?></a>
383
												</div>
384
												<div class="more">
385
													<?php foreach (array_slice($claimedRelatedDatasets, OpenAireViewArticle :: MAX_RELATED) as $relatedDataset) {
386
														echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
387
														echo(DatasetHelper :: formatDataset($relatedDataset, $this -> itemId));
388
													} ?>
389
												</div>
390
											<?php } ?>
391
										
392
										</div>  
393
										</span>
394
										<?php } ?>
395
										
396
										<?php 
397
											if($externalClaimedDatasets!=null){
398
												usort($externalClaimedDatasets, function ($a, $b) {if ($a->trust == $b->trust) {return 0;}return ($a->trust > $b->trust) ? -1 : 1;});
399
												 ?>
400
												 
401
										<span class="external-dataset">
402
										<div class="searchResults">
403
											<?php foreach (array_slice($externalClaimedDatasets, 0, OpenAireViewArticle :: MAX_RELATED) as $externalDataset) {
404
												echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
405
												echo(DatasetHelper :: formatDataset($externalDataset, $this -> itemId));
406
											}
407
											if (count($externalClaimedDatasets) > OpenAireViewArticle :: MAX_RELATED) { ?>
408
												<div class="pageController">
409
													<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($externalClaimedDatasets)); ?></a>
410
												</div>
411
												<div class="more">
412
													<?php foreach (array_slice($externalClaimedDatasets, OpenAireViewArticle :: MAX_RELATED) as $externalDataset) {
413
														echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
414
														echo(DatasetHelper :: formatDataset($externalDataset, $this -> itemId));
415
													} ?>
416
												</div>
417
											<?php } ?>
418
										</div> 
419
										</span>
420
										<?php } ?>
421
											
422
									</div>
423
								<?php 
424
								} 
425
								 if($inferredRelatedDatasets!=null||$externalInferredDatasets!=null){?>									
426
								 
427
									<div class="section_inferred">
428
										
429
										<blockquote class="blockquote-nopad"><?php echo(JText :: _('RELATED_DATA_TECHNOLOGY')); ?></blockquote>										
430
									<?php if($inferredRelatedDatasets!=null){
431
										usort($inferredRelatedDatasets, function ($a, $b) {if ($a->trust == $b->trust) {return 0;}return ($a->trust > $b->trust) ? -1 : 1;});
432
										 ?>										
433
										 
434
										<span class="internal-dataset">
435
										<div class="searchResults">
436
											<?php foreach (array_slice($inferredRelatedDatasets, 0, OpenAireViewArticle :: MAX_RELATED) as $relatedDataset) {													
437
													echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
438
													echo(DatasetHelper :: formatDataset($relatedDataset, $this -> itemId));												
439
											}
440
											if (count($inferredRelatedDatasets) > OpenAireViewArticle :: MAX_RELATED) { ?>
441
												<div class="pageController">
442
													<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($inferredRelatedDatasets)); ?></a>
443
												</div>
444
												<div class="more">
445
													<?php foreach (array_slice($inferredRelatedDatasets, OpenAireViewArticle :: MAX_RELATED) as $relatedDataset) {
446
														echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
447
														echo(DatasetHelper :: formatDataset($relatedDataset, $this -> itemId));
448
													} ?>
449
												</div>
450
											<?php } ?>
451
										</div>  
452
										</span>
453
										<?php } ?>
454
										
455
										<?php 
456
											if($externalInferredDatasets!=null){
457
												usort($externalInferredDatasets, function ($a, $b) {if ($a->trust == $b->trust) {return 0;}return ($a->trust > $b->trust) ? -1 : 1;});
458
												 ?>
459
												 
460
										<span class="external-dataset">
461
										<div class="searchResults">
462
											<?php foreach (array_slice($externalInferredDatasets, 0, OpenAireViewArticle :: MAX_RELATED) as $externalDataset) {
463
												echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
464
												echo(DatasetHelper :: formatDataset($externalDataset, $this -> itemId));
465
											}
466
											if (count($externalInferredDatasets) > OpenAireViewArticle :: MAX_RELATED) { ?>
467
												<div class="pageController">
468
													<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($externalInferredDatasets)); ?></a>
469
												</div>
470
												<div class="more">
471
													<?php foreach (array_slice($externalInferredDatasets, OpenAireViewArticle :: MAX_RELATED) as $externalDataset) {
472
														echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
473
														echo(DatasetHelper :: formatDataset($externalDataset, $this -> itemId));
474
													} ?>
475
												</div>
476
											<?php } ?>
477
										</div>  
478
										</span>
479
										<?php } ?>
480
											
481
									</div>  
482
								<?php }  
483
								
484
								if($otherRelatedDatasets!=null||$externalOtherDatasets!=null){?>									
485
								?>
486
									<div class="section_other">
487
										
488
										<blockquote class="blockquote-nopad"><?php echo(JText :: _('RELATED_DATA_TECHNOLOGY')); ?></blockquote>										
489
									<?php if($otherRelatedDatasets!=null){
490
										usort($otherRelatedDatasets, function ($a, $b) {if ($a->trust == $b->trust) {return 0;}return ($a->trust > $b->trust) ? -1 : 1;});
491
										 ?>
492
										 
493
										<span class="internal-dataset">
494
										<div class="searchResults">
495
											<?php foreach (array_slice($otherRelatedDatasets, 0, OpenAireViewArticle :: MAX_RELATED) as $relatedDataset) {													
496
													echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
497
													echo(DatasetHelper :: formatDataset($relatedDataset, $this -> itemId));												
498
											}
499
											if (count($otherRelatedDatasets) > OpenAireViewArticle :: MAX_RELATED) { ?>
500
												<div class="pageController">
501
													<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($otherRelatedDatasets)); ?></a>
502
												</div>
503
												<div class="more">
504
													<?php foreach (array_slice($otherRelatedDatasets, OpenAireViewArticle :: MAX_RELATED) as $relatedDataset) {
505
														echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
506
														echo(DatasetHelper :: formatDataset($relatedDataset, $this -> itemId));
507
													} ?>
508
												</div>
509
											<?php } ?>
510
										</div>  
511
										</span>
512
										<?php } ?>
513
										
514
										<?php 
515
											if($externalOtherDatasets!=null){ 
516
												usort($externalOtherDatasets, function ($a, $b) {if ($a->trust == $b->trust) {return 0;}return ($a->trust > $b->trust) ? -1 : 1;});
517
												?>
518
												 
519
										<span class="external-dataset">
520
										<div class="searchResults">
521
											<?php foreach (array_slice($externalOtherDatasets, 0, OpenAireViewArticle :: MAX_RELATED) as $externalDataset) {
522
												echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
523
												echo(DatasetHelper :: formatDataset($externalDataset, $this -> itemId));
524
											}
525
											if (count($externalOtherDatasets) > OpenAireViewArticle :: MAX_RELATED) { ?>
526
												<div class="pageController">
527
													<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($externalOtherDatasets)); ?></a>
528
												</div>
529
												<div class="more">
530
													<?php foreach (array_slice($externalOtherDatasets, OpenAireViewArticle :: MAX_RELATED) as $externalDataset) {
531
														echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
532
														echo(DatasetHelper :: formatDataset($externalDataset, $this -> itemId));
533
													} ?>
534
												</div>
535
											<?php } ?>
536
										</div>  
537
										</span>
538
										<?php } ?>
539
											
540
									</div>
541
								<?php }  ?>
542
								
543
							 	<!-- <div class="section_inferred">
544
									<blockquote class="blockquote-nopad"><?php echo(JText :: _('RELATED_DATA_TECHNOLOGY')); ?></blockquote>
545
									
546
									<div class="searchResults">
547
										<?php foreach (array_slice($this -> article -> relatedDatasets, 0, OpenAireViewArticle :: MAX_RELATED) as $relatedDataset) {
548
												/* NMI this is a sample, width must be a parameter. This code could be in the datahelper php file. DO the same in the similar documents */												
549
												
550
												echo("<div title=\" ".($relatedDataset -> trust*100)."% \" style=\"float:right\" class=\"uk-progress\"><div class=\"uk-progress-bar\" style=\"width: ".($relatedDataset -> trust*100)."%;\">&nbsp;</div></div>");
551
												echo(DatasetHelper :: formatDataset($relatedDataset, $this -> itemId));												
552
										}
553
										if (count($this -> article -> relatedDatasets) > OpenAireViewArticle :: MAX_RELATED) { ?>
554
											<div class="pageController">
555
												<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($this -> article -> relatedDatasets)); ?></a>
556
											</div>
557
											<div class="more">
558
												<?php foreach (array_slice($this -> article -> relatedDatasets, OpenAireViewArticle :: MAX_RELATED) as $relatedDataset) {
559
													echo(DatasetHelper :: formatDataset($relatedDataset, $this -> itemId));
560
												} ?>
561
											</div>
562
										<?php } ?>
563
									</div>
564
									<div class="searchResults">
565
										<?php foreach (array_slice($this -> article -> externalDatasets, 0, OpenAireViewArticle :: MAX_RELATED) as $externalDataset) {
566
											echo(DatasetHelper :: formatDataset($externalDataset, $this -> itemId));
567
										}
568
										if (count($this -> article -> externalDatasets) > OpenAireViewArticle :: MAX_RELATED) { ?>
569
											<div class="pageController">
570
												<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($this -> article -> externalDatasets)); ?></a>
571
											</div>
572
											<div class="more">
573
												<?php foreach (array_slice($this -> article -> externalDatasets, OpenAireViewArticle :: MAX_RELATED) as $externalDataset) {
574
													echo(DatasetHelper :: formatDataset($externalDataset, $this -> itemId));
575
												} ?>
576
											</div>
577
										<?php } ?>
578
									</div>
579
								</div>
580
								-->
581
							
582
								<?php } ?>
583
							</div>
584
					<!-- 	Related Publications content tab  -->
585
					<!--	<div id="publtab" class="tabcontent"> 
586
								<?php if (($this -> article -> relatedPublications == NULL) && ($this -> article -> externalPublications == NULL)) { ?>
587
									<div class="box-info"><?php echo(JText :: _('NO_RELATED_PUBLICATIONS_STAY_TUNED_')); ?></div>
588
								<?php } else { ?>
589
									<div class="searchResults">
590
										<?php foreach (array_slice($this -> article -> relatedPublications, 0, OpenAireViewArticle :: MAX_RELATED) as $relatedPublication) {
591
											echo(PublicationHelper :: formatPublication($relatedPublication, $this -> itemId));
592
										}
593
										if (count($this -> article -> relatedPublications) > OpenAireViewArticle :: MAX_RELATED) { ?>
594
											<div class="pageController">
595
												<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($this -> article -> relatedPublications)); ?></a>
596
											</div>
597
											<div class="more">
598
												<?php foreach (array_slice($this -> article -> relatedPublications, OpenAireViewArticle :: MAX_RELATED) as $relatedPublication) {
599
													echo(PublicationHelper :: formatPublication($relatedPublication, $this -> itemId));
600
												} ?>
601
											</div>
602
										<?php } ?>
603
									</div>
604
									<div class="searchResults">
605
										<?php foreach (array_slice($this -> article -> externalPublications, 0, OpenAireViewArticle :: MAX_RELATED) as $externalPublication) {
606
											echo(PublicationHelper :: formatPublication($externalPublication, $this -> itemId));
607
										}
608
										if (count($this -> article -> externalPublications) > OpenAireViewArticle :: MAX_RELATED) { ?>
609
											<div class="pageController">
610
												<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($this -> article -> externalPublications)); ?></a>
611
											</div>
612
											<div class="more">
613
												<?php foreach (array_slice($this -> article -> externalPublications, OpenAireViewArticle :: MAX_RELATED) as $externalPublication) {
614
													echo(PublicationHelper :: formatPublication($externalPublication, $this -> itemId));
615
												} ?>
616
											</div>
617
										<?php } ?>
618
									</div>
619
								<?php } ?>
620
							</div>
621
					-->
622
							<div id="similartab" class="tabcontent">
623
								<?php if (($this -> article -> similarPublications == NULL)) { ?>
624
									<div class="box-info"><?php echo(JText :: _('NO_SIMILAR_PUBLICATIONS_STAY_TUNED_')); ?></div>
625
								<?php } else { ?>
626
									<blockquote class="blockquote-nopad"><?php echo(JText :: _('SIMILAR_PUBLICATIONS_TECHNOLOGY')); ?></blockquote>
627
								
628
									<div class="searchResults">
629
										<?php
630
										usort($this -> article -> similarPublications, function ($a, $b) {if ($a->trust == $b->trust) {
631
											if($a->year==null||$b->year==null||$a->year==$b->year){return 0;}return $a->year < $b->year;}return ($a->trust > $b->trust) ? -1 : 1;});
632
										 foreach (array_slice($this -> article -> similarPublications, 0, OpenAireViewArticle :: MAX_RELATED) as $relatedPublication) {
633
											echo(PublicationHelper :: formatTrustMeter($relatedPublication));
634
											echo(PublicationHelper :: formatPublication($relatedPublication, $this -> itemId));
635
										}
636
										if (count($this -> article -> similarPublications) > OpenAireViewArticle :: MAX_RELATED) { ?>
637
											<div class="pageController">
638
												<a class="viewall"><?php JText :: printf('VIEW_ALL_N', count($this -> article -> similarPublications)); ?></a>
639
											</div>
640
											<div class="more">
641
												<?php foreach (array_slice($this -> article -> similarPublications, OpenAireViewArticle :: MAX_RELATED) as $relatedPublication) {
642
													echo(PublicationHelper :: formatTrustMeter($relatedPublication));
643
													echo(PublicationHelper :: formatPublication($relatedPublication, $this -> itemId));
644
												} ?>
645
											</div>
646
										<?php } ?>
647
									</div>
648
									
649
								<?php } ?>
650
							</div>
651
							<div id="statstab" class="tabcontent">
652
								<img src="<?php echo($this -> statisticsExistUrl . $this -> article -> id); ?>" style="display: none;" />
653
								<iframe src="<?php echo($this -> statisticsChartUrl . $this -> article -> id); ?>" style="width: 100%;"></iframe>
654
								<div class="box-info"><?php echo(JText :: _('NO_METRICS_STAY_TUNED_')); ?></div>
655
							</div>
656
						</div>
657
					</div>
658
				</div>
659
			</div><!--innerLeft-->
660
			<div class="innerRight">
661
				<div class="mainFunctionsBlock">
662
					<div class="pageFunctionBlock">
663
						<a class="icon-print" target="_blank" href="<?php echo(JRoute :: _('index.php?option=com_openaire&view=printpublication&format=raw&publicationId=' . $this -> articleId)); ?>">&nbsp;</a>
664
						<a class="icon-mail" id="emailButton">&nbsp;</a>
665
						<form id="emailForm" method="post" action="<?php echo(JRoute :: _('index.php?option=com_openaire&view=emailpublication&format=raw&Itemid=' . $this -> itemId)); ?>">
666
							<input type="hidden" name="publicationId" value="<?php echo($this -> articleId); ?>" />
667
							<input type="email" name="recipient" value="<?php echo($user -> guest ? '' : $user -> email); ?>" placeholder="<?php echo(JText :: _('ENTER_RECIPIENT_ADDRESS')); ?>" />
668
							<input type="submit" value="<?php echo(JText :: _('SEND')); ?>" />
669
						</form>
670
					</div>
671
					<div class="functionsSection">
672
						<h3 class="title"><?php echo(JText :: _('SHARE_BOOKMARK')); ?></h3>
673
						<a href="http://www.facebook.com/dialog/feed?app_id=551016748244897&link=<?php echo(urlencode($canonicalUrl)); ?>&show_error=yes&redirect_uri=<?php echo(urlencode(JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=article&Itemid=' . $this -> itemId . '&articleId=' . $this -> article -> id))); ?>&name=<?php echo(urlencode($this -> article -> title)); ?>&caption=<?php echo(urlencode(JText :: _('CHECK_THIS_ARTICLE_OUT'))); ?>&message=<?php echo(urlencode(JText :: _('WHAT_DO_YOU_THINK_OF_THIS_ARTICLE_'))); ?>&actions=<?php echo(urlencode('{\'name\': \'' . JText :: _('CHECK_OUT_THE_PAPER') . '\', \'link\': \'' . $canonicalUrl . '\'}')); ?>" title="<?php echo(JText :: _('SHARE_ON_FACEBOOK')); ?>" rel="nofollow" target="_blank" class="social-button social-fb" onclick="return track('sharePublicationFacebook');"></a>
674
						<a href="https://twitter.com/share?text=<?php echo(urlencode('#' . JText :: _('OPENAIRE') . ': ' . $this -> article -> title));?>" target="_blank" rel="nofollow" title="<?php echo(JText :: _('SHARE_ON_TWITTER')); ?>" class="social-button social-twitter" onclick="return track('sharePublicationTwitter');"></a>
675
						<a href="https://plus.google.com/share?url=<?php echo(urlencode(JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=article&articleId=' . $this -> articleId))); ?>" target="_blank" rel="nofollow" title="<?php echo(JText :: _('SHARE_ON_GOOGLE_')); ?>" class="social-button social-google" onclick="return track('sharePublicationGoogle');"></a>
676
						<a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo(urlencode(JRoute :: _(JURI :: base() . 'index.php?option=com_openaire&view=article&articleId=' . $this -> articleId))); ?>&title=<?php echo(urlencode($this -> article -> title)); ?>&source=<?php echo(urlencode(JText :: _('OPENAIRE'))); ?>&summary=<?php echo(urlencode(($this -> article -> description == NULL) ? '-' : $this -> article -> description)); ?>" target="_blank" rel="nofollow" title="<?php echo(JText :: _('SHARE_ON_LINKEDIN')); ?>" class="social-button social-linkedin" onclick="return track('sharePublicationLinkedIn');"></a>
677
					</div>
678
					<?php if (array_filter(array_map(function ($datasource) {return ($datasource -> name != NULL) && ($datasource -> name != OpenAireViewArticle :: OTHER_RESOURCES) && ($datasource -> name != OpenAireViewArticle :: UNKNOWN_REPOSITORY);}, $this -> article -> datasources)) != NULL) { ?>
679
						<div class="functionsSection">
680
							<h3 class="title"><?php echo(JText :: _('DOWNLOAD_FROM')); ?></h3>
681
							<ul class="line">	
682
								<?php foreach($this -> article -> datasources as $datasource) {
683
									if (($datasource -> name != NULL) && ($datasource -> name != OpenAireViewArticle :: OTHER_RESOURCES) && ($datasource -> name != OpenAireViewArticle :: UNKNOWN_REPOSITORY)) {
684
										switch ($datasource -> accessMode) {
685
										case OpenAireViewArticle :: OPEN_ACCESS:
686
											$accessModeClass = 'openAccess';
687
											$accessModeTitle = JText :: _('OPEN_ACCESS');
688
											break;
689
										case OpenAireViewArticle :: EMBARGO_ACCESS:
690
											$accessModeClass = 'embargoAccess';
691
											$accessModeTitle = JText :: _('EMBARGO_ACCESS');
692
											break;
693
										case OpenAireViewArticle :: RESTRICTED_ACCESS:
694
											$accessModeClass = 'restrictedAccess';
695
											$accessModeTitle = JText :: _('RESTRICTED_ACCESS');
696
											break;
697
										case OpenAireViewArticle :: CLOSED_ACCESS:
698
											$accessModeClass = 'closedAccess';
699
											$accessModeTitle = JText :: _('CLOSED_ACCESS');
700
											break;
701
										default:
702
											$accessModeClass = NULL;
703
											$accessModeTitle = NULL;
704
										} ?>
705
										<li<?php echo(($accessModeClass == NULL) ? '' : (' class="' . $accessModeClass . '" title="' . $accessModeTitle . '"')); ?>>
706
											<?php echo((($datasource -> url == NULL) ? '' : ('<a target="_blank" class="icon-external" href="' . $datasource -> url . '" onclick="return track(\'downloadPublication\');">')) . $datasource -> name . (($datasource -> url == NULL) ? '' : '</a>')); ?>
707
										</li>
708
									<?php }
709
								} ?>
710
							</ul>
711
						</div>
712
					<?php }
713
					if (($this -> article -> sources != NULL) && (array_filter(array_map(function ($datasource) {return ($datasource -> name == NULL) || ($datasource -> name == OpenAireViewArticle :: OTHER_RESOURCES) || ($datasource -> name == OpenAireViewArticle :: UNKNOWN_REPOSITORY);}, $this -> article -> datasources)) != NULL)) { ?>
714
						<div class="functionsSection">
715
							<h3 class="title"><?php echo(JText :: _('PUBLISHED_IN')); ?></h3>
716
							<ul class="line">						
717
								<?php $i = 0;
718
								foreach ($this -> article -> datasources as $datasource) {
719
									if ((($datasource -> name == OpenAireViewArticle :: OTHER_RESOURCES) || ($datasource -> name == OpenAireViewArticle :: UNKNOWN_REPOSITORY)) && array_key_exists($i, $this -> article -> sources)) {
720
										switch ($datasource -> accessMode) {
721
										case OpenAireViewArticle :: OPEN_ACCESS:
722
											$accessModeClass = 'openAccess';
723
											$accessModeTitle = JText :: _('OPEN_ACCESS');
724
											break;
725
										case OpenAireViewArticle :: EMBARGO_ACCESS:
726
											$accessModeClass = 'embargoAccess';
727
											$accessModeTitle = JText :: _('EMBARGO_ACCESS');
728
											break;
729
										case OpenAireViewArticle :: RESTRICTED_ACCESS:
730
											$accessModeClass = 'restrictedAccess';
731
											$accessModeTitle = JText :: _('RESTRICTED_ACCESS');
732
											break;
733
										case OpenAireViewArticle :: CLOSED_ACCESS:
734
											$accessModeClass = 'closedAccess';
735
											$accessModeTitle = JText :: _('CLOSED_ACCESS');
736
											break;
737
										default:
738
											$accessModeClass = NULL;
739
											$accessModeTitle = NULL;
740
										} ?>
741
										<li<?php echo(($accessModeClass == NULL) ? '' : (' class="' . $accessModeClass . '" title="' . $accessModeTitle . '"'));?>>
742
											<?php echo((($datasource -> url == NULL) ? '' : ('<a target="_blank" class="icon-external" href="' . $datasource -> url . '" onclick="return track(\'downloadPublication\');">')) . $this -> article -> sources[$i++] . (($datasource -> url == NULL ? '' : '</a>'))); ?>
743
										</li>
744
									<?php }
745
								} ?>
746
							</ul>
747
						</div>
748
					<?php } ?>
749
					<?php if ($this -> article -> projects != NULL) { ?>
750
						<div class="functionsSection">
751
							<h3 class="title"><?php echo(JText :: _('FUNDED_BY_PROJECTS')); ?></h3>
752
							<ul class="line">
753
								
754
								<?php foreach($this -> article -> projects as $project) {
755
									if (($project != NULL) && (($project -> acronym != NULL) || ($project -> title != NULL))) { ?>
756
									<!-- slow ajax call
757
										<li><span><?php echo((($project -> id == NULL) ? '' : ('<a href="' . JRoute :: _('index.php?option=com_openaire&view=project&Itemid=' . $this -> itemId . '&projectId=' . $project -> id) . '">')) . ($project -> funding->funding_level_0 != NULL?$project -> funding->funding_level_0 . ": ":"") . (($project -> acronym == NULL) ? $project -> title : $project -> acronym) . (($project -> code == NULL) ? '' : (' (' . $project -> code . ')')) . (($project -> id == NULL) ? '' : ('</a>'))); ?></span>
758
										<span onmouseover="tooltip.ajax(this, 'index.php?option=com_openaire&view=projectfundings&format=raw&Itemid=<?php echo JRequest :: getUInt('Itemid', 0)?>&publicationId=<?php echo $this -> article -> id?>&project=<?php echo $project->id?>');"><img src="templates/yoo_solar/styles/openaire/images/box_info<?php echo ($project -> inferred)?"_ok":""?>.png" /></span>
759
										</li> -->
760
										<li>
761
										 <span><?php echo((($project -> id == NULL) ? '' : ('<a href="' . JRoute :: _('index.php?option=com_openaire&view=project&Itemid=' . $this -> itemId . '&projectId=' . $project -> id) . '">')) . ($project -> funding->funding_level_0 != NULL?$project -> funding->funding_level_0 . ": ":"") . (($project -> acronym == NULL) ? $project -> title : $project -> acronym) . (($project -> code == NULL) ? '' : (' (' . $project -> code . ')')) . (($project -> id == NULL) ? '' : ('</a>'))); ?></span>
762
										<span onmouseover="tooltip.pop(this, '#demo2_tip')"> <img src="templates/yoo_solar/styles/openaire/images/box_info<?php echo ($project -> inferred)?"_ok":""?>.png" /></span>
763
										<div style="display:none;"> <div id="demo2_tip"> 
764
											<h3><?php echo $project -> title?></h3>
765
											<ul>
766
											<?php if ($project -> funding -> funding_level_0 != NULL){ ?>
767
											<li><?php echo $project -> funding -> funding_level_0?></li>
768
											<?php }?>
769
											<?php if ($project -> funding -> funding_level_1 != NULL){ ?>
770
											<li><?php echo $project -> funding -> funding_level_1?></li>
771
											<?php }?>
772
											<?php if ($project -> funding -> funding_level_2 != NULL){ ?>
773
											<li><?php echo $project -> funding -> funding_level_2?></li>
774
											<?php }?>
775
											</ul>
776
											<?php if ($project -> inferred){?>
777
											<div>trust: <?php echo $project -> trust?>, provenance: <?php echo $project -> provenance?></div>
778
											<?php }?>
779
											</div> </div>
780
										</li>
781
									<?php }?>
782
								<?php }?>
783
								
784
							</ul>
785
						</div>
786
					<?php } ?>
787

    
788
					<?php if (count($this->article->contexts)){?>
789
						<div class="functionsSection section_context">
790
						   	<?php foreach($this -> article -> contexts as $context) { 
791
					    		    if ($context->type != "community") continue;
792
						    	?>
793
							<h3 class="title"><?php echo(JText :: _('LINKED_TO')); ?> </h3>
794
							<ul class="line">
795
								<?php foreach($context -> categories as $category) {
796
								        foreach ($category->concepts as $concept) {?>
797
								        <!-- NMI: can we put a link for search contenct around the context name? -->
798
										<li><span class="context_name"><?php echo $context->name ;?></span><?php echo $category -> name; ?>: <?php echo $concept -> name; ?></li>
799
										<?php } ?>
800
									<?php } ?>
801
							</ul>
802
						    <?php }?>
803
					</div>
804
					<?php }?>
805
					<div class="functionsSection">
806
						<h3 class="title"><?php echo(JText :: _('CITE_THIS_ARTICLE')); ?></h3>
807
						<div class="citationDownloader ">
808
							<select class="select" id="citations" name="citeselect">
809
								<option value="bibtex"><?php echo(JText :: _('BIBTEX')); ?></option>
810
								<option value="chicago"><?php echo(JText :: _('CHICAGO')); ?></option>
811
								<option value="ieee"><?php echo(JText :: _('IEEE')); ?></option>
812
							</select>
813
							<div id="citation" class="box-content"></div>
814
						</div>
815
					</div>
816
					<div class="functionsSection">
817
						<h3 class="title"><?php echo(JText :: _('COLLECTED_FROM')); ?></h3>
818
						<?php if (array_filter(array_map(function ($collectedFrom) {return ($collectedFrom -> name != NULL);}, $this -> article -> collectedFrom)) == NULL) { ?>
819
							<div class="box-info"><?php echo(JText :: _('NO_REPOSITORIES_FOUND')); ?></div>
820
						<?php } else { ?>
821
							<ul class="line">
822
								<?php foreach($this -> article -> collectedFrom as $collectedFrom) {
823
									if ($collectedFrom -> name != NULL) { ?>
824
										<li class="collectedFrom">
825
	<?php echo((($collectedFrom -> id == NULL) ? '' : ('<a href="' .  JRoute :: _('index.php?option=com_openaire&view=datasource&Itemid=' . $this -> itemId . '&datasourceId=' . $collectedFrom -> id) . '">')) . $collectedFrom -> name . (($collectedFrom -> id == NULL) ? '' : '</a>')); ?>
826
										</li>
827
									<?php }
828
								} ?>
829
							</ul>
830
						<?php } ?>
831
					</div>
832
		
833
		<?php if ($this -> article -> pids != NULL) {
834
						$doi='';
835
						$arxiv='';												
836
						foreach($this -> article -> pids as $pid){						
837
							if(strpos($pid-> clazz,OpenAireViewArticle :: DOI)!==false){								
838
								$doi=$pid-> value;
839
							}else if(strpos($pid-> clazz,OpenAireViewArticle :: ARXIV)!==false){
840
								$arxiv=$pid-> value;
841
							}													
842
						}		
843
						 				
844
						 if($doi!='' ){
845
							echo '<div class="functionsSection altmetrics" >
846
								<div data-badge-popover="bottom" data-badge-type="donut" data-doi="'.$doi.'" data-hide-no-mentions="true" class="altmetric-embed"></div>
847
							</div>';
848
				
849
						}else if($arxiv!=''){
850
							echo '<div class="functionsSection altmetrics" >
851
								<div data-badge-popover="bottom" data-badge-type="donut" data-arxiv-id="'.$arxiv.'" data-hide-no-mentions="true" class="altmetric-embed"></div>
852
							</div>';
853
						}
854
				 }
855
				?>
856
				</div>
857
				
858
			</div> <!--innerRight-->
859
		<?php } ?>
860
	</div><!--flowWrapper-->
861
</div>
(1-1/2)