示例#1
0
    /**
     * Create wiki text from xml property
     */
    protected function toWikiText($parser)
    {
        $result = '';
        if (isset($this->xml)) {
            //         $result .= '{| id="structuredData" border=1 class="floatright" cellpadding=4 cellspacing=0 width=30%'."\n"
            //         $result = "{|\n";
            //         $result .=
            //         $hideTop = false;
            //			$result = "<div class=\"infobox-header\">Repository Information</div>\n{|\n"
            //				.$this->showField("Place", $this->formatAsLink((string)$this->xml->place, 'Place'), $hideTop)
            //				.$this->showField("URL", $this->formatUrl((string)$this->xml->url), $hideTop)
            //				.$this->showField("Phone", $this->xml->phone, $hideTop)
            //				.$this->showField("Postal Address", $this->formatAddress((string)$this->xml->postal_address), $hideTop)
            //				$this->showWatchers()
            //				."|}\n"
            // add infobox
            $result .= $this->getLV("Repository", $this->titleString, true);
            $result .= $this->getLV("Postal Address", $this->xml->postal_address);
            $result .= $this->getLV("Place", $this->xml->place, false, null, "Place");
            $result .= $this->getLV("Phone", $this->xml->phone);
            $result .= $this->getLV("URL", $this->xml->url);
            $infobox = <<<END
<div class="wr-infobox wr-infobox-repository">
<table>
{$result}
</table>
</div>
<wr_ad></wr_ad>
END;
            $result = $infobox . StructuredData::addCategories(array(), $this->xml->place);
        }
        return $result;
    }
示例#2
0
    /**
     * Create wiki text from xml property
     */
    protected function toWikiText($parser)
    {
        $result = '';
        if (isset($this->xml)) {
            // add infobox
            $source = $this->getLV("Source", $this->xml->source, "Source");
            $surnames = $this->getLV("Surnames", $this->xml->surname, 'Surname');
            $places = $this->getLV("Places", $this->xml->place, 'Place');
            $yearRange = (string) $this->xml->from_year;
            if ((string) $this->xml->to_year) {
                $yearRange .= ' - ' . (string) $this->xml->to_year;
            }
            $yearRange = $this->getLV("Year range", $yearRange);
            $result = <<<END
<div class="wr-infobox wr-infobox-transcript">
<table>
{$source}
{$surnames}
{$places}
{$yearRange}
</table>
</div>
<wr_ad></wr_ad>
END;
            $result .= StructuredData::addCategories($this->xml->surname, $this->xml->place, true, $this->titleString, $this->ns);
        }
        return $result;
    }
示例#3
0
    /**
     * Create wiki text from xml property
     */
    protected function toWikiText($parser)
    {
        $result = '';
        if (isset($this->xml)) {
            // add infobox
            $titleAuthor = $this->getTitleAuthor();
            $coverage = $this->getCoverage();
            $publicationInfo = $this->getPublicationInfo();
            $citation = $this->getCitation();
            $repo = $this->getRepo();
            $infobox = <<<END
<div class="wr-infobox wr-infobox-mysource">
{$titleAuthor}
{$coverage}
{$publicationInfo}
{$citation}
{$repo}
</div>
<wr_ad></wr_ad>
END;
            $result = $infobox . StructuredData::addCategories($this->xml->surname, $this->xml->place);
        }
        return $result;
    }
