$var) { $newvars[$name]['id'] = $var; if (!empty($type[$name]) && (($type[$name]=='INDI') || ($type[$name]=='FAM') || ($type[$name]=='SOUR'))) { $record = WT_GedcomRecord::getInstance($var); if (!$record) { $action='setup'; } $gedcom = $record->getGedcom(); // If we wanted a FAM, and were given an INDI, look for a spouse if ($type[$name]=='FAM' && $record instanceof WT_Individual) { $tmp = false; foreach ($record->getSpouseFamilies() as $family) { $gedcom = $family->getGedcom(); $tmp = true; } if (!$tmp) { $action='setup'; } } $newvars[$name]['gedcom'] = $gedcom; } } $vars = $newvars; unset($newvars); foreach ($varnames as $indexval => $name) { if (!isset($vars[$name])) { $vars[$name]['id'] = ''; } } $reports=array(); foreach (WT_Module::getActiveReports() as $rep) { foreach ($rep->getReportMenus() as $menu) { if (preg_match('/report=('.preg_quote(WT_MODULES_DIR, '/').'[a-z0-9_]+\/[a-z0-9_]+\.xml)/', $menu->link, $match)) { $reports[$match[1]]=$menu->label; } } } if (!empty($report)) { if (!array_key_exists($report, $reports)) { $action = 'choose'; } } //-- choose a report to run if ($action=='choose') { $controller->setPageTitle(WT_I18N::translate('Choose a report to run')); $controller->pageHeader(); echo '