Revision f9b5740e
Added by Andreas Kohlbecker over 3 years ago
modules/cdm_dataportal/includes/name.inc | ||
---|---|---|
499 | 499 |
} |
500 | 500 |
|
501 | 501 |
// Fill with protologues etc... |
502 |
$descriptionHtml = '';
|
|
502 |
$protologue_links = [];
|
|
503 | 503 |
if (array_setr('description', TRUE, $renderTemplate)) { |
504 |
$descriptions = cdm_ws_get(CDM_WS_PORTAL_NAME_DESCRIPTIONS, $taxon_name->uuid); |
|
505 |
if($descriptions){ |
|
506 |
foreach ($descriptions as $description) { |
|
507 |
if (!empty($description)) { |
|
508 |
foreach ($description->elements as $description_element) { |
|
509 |
$second_citation = ''; |
|
510 |
if (isset($description_element->multilanguageText_L10n) && $description_element->multilanguageText_L10n->text) { |
|
511 |
if(isset($description_element->feature) && $description_element->feature->uuid == UUID_ADDITIONAL_PUBLICATION){ |
|
512 |
$prefix = '& '; |
|
513 |
} else { |
|
514 |
$prefix = ''; |
|
515 |
} |
|
516 |
$second_citation = ' [' . $prefix . $description_element->multilanguageText_L10n->text . '].'; |
|
517 |
} |
|
518 |
$descriptionHtml .= $second_citation; |
|
519 |
$descriptionHtml .= cdm_description_element_media( |
|
520 |
$description_element, |
|
521 |
array( |
|
522 |
'application/pdf', |
|
523 |
'image/png', |
|
524 |
'image/jpeg', |
|
525 |
'image/gif', |
|
526 |
'text/html', |
|
527 |
) |
|
528 |
); |
|
529 |
|
|
504 |
$external_links = cdm_ws_get(CDM_WS_NAME_PROTOLOGUE_LINKS, $taxon_name->uuid); |
|
505 |
if($external_links){ |
|
506 |
foreach ($external_links as $link) { |
|
507 |
if (!empty($link->uri)) { |
|
508 |
$protologue_links[] = ' ' . l(font_awesome_icon_markup('fa-book'), $link->uri, ['html' => true]); |
|
530 | 509 |
} |
531 | 510 |
} |
532 | 511 |
} |
533 |
} |
|
534 |
array_setr('description', $descriptionHtml, $renderTemplate); |
|
512 |
array_setr('description', join(', ', $protologue_links), $renderTemplate); |
|
535 | 513 |
} |
536 | 514 |
|
537 | 515 |
// Render. |
Also available in: Unified diff
ref #9265 switching to NomenclaturalSource.links for protologues