/**
* {@inhericDoc}
* @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
*/
protected function renderContent()
{
/** @var \Fisharebest\Webtrees\Tree $tree */
$tree = $this->data->get('tree');
echo '<h2 class="center">', $this->data->get('title'), '</h2>';
echo '<p class="center alpha_index">', implode(' | ', $this->getInitialLettersList()), '</p>';
if ($this->data->get('issurnames', false)) {
$surns = $this->data->get('surnameslist', array());
$extra_params = array('mod' => Constants::MODULE_MAJ_PATROLIN_NAME, 'mod_action' => 'Lineage');
// Show the surname list
switch ($tree->getPreference('SURNAME_LIST_STYLE')) {
case 'style1':
echo FunctionsPrintLists::surnameList($surns, 3, true, WT_SCRIPT_NAME, $tree, $extra_params);
break;
case 'style3':
echo FunctionsPrintLists::surnameTagCloud($surns, WT_SCRIPT_NAME, true, $tree, $extra_params);
break;
case 'style2':
default:
echo FunctionsPrintLists::surnameTable($surns, WT_SCRIPT_NAME, $tree, $extra_params);
break;
}
} else {
if ($this->data->get('islineages', false)) {
//Link to indilist
echo '<p class="center"><strong>' . '<a href="indilist.php?ged=' . $tree->getNameUrl() . '&surname=' . rawurlencode($this->data->get('surname')) . '">' . I18N::translate('Go to the list of individuals with surname %s', $this->data->get('legend')) . '</a></strong></p>';
$lineages = $this->data->get('lineages', null);
$nb_lineages = count($lineages);
if (is_null($lineages) || $nb_lineages == 0) {
echo '<p class="center"><span class="warning">', I18N::translate('No individuals with surname %s has been found. Please try another name.', '<span dir="auto">' . $this->data->get('legend') . '</span>'), '</span></p>';
} else {
echo '<div id="patronymiclineages">' . '<div class="list_label">', $this->data->get('table_title'), '</div>';
echo '<div class="list_value_wrap">';
foreach ($lineages as $i => $lineage) {
$this->printRootLineage($lineage);
if ($i < $nb_lineages - 1) {
echo '<hr />';
}
}
echo '</div>';
echo '<div class="list_label">', I18N::translate('%s lineages found', $nb_lineages), '</div>' . '</div>';
}
}
}
}