Beispiel #1
0
 private function loadFamilyMembers()
 {
     $xml = null;
     $this->prevFamilyMembers = array();
     if ($this->isGedcomPage) {
         $dataString = GedcomUtil::getGedcomDataString();
         if ($dataString) {
             $xml = simplexml_load_string($dataString);
         }
     } else {
         $revision = StructuredData::getRevision($this->title);
         if ($revision) {
             $content =& $revision->getText();
             $xml = StructuredData::getXml('family', $content);
         }
     }
     if (isset($xml)) {
         foreach ($xml->husband as $member) {
             $title = (string) $member['title'];
             $this->prevFamilyMembers[$title] = Family::getFamilyMemberAttributes($member);
         }
         foreach ($xml->wife as $member) {
             $title = (string) $member['title'];
             $this->prevFamilyMembers[$title] = Family::getFamilyMemberAttributes($member);
         }
         foreach ($xml->child as $member) {
             $title = (string) $member['title'];
             $this->prevFamilyMembers[$title] = Family::getFamilyMemberAttributes($member);
         }
     }
 }
Beispiel #2
0
 private function loadPages()
 {
     $this->prevPeople = array();
     $this->prevFamilies = array();
     $revision = StructuredData::getRevision($this->title);
     if ($revision) {
         $content =& $revision->getText();
         $xml = StructuredData::getXml($this->tagName, $content);
         if (isset($xml)) {
             foreach ($xml->person as $person) {
                 $title = (string) $person['title'];
                 $this->prevPeople[$title] = Family::getFamilyMemberAttributes($person);
             }
             foreach ($xml->family as $family) {
                 $title = (string) $family['title'];
                 $this->prevFamilies[$title] = array();
             }
         }
     }
 }