Example #1
0
/**
 * Show an option to preserve the existing CHAN record when editing.
 *
 * @param GedcomRecord $record
 *
 * @return string
 */
function keep_chan(GedcomRecord $record = null)
{
    global $WT_TREE;
    if (Auth::isAdmin()) {
        if ($record) {
            $details = GedcomTag::getLabelValue('DATE', $record->lastChangeTimestamp()) . GedcomTag::getLabelValue('_WT_USER', Filter::escapeHtml($record->lastChangeUser()));
        } else {
            $details = '';
        }
        return '<tr><td class="descriptionbox wrap width25">' . GedcomTag::getLabel('CHAN') . '</td><td class="optionbox wrap">' . '<input type="checkbox" name="keep_chan" value="1" ' . ($WT_TREE->getPreference('NO_UPDATE_CHAN') ? 'checked' : '') . '>' . I18N::translate('Keep the existing “last change” information') . $details . '</td></tr>';
    } else {
        return '';
    }
}