示例#4
0
    /**
     * Create wiki text from xml property
     */
    protected function toWikiText($parser)
    {
        global $wgESINHandler, $wgOut;
        $result = '';
        if (isset($this->xml)) {
            //			$result = '{| id="structuredData" border=1 class="floatright" cellpadding=4 cellspacing=0 width=30%'."\n";
            //			$result = "<div class=\"infobox-header\">Family Information</div>\n{|\n";
            //         $result = "{|\n";
            //			$hideTopBorder = false;
            //			$result .= $this->addValuesToTableDL(null, $this->xml->husband, 'formatFamilyMember', array('Husband', @$this->xml->husband[0]), $hideTopBorder);
            //			$hideTopBorder = $hideTopBorder || isset($this->xml->husband);
            //			$result .= $this->addValuesToTableDL(null, $this->xml->wife, 'formatFamilyMember', array('Wife', @$this->xml->wife[0]), $hideTopBorder);
            //			$hideTopBorder = $hideTopBorder || isset($this->xml->wife);
            //			$result .= $wgESINHandler->showEventsFacts($this->xml, $hideTopBorder);
            //			if (isset($this->xml->child)) {
            //				$result .= "|-\n! Children\n";
            //				$result .= $this->addValuesToTableDL(null, $this->xml->child, 'formatFamilyMember', array(null, null), true);
            //			}
            //			$result .= $this->showWatchers();
            //			$result .= "|}\n";
            // add infobox
            $image = $wgESINHandler->getPrimaryImage($this->xml);
            $numHusbands = $numWives = 0;
            foreach ($this->xml->husband as $spouse) {
                $numHusbands++;
            }
            foreach ($this->xml->wife as $spouse) {
                $numWives++;
            }
            if ($numHusbands < 1) {
                $numHusbands = 1;
            }
            if ($numWives < 1) {
                $numWives = 1;
            }
            $width = floor(100 / ($numHusbands + $numWives));
            $spouses = '';
            $firstChildClass = 'first-child';
            $husbandName = $wifeName = '';
            if (isset($this->xml->husband)) {
                foreach ($this->xml->husband as $spouse) {
                    $spouses .= $this->getSpouseInfo($spouse, $width, $firstChildClass);
                    $firstChildClass = '';
                    if (!$husbandName) {
                        $husbandName = StructuredData::constructName(@$spouse['given'], @$spouse['surname']);
                    }
                }
            } else {
                list($hg, $hs, $wg, $ws) = StructuredData::parseFamilyTitle($this->titleString);
                $spouses .= $this->getSpouseInfo(null, $width, $firstChildClass, $hg, $hs, true);
                $firstChildClass = '';
                $husbandName = StructuredData::constructName($hg, $hs);
            }
            if ($image) {
                $spouses .= $this->getImageInfo($image, $firstChildClass);
                $firstChildClass = '';
            }
            if (isset($this->xml->wife)) {
                foreach ($this->xml->wife as $spouse) {
                    $spouses .= $this->getSpouseInfo($spouse, $width, $firstChildClass);
                    $firstChildClass = '';
                    if (!$wifeName) {
                        $wifeName = StructuredData::constructName(@$spouse['given'], @$spouse['surname']);
                    }
                }
            } else {
                list($hg, $hs, $wg, $ws) = StructuredData::parseFamilyTitle($this->titleString);
                $spouses .= $this->getSpouseInfo(null, $width, $firstChildClass, $wg, $ws, false);
                $firstChildClass = '';
                $wifeName = StructuredData::constructName($wg, $ws);
            }
            // check rename needed
            if (!$this->isGedcomPage && mb_strpos($this->titleString, 'Unknown') !== false) {
                list($hg, $hs, $wg, $ws) = StructuredData::parseFamilyTitle($this->titleString);
                $husbandTitle = StructuredData::constructName($hg, $hs);
                $wifeTitle = StructuredData::constructName($wg, $ws);
                if (Person::isRenameNeeded($husbandTitle, $husbandName) || Person::isRenameNeeded($wifeTitle, $wifeName)) {
                    $correctTitle = StructuredData::constructFamilyName($husbandName, $wifeName);
                    $t = Title::makeTitle(NS_SPECIAL, 'Movepage');
                    $url = $t->getLocalURL('target=' . $this->title->getPrefixedURL() . '&wpNewTitle=' . wfUrlencode("Family:{$correctTitle}") . '&wpReason=' . wfUrlencode('make page title agree with name'));
                    $parser->mOutput->mSubtitle = 'This page can be <a href="' . $url . '">renamed</a>';
                    $wgOut->setSubtitle($parser->mOutput->mSubtitle);
                }
            }
            $marriageDate = $marriagePlace = '';
            $marriageFound = false;
            if (isset($this->xml->event_fact)) {
                foreach ($this->xml->event_fact as $eventFact) {
                    if ($eventFact['type'] == 'Marriage') {
                        $marriageFound = true;
                        $marriageDate = (string) $eventFact['date'];
                        $marriagePlace = $this->getPlace($eventFact);
                    }
                }
            }
            $marriage = '';
            if ($marriageFound) {
                $marriage = "<div class=\"wr-infobox-event\">m. <span class=\"wr-infobox-date\">{$marriageDate}</span> <span class=\"wr-infobox-place\">{$marriagePlace}</span></div>";
            }
            $result = <<<END
<div class="wr-infobox wr-infobox-family">
   <table class="wr-infobox-spouses">
      <tr>
         {$spouses}
      </tr>
   </table>
   {$marriage}
</div>
<wr_ad></wr_ad>
<div id="wr_familytreelink"><span class="wr-familytreelink-text">Family tree</span><span class="wr-familytreelink-arrow">▼</span></div>
END;
            // add source citations, images, notes
            $result .= $wgESINHandler->addSourcesImagesNotes($this, $parser);
            // add categories
            $surnames = array();
            foreach ($this->xml->husband as $husband) {
                $surnames[] = (string) $husband['surname'];
            }
            foreach ($this->xml->wife as $wife) {
                $surnames[] = (string) $wife['surname'];
            }
            $places = ESINHandler::getPlaces($this->xml);
            $result .= StructuredData::addCategories($surnames, $places, false);
        }
        return $result;
    }
