1
|
<?php
|
2
|
|
3
|
defined('_JEXEC') or die('Access denied');
|
4
|
|
5
|
jimport('joomla.methods');
|
6
|
|
7
|
// This helper formats persons.
|
8
|
abstract class PersonHelper {
|
9
|
// Format a person.
|
10
|
// $person the person to format
|
11
|
// $itemId the item ID to use for internal links
|
12
|
// return a string containing the full HTML for the person or an empty string if any errors occur
|
13
|
public static function formatPerson($person, $itemId) {
|
14
|
if (($person == NULL) || ((($person -> lastName == NULL) || ($person -> firstName == NULL)) && ($person -> fullName == NULL)))
|
15
|
return '';
|
16
|
return '<div class="srchRow"><h4>' . ('<a href="' . JRoute :: _('index.php?option=com_openaire&view=advancedsearchpublications&Itemid=' . $itemId . '&keyword=' . ((($author -> lastName == NULL) || ($author -> firstName == NULL)) ? $author -> fullName : ($author -> lastName . ', ' . $author -> firstName)).'&field=author&constraint=all') . '">') . ((($person -> lastName == NULL) || ($person -> firstName == NULL)) ? $person -> fullName : ($person -> lastName . ', ' . $person -> firstName)) . (($person -> id == NULL) ? '' : '</a>') . '</h4>' . (($person -> country == NULL) ? '' : ('<div class="biblio"><span class="country">' . $person -> country . '</span></div>')) . '</div>';
|
17
|
}
|
18
|
}
|
19
|
|