> $surnames
* @var bool $totals
* @var Tree $tree
*/
$items = [];
foreach ($surnames as $surn => $surns) {
foreach ($surns as $surname => $count) {
if ($surn === Individual::NOMEN_NESCIO) {
$label = I18N::translateContext('Unknown surname', '…');
$url = $module instanceof ModuleListInterface ? $module->listUrl($tree, ['alpha' => '@']) : '';
} elseif ($surname === '') {
if ($surn === '') {
$label = I18N::translate('No surname');
} else {
$label = e($surn);
}
$url = $module instanceof ModuleListInterface ? $module->listUrl($tree, ['alpha' => ',']) : '';
} else {
$label = e($surname);
$url = $module instanceof ModuleListInterface ? $module->listUrl($tree, ['surname' => $surn]) : '';
}
if ($totals) {
$item = I18N::translate('%1$s (%2$s)', '' . $label . '', I18N::number($count));
} else {
$item = $label;
}
if ($url !== '') {
$items[] = '' . $item . '';
} else {
$items[] = '' . $item . '';
}
}
}
?>
= implode(I18N::$list_separator, $items) ?>