示例#5
0
    /**
     * Create wiki text from xml property
     */
    protected function toWikiText($parser)
    {
        //        wfDebug("toWikiText=" . $this->xml->asXML() . "\n");
        global $wgESINHandler, $wgOut;
        $result = '';
        if (isset($this->xml)) {
            // check rename needed
            if (!$this->isGedcomPage && mb_strpos($this->titleString, 'Unknown') !== false) {
                $correctTitle = StructuredData::constructName(@$this->xml->name['given'], @$this->xml->name['surname']);
                if (Person::isRenameNeeded($this->titleString, $correctTitle)) {
                    $t = Title::makeTitle(NS_SPECIAL, 'Movepage');
                    $url = $t->getLocalURL('target=' . $this->title->getPrefixedURL() . '&wpNewTitle=' . wfUrlencode("Person:{$correctTitle}") . '&wpReason=' . wfUrlencode('make page title agree with name'));
                    $parser->mOutput->mSubtitle = 'This page can be <a href="' . $url . '">renamed</a>';
                    $wgOut->setSubtitle($parser->mOutput->mSubtitle);
                }
            }
            // add infoboxes
            $gender = (string) $this->xml->gender;
            switch ($gender) {
                case 'M':
                    $genderClass = '-male';
                    break;
                case 'F':
                    $genderClass = '-female';
                    break;
                default:
                    $genderClass = '';
            }
            $image = $wgESINHandler->getPrimaryImage($this->xml);
            $imageText = "<div class=\"wr-infobox-noimage{$genderClass}\"></div>";
            $imageURL = '';
            if (isset($image)) {
                $thumbWidth = SearchForm::THUMB_WIDTH;
                $filename = (string) $image['filename'];
                $t = Title::makeTitle(NS_IMAGE, $filename);
                if ($t && $t->exists()) {
                    $img = new Image($t);
                    $caption = (string) $image['caption'];
                    if (!$caption) {
                        $caption = $filename;
                    }
                    $maxWidth = 700;
                    $maxHeight = 300;
                    $width = $img->getWidth();
                    $height = $img->getHeight();
                    if ($maxWidth > $width * $maxHeight / $height) {
                        $maxWidth = wfFitBoxWidth($width, $height, $maxHeight);
                    }
                    $imageURL = $img->createThumb($maxWidth, $maxHeight);
                    $caption = str_replace('|', ' ', $caption);
                    $titleAttr = StructuredData::escapeXml("{$imageURL}|{$maxWidth}|{$caption}");
                    $imageText = "<span class=\"wr-imagehover\" title=\"{$titleAttr}\">[[Image:{$filename}|{$thumbWidth}x{$thumbWidth}px]]</span>";
                }
            }
            $fullname = StructuredData::getFullname($this->xml->name);
            if (!$fullname) {
                $fullname = '&nbsp;';
            }
            $birthDate = $birthPlace = $deathDate = $deathPlace = '';
            $chrDate = $chrPlace = $burDate = $burPlace = '';
            $birthFound = $deathFound = $chrFound = $burFound = false;
            $birthSource = $deathSource = false;
            if (isset($this->xml->event_fact)) {
                foreach ($this->xml->event_fact as $eventFact) {
                    if ($eventFact['type'] == 'Birth') {
                        $birthFound = true;
                        $birthDate = (string) $eventFact['date'];
                        $birthPlace = (string) $eventFact['place'];
                        $birthSource = (string) $eventFact['sources'];
                    } else {
                        if ($eventFact['type'] == 'Christening' || $eventFact['type'] == 'Baptism') {
                            $chrFound = true;
                            $chrDate = (string) $eventFact['date'];
                            $chrPlace = (string) $eventFact['place'];
                        } else {
                            if ($eventFact['type'] == 'Death') {
                                $deathFound = true;
                                $deathDate = (string) $eventFact['date'];
                                $deathPlace = (string) $eventFact['place'];
                                $deathSource = (string) $eventFact['sources'];
                            } else {
                                if ($eventFact['type'] == 'Burial') {
                                    $burFound = true;
                                    $burDate = (string) $eventFact['date'];
                                    $burPlace = (string) $eventFact['place'];
                                }
                            }
                        }
                    }
                }
            }
            $this->initHistoricalDataPerson($fullname, $gender, $imageURL);
            $birthLabel = '&nbsp;';
            if ($birthFound) {
                $birthLabel = 'b.';
                $this->addHistoricalDataEvent('birth', $birthDate, $birthPlace);
            } else {
                if ($chrFound) {
                    $birthLabel = 'chr.';
                    $this->addHistoricalDataEvent('christening', $chrDate, $chrPlace);
                    $birthDate = $chrDate;
                    $birthPlace = $chrPlace;
                }
            }
            $deathLabel = '&nbsp;';
            if ($deathFound) {
                $deathLabel = 'd.';
                $this->addHistoricalDataEvent('death', $deathDate, $deathPlace);
            } else {
                if ($burFound) {
                    $deathLabel = 'bur.';
                    $this->addHistoricalDataEvent('burial', $burDate, $burPlace);
                    $deathDate = $burDate;
                    $deathPlace = $burPlace;
                }
            }
            $fmtBirthPlace = Person::formatPlace($birthPlace);
            $fmtDeathPlace = Person::formatPlace($deathPlace);
            $familybadges = '';
            $marriageEvents = array();
            $parentFamilies = array();
            foreach ($this->xml->child_of_family as $f) {
                $parentFamilies[] = (string) $f['title'];
            }
            $found = false;
            foreach ($this->xml->child_of_family as $f) {
                list($key, $text) = $this->getFamilyBadge($f, true, $gender, $parentFamilies, $marriageEvents);
                $found = true;
                $familybadges .= $text;
            }
            if (!$found) {
                $familybadges .= $this->getAddFamilyLink(0);
            }
            $sort = array();
            $ix = 0;
            $prevKey = 0;
            $found = false;
            foreach ($this->xml->spouse_of_family as $f) {
                list($key, $text) = $this->getFamilyBadge($f, false, $gender, null, $marriageEvents);
                $found = true;
                if ($key) {
                    $prevKey = $key;
                } else {
                    $key = $prevKey;
                }
                $sort[$key * 50 + $ix] = $text;
                $ix++;
            }
            $result = <<<END
<div class="wr-infobox wr-infobox-person clearfix">
   <div class="wr-infobox-image">
      {$imageText}
   </div>
   <div class="wr-infobox-content">
      <div class="wr-infobox-fullname">{$fullname}</div>
      <div class="wr-infobox-event">{$birthLabel}<span class="wr-infobox-date">{$birthDate}</span> <span class="wr-infobox-place">{$fmtBirthPlace}</span></div>
      <div class="wr-infobox-event">{$deathLabel}<span class="wr-infobox-date">{$deathDate}</span> <span class="wr-infobox-place">{$fmtDeathPlace}</span></div>

   </div>
</div>
<wr_ad></wr_ad>
<div style="margin-top:2px" class="clearfix"><div id="wr_familytreelink" style="float:left">
<span class="wr-familytreelink-text">Family tree</span><span class="wr-familytreelink-arrow">▼</span>
</div><div style="float:right; margin-right:10px;">
</div></div>
END;
            ksort($sort, SORT_NUMERIC);
            foreach ($sort as $key => $text) {
                $familybadges .= $text;
            }
            $familybadges .= $this->getAddFamilyLink(!$found ? 1 : 2, (string) @$this->xml->name['given'], (string) @$this->xml->name['surname']);
            if ($familybadges) {
                $result .= "<div class=\"wr-infobox-familybadges\">{$familybadges}</div>";
            }
            //         $result .= '<div class="visualClearLeft"></div>';
            // add source citations, images, notes
            $result .= $wgESINHandler->addSourcesImagesNotes($this, $parser, $marriageEvents);
            // add categories
            $surnames = array();
            $surnames[] = (string) $this->xml->name['surname'];
            foreach ($this->xml->alt_name as $altName) {
                $surnames[] = (string) $altName['surname'];
            }
            $places = ESINHandler::getPlaces($this->xml);
            $result .= StructuredData::addCategories($surnames, $places, false);
        }
        return $result;
    }
