app/Module/InteractiveTree/TreeView.php
private function drawPersonName(Individual $individual, string $dashed): string
    {
        $family = $individual->primaryChildFamily();
        if ($family) {
            $family_name = strip_tags($family->fullName());
        } else {
            $family_name = I18N::translateContext('unknown family', 'unknown');
        }
        switch ($individual->sex()) {
            case 'M':
                /* I18N: e.g. “Son of [father name & mother name]” */
                $title = ' title="' . I18N::translate('Son of %s', $family_name) . '"';
                break;
            case 'F':
                /* I18N: e.g. “Daughter of [father name & mother name]” */
                $title = ' title="' . I18N::translate('Daughter of %s', $family_name) . '"';
                break;
            default:
                /* I18N: e.g. “Child of [father name & mother name]” */
                $title = ' title="' . I18N::translate('Child of %s', $family_name) . '"';
                break;
        }
        $sex = $individual->sex();

        return '<div class="tv' . $sex . ' ' . $dashed . '"' . $title . '><a href="' . e($individual->url()) . '"></a>' . $individual->fullName() . ' <span class="dates">' . $individual->getLifeSpan() . '</span></div>';
    }
private function drawPersonName(Individual $individual, string $dashed): string
    {
        $family = $individual->primaryChildFamily();
        if ($family) {
            $family_name = strip_tags($family->fullName());
        } else {
            $family_name = I18N::translateContext('unknown family', 'unknown');
        }
        switch ($individual->sex()) {
            case 'M':
                /* I18N: e.g. “Son of [father name & mother name]” */
                $title = ' title="' . I18N::translate('Son of %s', $family_name) . '"';
                break;
            case 'F':
                /* I18N: e.g. “Daughter of [father name & mother name]” */
                $title = ' title="' . I18N::translate('Daughter of %s', $family_name) . '"';
                break;
            default:
                /* I18N: e.g. “Child of [father name & mother name]” */
                $title = ' title="' . I18N::translate('Child of %s', $family_name) . '"';
                break;
        }
        $sex = $individual->sex();

        return '<div class="tv' . $sex . ' ' . $dashed . '"' . $title . '><a href="' . e($individual->url()) . '"></a>' . $individual->fullName() . ' <span class="dates">' . $individual->getLifeSpan() . '</span></div>';
    }
private function drawPersonName ( Individual $ individual , string $ dashed ) : string { $ family = $ individual -> primaryChildFamily ( ) ; if ( $ family ) { $ family_name = strip_tags ( $ family -> fullName ( ) ) ; } else { $ family_name = I18N :: translateContext ( 'unknown family' , 'unknown' ) ; } switch ( $ individual -> sex ( ) ) { case 'M' : /* I18N: e.g. “Son of [father name & mother name]” */ $ title = ' title="' . I18N :: translate ( 'Son of %s' , $ family_name ) . '"' ; break ; case 'F' : /* I18N: e.g. “Daughter of [father name & mother name]” */ $ title = ' title="' . I18N :: translate ( 'Daughter of %s' , $ family_name ) . '"' ; break ; default : /* I18N: e.g. “Child of [father name & mother name]” */ $ title = ' title="' . I18N :: translate ( 'Child of %s' , $ family_name ) . '"' ; break ; } $ sex = $ individual -> sex ( ) ; return '<div class="tv' . $ sex . ' ' . $ dashed . '"' . $ title . '><a href="' . e ( $ individual -> url ( ) ) . '"></a>' . $ individual -> fullName ( ) . ' <span class="dates">' . $ individual -> getLifeSpan ( ) . '</span></div>' ; }
Draw a person name preceded by sex icon, with parents as tooltip

@param Individual $individual The individual to draw
@param string     $dashed     Either "dashed", to print dashed top border to separate multiple spouses, or ""

@return string
Draw a person name preceded by sex icon with parents as tooltip