';
}
private static function media_query_3a() {
$iid2 = WT_Filter::get('iid', WT_REGEX_XREF);
$controller=new WT_Controller_Simple();
$controller
->setPageTitle(WT_I18N::translate('Link to an existing media object'))
->pageHeader();
$record=WT_GedcomRecord::getInstance($iid2);
if ($record) {
$headjs='';
if ($record instanceof WT_Family) {
if ($record->getHusband()) {
$headjs=$record->getHusband()->getXref();
} elseif ($record->getWife()) {
$headjs=$record->getWife()->getXref();
}
}
?>
'Age at first marriage',
'Age' => 'Age at last birthday',
'Assets' => 'Assets = Owned,Rented - Value,Rent - Radio - Farm',
'BIC' => 'Born in County',
'BOE' => 'Born outside England',
'BP' => 'Birthplace - (Chapman format)',
'Birthplace' => 'Birthplace (Full format)',
'Bmth' => 'Month of birth - If born within Census year',
'ChB' => 'Children born alive',
'ChD' => 'Children who have died',
'ChL' => 'Children still living',
'DOB' => 'Date of birth',
'Edu' => 'Education - At School, Can Read, Can Write', // or "Cannot Read, Cannot Write" ??
'EmD' => 'Employed?',
'EmN' => 'Unemployed?',
'EmR' => 'Employer?',
'Employ' => 'Employment',
'Eng?' => 'English spoken?',
'EngL' => 'English spoken?, if not, Native Language',
'FBP' => 'Father’s Birthplace - (Chapman format)',
'Health' => 'Health - 1.Blind, 2.Deaf & Dumb, 3.Idiotic, 4.Insane, 5.Disabled etc',
'Home' => 'Home Ownership - Owned/Rented-Free/Mortgaged-Farm/House-Farm Schedule number',
'Industry' => 'Industry',
'Infirm' => 'Infirmities - 1. Deaf & Dumb, 2. Blind, 3. Lunatic, 4. Imbecile/feeble-minded',
'Lang' => 'If Foreign Born - Native Language',
'MBP' => 'Mother’s Birthplace - (Chapman format)',
'MC' => 'Marital Condition - Married, Single, Unmarried, Widowed or Divorced',
'Mmth' => 'Month of marriage - If married during Census Year',
'MnsE' => 'Months employed during Census Year',
'MnsU' => 'Months unemployed during Census Year',
'N/A' => 'If Foreign Born - Naturalized, Alien',
'NL' => 'If Foreign Born - Native Language',
'Name' => 'Full Name or Married name if married',
'Occupation' => 'Occupation',
'Par' => 'Parentage - Father if foreign born, Mother if foreign born',
'Race' => 'Race or Color - Black, White, Mulatto, Asian, Indian, Chinese etc',
'Relation' => 'Relationship to Head of Household',
'Sex' => 'Male or Female',
'Situ' => 'Situation - Disease, Infirmity, Convict, Pauper etc',
'Ten' => 'Tenure - Owned/Rented, (if owned)Free/Morgaged',
'Vet' => 'War Veteran?',
'WH' => 'Working at Home?',
'War' => 'War or Expedition',
'WksU' => 'Weeks unemployed during Census Year',
'YOI' => 'If Foreign Born - Year of immigration',
'YON' => 'If Foreign Born - Year of naturalization',
'YUS' => 'If Foreign Born - Years in the USA',
'YrsM' => 'Years Married, or Y if married in Census Year',
);
if (preg_match('/(.*)((?:\n.*)*)\n\.start_formatted_area\.\n(.*)((?:\n.*)*)\n.end_formatted_area\.((?:\n.*)*)/', $note->getNote(), $match)) {
// This looks like a census-assistant shared note
$title = WT_Filter::escapeHtml($match[1]);
$preamble = WT_Filter::escapeHtml($match[2]);
$header = WT_Filter::escapeHtml($match[3]);
$data = WT_Filter::escapeHtml($match[4]);
$postamble = WT_Filter::escapeHtml($match[5]);
$fmt_headers = array();
foreach ($headers as $key=>$value) {
$fmt_headers['.b.' . $key] = '' . $key . '';
}
// Substitue header labels and format as HTML
$thead = '
' . strtr(str_replace('|', '
', $header), $fmt_headers) . '
';
// Format data as HTML
$tbody = '';
foreach (explode("\n", $data) as $row) {
$tbody .= '
';
foreach (explode('|', $row) as $column) {
$tbody .= '
' . $column . '
';
}
$tbody .= '
';
}
return
$title . "\n" . // The newline allows the framework to expand the details and turn the first line into a link
'
' . $preamble . '
' .
'
' .
'' . $thead . '' .
'' . $tbody . '' .
'
' .
'
' . $postamble . '
';
} else {
// Not a census-assistant shared note - apply default formatting
return WT_Filter::formatText($note->getNote(), $WT_TREE);
}
}
// Modify the “add shared note” field, to create a note using the assistant
static function print_addnewnote_assisted_link($element_id, $xref, $action) {
global $controller;
// We do not yet support family records
if (!WT_GedcomRecord::getInstance($xref) instanceof WT_Individual) {
return '';
}
// Only modify “add shared note” links on the add/edit actions.
// TODO: does the “edit” action work?
if ($action != 'add' && $action != 'edit') {
return '';
}
// There are lots of “add shared note” links. We only need to modify the 2nd one
static $n = 0;
if (++$n != 2) {
return '';
}
$controller->addInlineJavascript('
var pid_array=jQuery("#pid_array");
function set_pid_array(pa) {
pid_array.val(pa);
}
');
return
' ' .
'' .
'' .
WT_I18N::translate('Create a new shared note using assistant') .
'';
}
// Add a selector containing UK/US/FR census dates
public static function censusDateSelector($action, $tag, $element_id) {
global $controller;
if ($action == 'add' && $tag == 'CENS') {
$controller->addInlineJavascript('
function addDate(theCensDate) {
var ddate = theCensDate.split(", ");
document.getElementById("setctry").value = ddate[3];
document.getElementById("setyear").value = ddate[0];
cal_setDateField("' . $element_id . '", parseInt(ddate[0]), parseInt(ddate[1]), parseInt(ddate[2]));
return false;
}
function pasteAsstDate(setcy, setyr) {
document.getElementById(setcy+setyr).selected = true;
addDate(document.getElementById("selcensdate").options[document.getElementById(\'selcensdate\').selectedIndex].value);
return false;
}
');
return '
';
} else {
return '';
}
}
}