示例#6
0
 /**
  * Create wiki text from xml property
  */
 protected function toWikiText($parser)
 {
     $result = '';
     if ($this->titleString != 'Main Page') {
         //         $result = '{| id="structuredData" border=1 class="floatright" cellpadding=4 cellspacing=0 width=30%'."\n";
         //			$result = "<div class=\"infobox-header\">Article Covers</div>\n{|\n";
         if (isset($this->xml)) {
             //            $result .= $this->addValuesToTableDL('Surname(s):', $this->xml->surname, 'formatAsLink', 'Surname');
             //            $result .= $this->addValuesToTableDL('Place(s):', $this->xml->place, 'formatAsLink', 'Place');
             //            if ((string)$this->xml->from_year || (string)$this->xml->to_year) {
             //               $result .= $this->addValueToTableDL("Year range:", "{$this->xml->from_year} - {$this->xml->to_year}");
             //            }
             //         }
             //   		$result .= $this->showWatchers();
             //         $result .= "|}\n";
             //         if (isset($this->xml)) {
             $surnames = $this->getLV("Surnames", $this->xml->surname, '', 'Surname');
             $places = $this->getLV("Places", $this->xml->place, '', 'Place');
             $yearRange = $this->getLV("Year range", $this->xml->from_year, (string) $this->xml->to_year);
             if ($surnames || $places || $yearRange) {
                 $heading = 'Article Covers';
             } else {
                 $heading = 'Share';
             }
             $result = "<div class=\"wr-infobox wr-infobox-article\"><div class=\"wr-infobox-heading\">{$heading}</div><dl>{$surnames}{$places}{$yearRange}</dl></div>";
             $result .= StructuredData::addCategories($this->xml->surname, $this->xml->place, true, $this->titleString, $this->ns);
         }
     }
     return $result;
 }
示例#7
0
 /**
  * Create wiki text from xml property
  */
 protected function toWikiText($parser)
 {
     $result = '';
     if (isset($this->xml)) {
         //			$result = "<div class=\"infobox-header\">Image Information</div>\n{|\n";
         //			$date = (string)$this->xml->date;
         //			$hideTopBorder = false;
         //			if ($date) {
         //				$result .= $this->addValueToTableDL('Date', $date);
         //				$hideTopBorder = true;
         //			}
         //		   $place = (string)$this->xml->place;
         //		   if ($place) {
         //   			$result .= $this->addValueToTableDL('Place', "[[Place:$place]]", $hideTopBorder);
         //				$hideTopBorder = true;
         //		   }
         //         $result .= $this->addValuesToTableDL('People', $this->xml->person, 'formatPerson', null, $hideTopBorder);
         //			$hideTopBorder = $hideTopBorder || isset($this->xml->person[0]);
         //         $result .= $this->addValuesToTableDL('Families', $this->xml->family, 'formatFamily', null, $hideTopBorder);
         //			$hideTopBorder = $hideTopBorder || isset($this->xml->family[0]);
         //			if ((string)$this->xml->copyright_holder) {
         //			   $result .= $this->addValueToTableDL('Copyright holder', (string)$this->xml->copyright_holder, $hideTopBorder);
         //			}
         //			$license = (string)$this->xml->license;
         //			if ($license) {
         //			   $license = "{{".$license."}}";
         //			}
         //			else {
         //			   $license = "<font color=red>None selected</font>";
         //			}
         //			$result .= $this->addValueToTableDL('License', $license, true);
         //			$result .= $this->showWatchers();
         //   		$result .= "|}\n";
         // clear left
         //			$result .= "<div class=\"visualClearLeft\"></div>";
         $date = $this->getLV("Date", $this->xml->date);
         $place = $this->getLV("Place", $this->xml->place, 'Place');
         $people = $this->getLV("People", $this->xml->person, 'Person');
         $families = $this->getLV("Families", $this->xml->family, 'Family');
         $copyrightHolder = $this->getLV("Copyright holder", $this->xml->copyright_holder);
         $result = "<div class=\"wr-infobox wr-infobox-imagepage\"><div class=\"wr-infobox-heading\">Image Information</div><dl>{$date}{$place}{$people}{$families}{$copyrightHolder}</dl></div>";
         // add fotonotes
         $fn = new Fotonotes($this->title);
         $result .= $fn->renderImageNotes($this->xml->note);
         // add categories
         $places = array();
         $places[] = (string) $this->xml->place;
         $surnames = array();
         foreach ($this->xml->person as $person) {
             $surnames[] = (string) $person['surname'];
         }
         foreach ($this->xml->family as $family) {
             $matches = array();
             if (preg_match('/.*?([^ ]+) +and .*?([^ ]+) +\\(\\d+\\)$/', (string) $family['title'], $matches)) {
                 if ($matches[1] != 'Unknown') {
                     $surnames[] = $matches[1];
                 }
                 if ($matches[2] != 'Unknown') {
                     $surnames[] = $matches[2];
                 }
             }
         }
         $result .= StructuredData::addCategories($surnames, $places);
         // Add license category(ies) as whatever is in between comments
         // This is pretty ugly because we add the entire template again in ImagePage, but there it's added to late
         // at that stage for the parser to add this page to categories
         $license = (string) $this->xml->license;
         if ($license) {
             $licenseTitle = Title::makeTitleSafe(NS_TEMPLATE, $license);
             if ($licenseTitle) {
                 $licenseRevision = Revision::newFromTitle($licenseTitle);
                 if ($licenseRevision) {
                     $licenseText =& $licenseRevision->getText();
                     $matches = array();
                     if (preg_match('#<!--(.*?)-->#', $licenseText, $matches)) {
                         $result .= $matches[1];
                     }
                 }
             }
         }
     } else {
         // clear left
         //			$result .= "<div class=\"visualClearLeft\"></div>";
     }
     return $result;
 }
