Commit fc9c733f authored by ssp's avatar ssp
Browse files

limit number of authors shown the short display to 3

show the remaining ones in the extended display
parent 83373202
......@@ -24,6 +24,14 @@
******************************************************************************/
// Maximum number of authors to display in the summary part of the record.
// (This could be more configurable and does not make particularly much sense
// to begin with, but is included to match the output given by the JavaScript
// generated markup.)
define(MAX_AUTHORS, 3);
/**
* ResultViewHelper.php
*
......@@ -244,9 +252,15 @@ private function authorInfo ($result) {
$outputText = $result['md-title-responsibility'][0]['values'][0];
if (!$outputText && $result['md-author']) {
$authors = Array();
foreach ($result['md-author'] as $author) {
$authorName = $author['values'][0];
$authors[] = $authorName;
foreach ($result['md-author'] as $index => $author) {
if ($index < MAX_AUTHORS) {
$authorName = $author['values'][0];
$authors[] = $authorName;
}
else {
$authors[] = Tx_Extbase_Utility_Localization::translate('et al.', 'Pazpar2');
break;
}
}
$outputText = implode('; ', $authors);
......@@ -439,6 +453,10 @@ private function renderDetails ($result) {
}
}
}
else if (array_key_exists('md-author', $result) && count($result['md-author']) > MAX_AUTHORS) {
$result['md-author-clean'] = array_slice($result['md-author'], MAX_AUTHORS);
}
$otherPeople = $result['md-other-person'];
if ($otherPeople) {
$result['md-other-person-clean'] = Array();
......
......@@ -79,6 +79,7 @@ Please run the search from a German university network for more complete results
<label index="gemäß">according to</label>
<label index="Ausgabe">Edition</label>
<label index="In">In</label>
<label index="et al.">et al.</label>
<label index="Im Katalog ansehen">View in catalogue.</label>
<label index="enthaltendes Werk im Katalog ansehen">View all associated items in catalogue.</label>
<label index="enthaltendes Werk">associated items</label>
......@@ -213,6 +214,7 @@ Bei Zugriff aus einem deutschen Universitätsnetzwerk umfaßt Ihre Abfrage zusä
<label index="gemäß">according to</label>
<label index="Ausgabe">Ausgabe</label>
<label index="In">In</label>
<label index="et al.">et al.</label>
<label index="Im Katalog ansehen">Im Katalog ansehen.</label>
<label index="enthaltendes Werk im Katalog ansehen">Alle zugehörigen Publikationen im Katalog ansehen.</label>
<label index="enthaltendes Werk">zugehörige Publikationen</label>
......
Subproject commit 67da0c99fe376688bd667f0b67de8c16a432f575
Subproject commit 6375e26661937cab94abfe836d45805bbfe8b36a
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment