Exemplo n.º 1
0
 public static function loadFamilyMember($title)
 {
     $result = array();
     $revision = StructuredData::getRevision(Title::newFromText((string) $title, NS_PERSON), false, true);
     // get the latest version of the page
     if ($revision) {
         $content =& $revision->getText();
         $xml = StructuredData::getXml('person', $content);
         if (isset($xml)) {
             list($birthDate, $birthPlace, $chrDate, $chrPlace, $deathDate, $deathPlace, $burDate, $burPlace, $deathDesc, $burDesc) = ESINHandler::getBirthChrDeathBurDatePlaceDesc($xml);
             $result['birthdate'] = $birthDate;
             $result['birthplace'] = $birthPlace;
             $result['chrdate'] = $chrDate;
             $result['chrplace'] = $chrPlace;
             $result['deathdate'] = $deathDate;
             $result['deathplace'] = $deathPlace;
             $result['burialdate'] = $burDate;
             $result['burialplace'] = $burPlace;
             foreach ($xml->child_of_family as $pf) {
                 $result['child_of_family'] = (string) $pf['title'];
                 break;
             }
             $name = $xml->name;
             if (isset($name)) {
                 $result['given'] = (string) $name['given'];
                 $result['surname'] = (string) $name['surname'];
                 $result['title_prefix'] = (string) $name['title_prefix'];
                 $result['title_suffix'] = (string) $name['title_suffix'];
             }
         }
     }
     return $result;
 }
Exemplo n.º 2
0
 public static function isLiving($xml)
 {
     list($birthDate, $birthPlace, $chrDate, $chrPlace, $deathDate, $deathPlace, $burDate, $burPlace, $deathDesc, $burDesc) = ESINHandler::getBirthChrDeathBurDatePlaceDesc($xml);
     return ESINHandler::isLivingDates($birthDate, $chrDate, $deathDate, $deathPlace, $deathDesc, $burDate, $burPlace, $burDesc);
 }
Exemplo n.º 3
0
 public static function getPropagatedData($xml)
 {
     $o = array();
     $o['given'] = null;
     $o['surname'] = null;
     $o['titlePrefix'] = null;
     $o['titleSuffix'] = null;
     $o['gender'] = null;
     $o['birthDate'] = null;
     $o['birthPlace'] = null;
     $o['chrDate'] = null;
     $o['chrPlace'] = null;
     $o['deathDate'] = null;
     $o['deathPlace'] = null;
     $o['burDate'] = null;
     $o['burPlace'] = null;
     $o['firstParentFamily'] = null;
     $o['parentFamilies'] = array();
     $o['spouseFamilies'] = array();
     $o['images'] = array();
     if (isset($xml)) {
         $name = $xml->name;
         if (isset($name)) {
             $o['given'] = (string) $name['given'];
             $o['surname'] = (string) $name['surname'];
             $o['titlePrefix'] = (string) $name['title_prefix'];
             $o['titleSuffix'] = (string) $name['title_suffix'];
         }
         $o['gender'] = (string) $xml->gender;
         list($birthDate, $birthPlace, $chrDate, $chrPlace, $deathDate, $deathPlace, $burDate, $burPlace, $deathDesc, $burDesc) = ESINHandler::getBirthChrDeathBurDatePlaceDesc($xml);
         $o['birthDate'] = $birthDate;
         $o['birthPlace'] = $birthPlace;
         $o['chrDate'] = $chrDate;
         $o['chrPlace'] = $chrPlace;
         $o['deathDate'] = $deathDate;
         $o['deathPlace'] = $deathPlace;
         $o['burDate'] = $burDate;
         $o['burPlace'] = $burPlace;
         foreach ($xml->child_of_family as $pf) {
             if (!$o['firstParentFamily']) {
                 $o['firstParentFamily'] = (string) $pf['title'];
             }
             $o['parentFamilies'][] = (string) $pf['title'];
         }
         $o['spouseFamilies'] = StructuredData::getTitlesAsArray($xml->spouse_of_family);
         foreach ($xml->image as $i) {
             $o['images'][] = array('filename' => (string) $i['filename'], 'caption' => (string) $i['caption']);
         }
     }
     return $o;
 }