示例#8
0
    /**
     * Create wiki text from xml property
     */
    protected function toWikiText($parser)
    {
        $result = '';
        if (isset($this->xml)) {
            // add infobox
            $titleAuthor = $this->getTitleAuthor();
            $coverage = $this->getCoverage();
            $publicationInfo = $this->getPublicationInfo();
            $citation = $this->getCitation();
            $repos = $this->getRepos();
            $searchString = $this->cleanSearchString($this->xml->author . ' ' . $this->getSourceTitle());
            $searchGoogle = "<div class=\"sourcesource\">[http://www.google.com/search?btnG=Search+Books&tbm=bks&tbo=1&q={$searchString} search google books]</div>";
            $searchWorldcat = "<div class=\"sourcesource\">[http://www.worldcat.org/search?q={$searchString} search worldcat]</div>";
            $infobox = <<<END
<div class="wr-infobox wr-infobox-source">
{$searchGoogle}
{$searchWorldcat}
{$titleAuthor}
{$coverage}
{$publicationInfo}
{$citation}
{$repos}
</div>
<wr_ad></wr_ad>
END;
            $result = $infobox . StructuredData::addCategories($this->xml->surname, $this->xml->place);
        }
        return $result;
    }
示例#9
0
 /**
  * Create wiki text from xml property
  */
 protected function toWikiText($parser)
 {
     global $wrHostName;
     $result = '';
     if (!$this->isSubpage) {
         $familyTrees = FamilyTreeUtil::getFamilyTrees($this->userName, true);
         $personalResearchPages = $this->getPersonalResearchPages();
     } else {
         $familyTrees = array();
         $personalResearchPages = array();
     }
     //		 $result = '{| id="structuredData" border=1 class="floatright"    cellpadding=4 cellspacing=0 width=40%'."\n";
     //		 $result = "<div class=\"infobox-header\">Profile</div>\n{|\n";
     //		 if (count($familyTrees) > 0) {
     //		    $result .= $this->addRowsToTable('Family Tree(s)', $familyTrees, 'formatFamilyTree', null);
     //		 }
     if (isset($this->xml)) {
         //   		 if ($this->isSubpage) {
         //               $result .= $this->addValuesToTableDL('Surname(s):', $this->xml->surname, 'formatAsLink', 'Surname');
         //               $result .= $this->addValuesToTableDL('Place(s):', $this->xml->place, 'formatAsLink', 'Place');
         //               if ((string)$this->xml->from_year || (string)$this->xml->to_year) {
         //                   $result .= $this->addValueToTableDL("Year range:", "{$this->xml->from_year} - {$this->xml->to_year}");
         //               }
         //   		 }
         //   		 else {
         //               $result .= $this->addRowsToTable('Researching', $this->xml->researching, 'formatResearchLinks', null);
         //               $result .= $this->addRowsToTable('User Pages', $this->getPersonalResearchPages(), 'formatPersonalResearchPageLink', null);
         //   		 }
         $values = array();
         foreach ($this->xml->researching as $researching) {
             $surname = StructuredData::standardizeNameCase((string) $researching['surname'], false);
             //             $fields = explode('|',(string)$researching['place']);
             //             $place = trim($fields[0]);
             //             $surnames = array();
             //             $places = array();
             //             if ($surname) $surnames[] = $surname;
             //             if ($place) $places[] = $place;
             //             $categories = StructuredData::addCategories($surnames, $places, true, '', NS_MAIN, true);
             //             $ret = '';
             //             if ($surname && $place) {
             //                $ret = "<dl><dt>[[$surname in $place]]<dd>Categories: $categories</dl>";
             //             }
             //             else if ($surname) {
             //                $ret = "<dl><dt>[[Surname:$surname]]<dd>Category: $categories</dl>";
             //             }
             //             else if ($place) {
             //                $ret = "<dl><dt>[[Place:$place]]<dd>Category: $categories</dl>";
             //             }
             //             if ($ret) $values[] = $ret;
             if ($surname) {
                 $values[] = '[http://' . $wrHostName . '/wiki/Special:Search?ns=User&s=' . $surname . ' ' . $surname . ']';
             }
         }
         $researching = $this->getLV('Users Researching', array_unique($values));
         $values = array();
         foreach ($this->xml->surname as $surname) {
             $values[] = $this->formatAsLink((string) $surname, 'Surname');
         }
         $surnames = $this->getLV('Surnames', $values);
         $values = array();
         foreach ($this->xml->place as $place) {
             $values[] = $this->formatAsLink((string) $place, 'Place');
         }
         $places = $this->getLV('Places', $values);
         $fromYear = (string) $this->xml->from_year;
         $toYear = (string) $this->xml->to_year;
         $yearRange = '';
         if ($fromYear || $toYear) {
             $yearRange = $this->getLV('Year range', "{$fromYear} - {$toYear}");
         }
         $values = array();
         foreach ($familyTrees as $familyTree) {
             $values[] = '<dl><dt>' . $familyTree['name'] . ' <span class="plainlinks">' . ' ([http://' . $wrHostName . '/wiki/Special:Search?k=' . urlencode('+Tree:"' . $this->userName . '/' . $familyTree['name'] . '"') . " view])" . ' ([http://' . $wrHostName . '/fte/index.php?userName='******'&treeName=' . urlencode($familyTree['name']) . " launch FTE])" . "</span><dd>people: {$familyTree['count']}</dl>";
         }
         $familyTrees = $this->getLV('Family Trees', $values);
         $values = array();
         foreach ($personalResearchPages as $personalResearchPage) {
             $t = Title::newFromText($personalResearchPage, NS_USER);
             if ($t) {
                 $values[] = '[[' . $t->getPrefixedText() . '|' . $t->getText() . ']]';
             }
         }
         $personalResearchPages = $this->getLV('User pages', $values);
         $heading = $surnames || $places || $yearRange ? 'Page Covers' : '';
         $result = "<div class=\"wr-infobox wr-infobox-userpage\"><div class=\"wr-infobox-heading\">{$heading}</div><dl>{$surnames}{$places}{$yearRange}{$familyTrees}{$researching}{$personalResearchPages}</dl></div>";
     }
     //		 $result .= $this->showWatchers();
     //		 $result .= "|}\n";
     if (isset($this->xml)) {
         if ($this->isSubpage) {
             $result .= StructuredData::addCategories($this->xml->surname, $this->xml->place);
         } else {
             foreach ($this->xml->researching as $researching) {
                 $surnames = array();
                 $places = array();
                 $surnames[] = (string) $researching['surname'];
                 $places[] = (string) $researching['place'];
                 $result .= StructuredData::addCategories($surnames, $places);
             }
         }
     }
     return $result;
 }