diff options
| author | Greg Roach <fisharebest@gmail.com> | 2016-05-05 18:35:18 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2016-05-06 18:13:57 +0100 |
| commit | e0275e5b7ce368b23dfcb822a9055da641a40f0b (patch) | |
| tree | a24af4c9a7601b9f06f972d29db7138ebe36673d /app/Module/FamilyTreeStatisticsModule.php | |
| parent | 3f8a84f78dc524fc712255f37172ecd87db56717 (diff) | |
| download | webtrees-e0275e5b7ce368b23dfcb822a9055da641a40f0b.tar.gz webtrees-e0275e5b7ce368b23dfcb822a9055da641a40f0b.tar.bz2 webtrees-e0275e5b7ce368b23dfcb822a9055da641a40f0b.zip | |
Tidy
Diffstat (limited to 'app/Module/FamilyTreeStatisticsModule.php')
| -rw-r--r-- | app/Module/FamilyTreeStatisticsModule.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/app/Module/FamilyTreeStatisticsModule.php b/app/Module/FamilyTreeStatisticsModule.php index 3b52886790..b0ce709705 100644 --- a/app/Module/FamilyTreeStatisticsModule.php +++ b/app/Module/FamilyTreeStatisticsModule.php @@ -198,15 +198,17 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn } if ($show_common_surnames) { - $surnames =FunctionsDb::getCommonSurnames($WT_TREE->getPreference('COMMON_NAMES_THRESHOLD'), $WT_TREE); + $surnames = FunctionsDb::getCommonSurnames($WT_TREE->getPreference('COMMON_NAMES_THRESHOLD'), $WT_TREE); + $surnames = array_map(function ($x) use ($WT_TREE) { + return '<a href="indilist.php?ged=' . $WT_TREE->getNameUrl() . '&surname=' . Filter::escapeUrl($x['name']) . '">' . Filter::escapeHtml($x['name']) . '</a>'; + }, $surnames); + $surnames = implode(I18N::$list_separator, $surnames); + if ($surnames) { - $names = ''; - foreach ($surnames as $indexval => $surname) { - $names .= ', <a href="' . "indilist.php?ged=" . $WT_TREE->getNameUrl() . "&surname=" . rawurlencode($surname['name']) . '">' . $surname['name'] . '</a>'; - } - $content .= '<div class="clearfloat"><p><strong>' . I18N::translate('Most common surnames') . '</strong></p>'; - $content .= '<div class="common_surnames">'; - $content .= ltrim($names, ', ') . '</div></div>'; + $content .= '<div class="clearfloat">'; + $content .= '<p><strong>' . I18N::translate('Most common surnames') . '</strong></p>'; + $content .= '<div class="common_surnames">' . $surnames . '</div>'; + $content .= '</div>'; } } |
