Ejemplo n.º 1
0
    protected function formatChild($childNum, $child, $firstChildClass = '')
    {
        list($title, $fullname, $birthLabel, $birthDate, $birthPlace, $deathLabel, $deathDate, $deathPlace) = ESINHandler::getPersonSummary($child);
        if ($birthLabel == 'b. ') {
            $birthLabel = '';
        }
        if ($deathLabel == 'd. ') {
            $deathLabel = '';
        }
        return <<<END
<tr>
   <td class="wr-infotable-id {$firstChildClass}">{$childNum}.</td>
   <td class="{$firstChildClass}"><div class="wr-infotable-fullname">[[Person:{$title}|{$fullname}]]</div></td>
   <td class="{$firstChildClass}"><div class="wr-infotable-event">{$birthLabel}<span class="wr-infotable-date">{$birthDate}</span> <span class="wr-infotable-place">{$birthPlace}</span></div></td>
   <td class="{$firstChildClass}"><div class="wr-infotable-event">{$deathLabel}<span class="wr-infotable-date">{$deathDate}</span> <span class="wr-infotable-place">{$deathPlace}</span></div></td>
</tr>
END;
    }
Ejemplo n.º 2
0
    protected function getSpouseInfo($spouse, $width, $firstChildClass = '', $given = '', $surname = '', $isHusband = false)
    {
        $parents = '&nbsp;';
        if (isset($spouse)) {
            if ((string) $spouse['child_of_family']) {
                $parentTitle = (string) $spouse['child_of_family'];
                $parentNames = preg_replace('/(.*)\\(\\d+\\)$/', "\$1", $parentTitle);
                $parents = "Parents: [[Family:{$parentTitle}|{$parentNames}]]";
            }
            list($title, $fullname, $birthLabel, $birthDate, $birthPlace, $deathLabel, $deathDate, $deathPlace) = ESINHandler::getPersonSummary($spouse);
            $link = "[[Person:{$title}|{$fullname}]]";
        } else {
            $t = Title::makeTitle(NS_SPECIAL, 'AddPage');
            $stdGiven = strtolower($given) == 'unknown' ? '' : $given;
            $stdSurname = strtolower($surname) == 'unknown' ? '' : $surname;
            $url = $t->getFullURL('namespace=Person&sf=' . urlencode($this->title->getText()) . '&gnd=' . ($isHusband ? 'M' : 'F') . '&g=' . urlencode($stdGiven) . '&s=' . urlencode($stdSurname));
            $link = $this->isGedcomPage() || !($stdGiven || $stdSurname) ? "{$given} {$surname}" : "{$given} {$surname} <span class=\"plainlinks addspouselink\">([{$url} add])</span>";
            $birthLabel = $birthDate = $birthPlace = '';
            $deathLabel = $deathDate = $deathPlace = '';
        }
        return <<<END
<td style="width: {$width}%" class="{$firstChildClass}">
   <div class="wr-infobox-parents">{$parents}</div>
   <div class="wr-infobox-fullname">{$link}</div>
   <div class="wr-infobox-event">{$birthLabel}<span class="wr-infobox-date">{$birthDate}</span> <span class="wr-infobox-place">{$birthPlace}</span></div>
   <div class="wr-infobox-event">{$deathLabel}<span class="wr-infobox-date">{$deathDate}</span> <span class="wr-infobox-place">{$deathPlace}</span></div>
</td>
END;
    }