$search); $_SESSION['sb_descendancy_last'] = $last; if (!empty($search)) return $this->search($search); else if (!empty($pid)) return $this->loadSpouses($pid, 1); else if (!empty($famid)) return $this->loadChildren($famid, 1); } // Implement WT_Module_Sidebar public function getSidebarContent() { global $WT_IMAGE_DIR, $WT_IMAGES; $out = '
'; $out .= '
'; if ($this->controller) { $root = null; if ($this->controller->pid) { $root = Person::getInstance($this->controller->pid); } else if ($this->controller->famid) { $fam = Family::getInstance($this->controller->famid); if ($fam) $root = $fam->getHusband(); if (!$root) $root = $fam->getWife(); } if ($root!=null) { $out .= ''; } } $out .= '
'; return $out; } public function getPersonLi(&$person, $generations=0) { global $WT_IMAGE_DIR, $WT_IMAGES; $out = ''; $out .= '
  • '; if ($generations>0) $out .= ''; else $out .= ''; $out .= $person->getSexImage().' '.$person->getListName().' '; if ($person->canDisplayDetails()) { $bd = $person->getBirthDeathYears(false,''); if (!empty($bd)) $out .= PrintReady(' ('.$bd.')'); } $out .= ' indi'; if ($generations>0) { $out .= '
    '; $out .= $this->loadSpouses($person->getXref()); $out .= '
    '; }else { $out .= '
    '; $out .= '
    '; } $out .= '
  • '; return $out; } public function getFamilyLi(&$family, &$person, $generations=0) { global $WT_IMAGE_DIR, $WT_IMAGES; $out = ''; $out .= '
  • '; $out .= ''; $out .= $person->getSexImage().$person->getListName(); $marryear = $family->getMarriageYear(); if (!empty($marryear)) { $out .= ' ('.translate_fact('MARR').' '.$marryear.')'; } $out .= ' indi'; $out .= 'family'; $out .= '
    '; $out .= $this->loadChildren($family->getXref(), $generations); $out .= '
    '; $out .= '
  • '; return $out; } public function search($query) { global $TBLPREFIX, $WT_IMAGES, $WT_IMAGE_DIR; if (strlen($query)<2) return ''; $sql= "SELECT ? AS type, i_id AS xref, i_file AS ged_id, i_gedcom AS gedrec, i_isdead, i_sex". " FROM {$TBLPREFIX}individuals, {$TBLPREFIX}name". " WHERE (i_id LIKE ? OR n_sort LIKE ?)". " AND i_id=n_id AND i_file=n_file AND i_file=?". " ORDER BY n_sort"; $rows= WT_DB::prepareLimit($sql, WT_AUTOCOMPLETE_LIMIT) ->execute(array('INDI', "%{$query}%", "%{$query}%", WT_GED_ID)) ->fetchAll(PDO::FETCH_ASSOC); $out = ''; return $out; } public function loadSpouses($pid, $generations=0) { $out = '"; return $out; } public function loadChildren($famid, $generations=0) { $out = '"; return $out; } }