diff options
| author | David Drury <ddrury@users.noreply.github.com> | 2016-05-05 18:20:42 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2016-05-05 18:20:42 +0100 |
| commit | 9bed57532ea66053c7bb1a108f10c2a9b03389ae (patch) | |
| tree | be23abac7908b72ed7e5face19a19dd89f4dad35 /app/Module/FamilyTreeStatisticsModule.php | |
| parent | b07f1a8fa59563d1e8ab2109d1cf8e34372f2f43 (diff) | |
| download | webtrees-9bed57532ea66053c7bb1a108f10c2a9b03389ae.tar.gz webtrees-9bed57532ea66053c7bb1a108f10c2a9b03389ae.tar.bz2 webtrees-9bed57532ea66053c7bb1a108f10c2a9b03389ae.zip | |
Unbalanced <div></div> in show_common_surnames section (#916)
Diffstat (limited to 'app/Module/FamilyTreeStatisticsModule.php')
| -rw-r--r-- | app/Module/FamilyTreeStatisticsModule.php | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/app/Module/FamilyTreeStatisticsModule.php b/app/Module/FamilyTreeStatisticsModule.php index 16b507610f..3b52886790 100644 --- a/app/Module/FamilyTreeStatisticsModule.php +++ b/app/Module/FamilyTreeStatisticsModule.php @@ -198,21 +198,15 @@ class FamilyTreeStatisticsModule extends AbstractModule implements ModuleBlockIn } if ($show_common_surnames) { - $surnames = FunctionsDb::getCommonSurnames($WT_TREE->getPreference('COMMON_NAMES_THRESHOLD'), $WT_TREE); - if (count($surnames) > 0) { - $content .= '<div class="clearfloat"><p><b>' . I18N::translate('Most common surnames') . '</b></p>'; - $content .= '<div class="common_surnames">'; - $i = 0; + $surnames =FunctionsDb::getCommonSurnames($WT_TREE->getPreference('COMMON_NAMES_THRESHOLD'), $WT_TREE); + if ($surnames) { + $names = ''; foreach ($surnames as $indexval => $surname) { - if (stristr($surname['name'], '@N.N') === false) { - if ($i > 0) { - $content .= ', '; - } - $content .= '<a href="' . "indilist.php?ged=" . $WT_TREE->getNameUrl() . "&surname=" . rawurlencode($surname['name']) . '">' . $surname['name'] . '</a>'; - $i++; - } + $names .= ', <a href="' . "indilist.php?ged=" . $WT_TREE->getNameUrl() . "&surname=" . rawurlencode($surname['name']) . '">' . $surname['name'] . '</a>'; } - $content .= '</div>'; + $content .= '<div class="clearfloat"><p><strong>' . I18N::translate('Most common surnames') . '</strong></p>'; + $content .= '<div class="common_surnames">'; + $content .= ltrim($names, ', ') . '</div></div>'; } } |
