Beispiel #1
0
    /**
     * {@inheritDoc}
     * @see \Fisharebest\Webtrees\Module\ModuleSidebarInterface::getSidebarContent()
     */
    public function getSidebarContent()
    {
        global $controller;
        ob_start();
        $root = $controller->getSignificantIndividual();
        if ($root) {
            $dindi = new Individual($root);
            if (!$dindi->canDisplayIsSourced()) {
                echo '<div class="error">', I18N::translate('This information is private and cannot be shown.'), '</div>';
            } else {
                echo '
	                <table class="issourcedtable">
	                   <tr>
	                       <td class="slabel"> ' . GedcomTag::getLabel('INDI') . '</td>
	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('R', $dindi->isSourced(), 'INDI', 1) . '</td>
	                   </tr>
	                   <tr>
	                       <td class="slabel">' . GedcomTag::getLabel('BIRT') . '</td>
	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isBirthSourced(), 'BIRT', 1) . '</td>
	                   </tr>';
                $fams = $root->getSpouseFamilies();
                ($ct = count($fams)) > 1 ? $nb = 1 : ($nb = ' ');
                foreach ($fams as $fam) {
                    $dfam = new Family($fam);
                    echo '
	                    <tr>
	                       <td class="slabel right">
	                           <a href="' . $fam->getHtmlUrl() . '"> ' . GedcomTag::getLabel('MARR');
                    if ($ct > 1) {
                        echo ' ', $nb;
                        $nb++;
                    }
                    echo '     </a>
	                       </td>
	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dfam->isMarriageSourced(), 'MARR', 1) . '</td>
	                   </tr>';
                }
                if ($root->isDead()) {
                    echo '
	                    <tr>
	                       <td class="slabel">' . GedcomTag::getLabel('DEAT') . '</td>
	                       <td class="svalue">' . FunctionsPrint::formatIsSourcedIcon('E', $dindi->isDeathSourced(), 'DEAT', 1) . '</td>
	                   </tr>';
                }
                echo '</table>';
            }
        }
        return ob_get_clean();
    }