> $surnames * @var bool $totals * @var Tree $tree */ $items = []; foreach ($surnames as $surn => $surns) { foreach ($surns as $surname => $count) { if ($surname === Individual::NOMEN_NESCIO) { $label = I18N::translateContext('Unknown surname', '…'); $url = $module instanceof ModuleListInterface ? $module->listUrl($tree, ['alpha' => '@']) : ''; } elseif ($surname === '') { $label = e($surn); $url = $module instanceof ModuleListInterface ? $module->listUrl($tree, ['surname' => $surn]) : ''; } 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[] = '