diff options
| -rw-r--r-- | admin_pgv_to_wt.php | 1 | ||||
| -rw-r--r-- | admin_trees_config.php | 9 | ||||
| -rw-r--r-- | help_text.php | 6 | ||||
| -rw-r--r-- | includes/functions/functions_print.php | 22 |
4 files changed, 34 insertions, 4 deletions
diff --git a/admin_pgv_to_wt.php b/admin_pgv_to_wt.php index 5939d000e9..9e77a75002 100644 --- a/admin_pgv_to_wt.php +++ b/admin_pgv_to_wt.php @@ -656,6 +656,7 @@ foreach ($GEDCOMS as $GEDCOM=>$GED_DATA) { $stmt_gedcom_setting->execute(array($GED_DATA['id'], 'COMMON_NAMES_THRESHOLD', $COMMON_NAMES_THRESHOLD)); $stmt_gedcom_setting->execute(array($GED_DATA['id'], 'CONTACT_USER_ID', get_user_id($CONTACT_EMAIL))); $stmt_gedcom_setting->execute(array($GED_DATA['id'], 'DEFAULT_PEDIGREE_GENERATIONS', $DEFAULT_PEDIGREE_GENERATIONS)); + $stmt_gedcom_setting->execute(array($GED_DATA['id'], 'EXPAND_NOTES', $EXPAND_NOTES)); $stmt_gedcom_setting->execute(array($GED_DATA['id'], 'EXPAND_RELATIVES_EVENTS', $EXPAND_RELATIVES_EVENTS)); $stmt_gedcom_setting->execute(array($GED_DATA['id'], 'EXPAND_SOURCES', $EXPAND_SOURCES)); $stmt_gedcom_setting->execute(array($GED_DATA['id'], 'FAM_FACTS_ADD', $FAM_FACTS_ADD)); diff --git a/admin_trees_config.php b/admin_trees_config.php index 5926109349..34a27f1372 100644 --- a/admin_trees_config.php +++ b/admin_trees_config.php @@ -91,6 +91,7 @@ case 'update': set_gedcom_setting(WT_GED_ID, 'COMMON_NAMES_THRESHOLD', WT_Filter::post('NEW_COMMON_NAMES_THRESHOLD', WT_REGEX_INTEGER, 40)); set_gedcom_setting(WT_GED_ID, 'CONTACT_USER_ID', WT_Filter::post('NEW_CONTACT_USER_ID')); set_gedcom_setting(WT_GED_ID, 'DEFAULT_PEDIGREE_GENERATIONS', WT_Filter::post('NEW_DEFAULT_PEDIGREE_GENERATIONS')); + set_gedcom_setting(WT_GED_ID, 'EXPAND_NOTES', WT_Filter::postBool('NEW_EXPAND_NOTES')); set_gedcom_setting(WT_GED_ID, 'EXPAND_RELATIVES_EVENTS', WT_Filter::postBool('NEW_EXPAND_RELATIVES_EVENTS')); set_gedcom_setting(WT_GED_ID, 'EXPAND_SOURCES', WT_Filter::postBool('NEW_EXPAND_SOURCES')); set_gedcom_setting(WT_GED_ID, 'FAM_FACTS_ADD', str_replace(' ', '', WT_Filter::post('NEW_FAM_FACTS_ADD'))); @@ -1016,6 +1017,14 @@ if (count(WT_Tree::getAll())==1) { //Removed because it doesn't work here for mu </tr> <tr> <td> + <?php echo WT_I18N::translate('Automatically expand notes'), help_link('EXPAND_NOTES'); ?> + </td> + <td> + <?php echo edit_field_yes_no('NEW_EXPAND_NOTES', get_gedcom_setting(WT_GED_ID, 'EXPAND_NOTES')); ?> + </td> + </tr> + <tr> + <td> <?php echo WT_I18N::translate('Automatically expand sources'), help_link('EXPAND_SOURCES'); ?> </td> <td> diff --git a/help_text.php b/help_text.php index 8a53675fe1..4b47408482 100644 --- a/help_text.php +++ b/help_text.php @@ -486,6 +486,11 @@ case 'DEFAULT_PEDIGREE_GENERATIONS': $text=WT_I18N::translate('Set the default number of generations to display on descendancy and pedigree charts.'); break; +case 'EXPAND_NOTES': + $title=WT_I18N::translate('Automatically expand notes'); + $text=WT_I18N::translate('This option controls whether or not to automatically display content of a <i>Note</i> record on the Individual page.'); + break; + case 'EXPAND_RELATIVES_EVENTS': $title=WT_I18N::translate('Automatically expand list of events of close relatives'); $text=WT_I18N::translate('This option controls whether or not to automatically expand the <i>Events of close relatives</i> list.'); @@ -525,7 +530,6 @@ case 'FORMAT_TEXT': WT_I18N::translate('Markdown is a simple system of formatting, used on websites such as Wikipedia. It uses unobtrusive punctuation characters to create headings and sub-headings, bold and italic text, lists, tables, etc.') . '</p>'; break; - case 'FULL_SOURCES': $title=WT_I18N::translate('Use full source citations'); $text=WT_I18N::translate('Source citations can include fields to record the quality of the data (primary, secondary, etc.) and the date the event was recorded in the source. If you don’t use these fields, you can disable them when creating new source citations.'); diff --git a/includes/functions/functions_print.php b/includes/functions/functions_print.php index 36f7858b42..840787c653 100644 --- a/includes/functions/functions_print.php +++ b/includes/functions/functions_print.php @@ -417,10 +417,26 @@ function print_note_record($text, $nlevel, $nrec, $textOnly=false) { if (strpos($text, "\n") === false) { // A one-line note? strip the block-level tags, so it displays inline - $html = strip_tags($html, '<a><strong><em>'); + return WT_Gedcom_Tag::getLabelValue($label, strip_tags($html, '<a><strong><em>')); + } elseif ($WT_TREE->preference('EXPAND_NOTES')) { + // A multi-line note, and we're expanding notes by default + return WT_Gedcom_Tag::getLabelValue($label, $html); + } else { + // A multi-line note, with an expand/collapse option + $element_id = 'n-' . uniqid(); + list($first, $rest) = explode("\n", $html, 2); + // If the first line contains HTML, we cannot easily display it after the "Note:" label. + // It may contain the first line of a table, an HREF that spans newlines, etc. + if (strpos($first, '<') !== false) { + $first = ''; + $rest = $html; + } + return + '<div class="fact_NOTE"><span class="label">' . + '<a href="#" onclick="expand_layer(\'' . $element_id . '\'); return false;"><i id="' . $element_id . '_img" class="icon-plus"></i></a> ' . WT_Gedcom_Tag::getLabel($label) . ': ' . + '</div>' . + '<div id="' . $element_id . '" style="display:none">' . $html . '</div>'; } - - return WT_Gedcom_Tag::getLabelValue($label, $html); } /** |
