/** * Parse the facts from the individual record */ function parseFacts($nfacts = NULL) { global $nonfacts; parent::parseFacts(); if ($nfacts != NULL) { $nonfacts = $nfacts; } //-- only run this function once if ($this->facts_parsed) { return; } //-- don't run this function if privacy does not allow viewing of details if (!$this->canDisplayDetails()) { return; } $sexfound = false; //-- run the parseFacts() method from the parent class $this->facts_parsed = true; //-- sort the fact info into different categories for people foreach ($this->facts as $f => $event) { $fact = $event->getTag(); // -- handle special name fact case if ($fact == "NAME") { $this->globalfacts[] = $event; } else { if ($fact == "SOUR") { $this->otherfacts[] = $event; } else { if ($fact == "NOTE") { $this->otherfacts[] = $event; } else { if ($fact == "SEX") { $this->globalfacts[] = $event; $sexfound = true; } else { if ($fact == "OBJE") { } else { if (!isset($nonfacts) || !in_array($fact, $nonfacts)) { $this->indifacts[] = $event; } } } } } } } //-- add a new sex fact if one was not found if (!$sexfound) { $this->globalfacts[] = new Event("1 SEX U", 'new'); } }