diff options
| -rw-r--r-- | admin_pgv_to_wt.php | 1 | ||||
| -rw-r--r-- | admin_trees_config.php | 14 | ||||
| -rw-r--r-- | app/Module/IndividualFactsTabModule.php | 58 | ||||
| -rw-r--r-- | app/Module/NotesTabModule.php | 8 | ||||
| -rw-r--r-- | app/Module/RelativesTabModule.php | 10 | ||||
| -rw-r--r-- | app/Module/SourcesTabModule.php | 8 | ||||
| -rw-r--r-- | assets/js-1.7.7/webtrees.js | 10 |
7 files changed, 52 insertions, 57 deletions
diff --git a/admin_pgv_to_wt.php b/admin_pgv_to_wt.php index 5fc51ded49..452692c8bd 100644 --- a/admin_pgv_to_wt.php +++ b/admin_pgv_to_wt.php @@ -766,7 +766,6 @@ foreach ($GEDCOMS as $GEDCOM => $GED_DATA) { } $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)); $stmt_gedcom_setting->execute(array($GED_DATA['id'], 'FAM_FACTS_QUICK', $FAM_FACTS_QUICK)); diff --git a/admin_trees_config.php b/admin_trees_config.php index 4a7cda0e79..908ddea4f0 100644 --- a/admin_trees_config.php +++ b/admin_trees_config.php @@ -206,7 +206,6 @@ case 'general': $WT_TREE->setPreference('CONTACT_USER_ID', Filter::post('CONTACT_USER_ID')); $WT_TREE->setPreference('DEFAULT_PEDIGREE_GENERATIONS', Filter::post('DEFAULT_PEDIGREE_GENERATIONS')); $WT_TREE->setPreference('EXPAND_NOTES', Filter::postBool('EXPAND_NOTES')); - $WT_TREE->setPreference('EXPAND_RELATIVES_EVENTS', Filter::postBool('EXPAND_RELATIVES_EVENTS')); $WT_TREE->setPreference('EXPAND_SOURCES', Filter::postBool('EXPAND_SOURCES')); $WT_TREE->setPreference('FAM_FACTS_ADD', str_replace(' ', '', Filter::post('FAM_FACTS_ADD'))); $WT_TREE->setPreference('FAM_FACTS_QUICK', str_replace(' ', '', Filter::post('FAM_FACTS_QUICK'))); @@ -1362,19 +1361,6 @@ $controller <h3><?php echo I18N::translate('Individual pages'); ?></h3> - <!-- EXPAND_RELATIVES_EVENTS --> - <fieldset class="form-group"> - <legend class="control-label col-sm-3"> - <?php echo /* I18N: A configuration setting */ I18N::translate('Automatically expand list of events of close relatives'); ?> - </legend> - <div class="col-sm-9"> - <?php echo FunctionsEdit::radioButtons('EXPAND_RELATIVES_EVENTS', $no_yes, $WT_TREE->getPreference('EXPAND_RELATIVES_EVENTS'), 'class="radio-inline"'); ?> - <p class="small text-muted"> - <?php echo /* I18N: Help text for the “Automatically expand list of events of close relatives” configuration setting */ I18N::translate('This option controls whether or not to automatically expand the <i>Events of close relatives</i> list.'); ?> - </p> - </div> - </fieldset> - <!-- SHOW_RELATIVES_EVENTS --> <fieldset class="form-group"> <legend class="control-label col-sm-3"> diff --git a/app/Module/IndividualFactsTabModule.php b/app/Module/IndividualFactsTabModule.php index 6fc9d59d4b..d53b21fca6 100644 --- a/app/Module/IndividualFactsTabModule.php +++ b/app/Module/IndividualFactsTabModule.php @@ -119,24 +119,30 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf Functions::sortFacts($indifacts); ob_start(); - - echo '<table class="facts_table">'; - echo '<colgroup>'; - echo '<col class="width20">'; - echo '<col class="width80">'; - echo '</colgroup>'; - echo '<tbody>'; - echo '<tr><td colspan="2" class="descriptionbox rela">'; - echo '<form action="?"><input id="checkbox_rela_facts" type="checkbox" '; - echo $controller->record->getTree()->getPreference('EXPAND_RELATIVES_EVENTS') ? 'checked' : ''; - echo ' onclick="jQuery(\'tr.rela\').toggle();"><label for="checkbox_rela_facts">', I18N::translate('Events of close relatives'), '</label>'; - if (file_exists(Site::getPreference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php')) { - echo ' <input id="checkbox_histo" type="checkbox" '; - echo $EXPAND_HISTO_EVENTS ? 'checked' : ''; - echo ' onclick="jQuery(\'tr.histo\').toggle();"><label for="checkbox_histo">', I18N::translate('Historical facts'), '</label>'; - } - echo '</form>'; - echo '</td></tr>'; + ?> + <table class="facts_table"> + <colgroup> + <col class="width20"> + <col class="width80"> + </colgroup> + <tbody> + <tr> + <td colspan="2" class="descriptionbox noprint"> + <?php if ($controller->record->getTree()->getPreference('SHOW_RELATIVES_EVENTS')) : ?> + <label> + <input id="checkbox_rela_facts" type="checkbox" checked> + <?php echo I18N::translate('Events of close relatives'); ?> + </label> + <?php endif; ?> + <?php if (file_exists(Site::getPreference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php')) : ?> + <label> + <input id="checkbox_rela_facts" type="checkbox" checked> + <?php echo I18N::translate('Historical facts'); ?> + </label> + <?php endif; ?> + </td> + </tr> + <?php if (!$indifacts) { echo '<tr><td colspan="2" class="facts_value">', I18N::translate('There are no facts for this individual.'), '</td></tr>'; @@ -150,15 +156,15 @@ class IndividualFactsTabModule extends AbstractModule implements ModuleTabInterf if ($controller->record->canEdit()) { FunctionsPrint::printAddNewFact($controller->record->getXref(), $indifacts, 'INDI'); } - echo '</tbody>'; - echo '</table>'; - if (!$controller->record->getTree()->getPreference('EXPAND_RELATIVES_EVENTS')) { - echo '<script>jQuery("tr.rela").toggle();</script>'; - } - if (!$EXPAND_HISTO_EVENTS) { - echo '<script>jQuery("tr.histo").toggle();</script>'; - } + ?> + </tbody> + </table> + <script> + persistant_toggle("checkbox_rela_facts", "tr.rela"); + persistant_toggle("checkbox_histo", "tr.histo"); + </script> + <?php return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>'; } diff --git a/app/Module/NotesTabModule.php b/app/Module/NotesTabModule.php index ef1e83813a..1a406850cc 100644 --- a/app/Module/NotesTabModule.php +++ b/app/Module/NotesTabModule.php @@ -58,13 +58,10 @@ class NotesTabModule extends AbstractModule implements ModuleTabInterface { /** {@inheritdoc} */ public function getTabContent() { - global $WT_TREE, $controller; + global $controller; ob_start(); ?> - <script> - persistant_toggle("checkbox_note2", "row_note2"); - </script> <table class="facts_table"> <colgroup> <col class="width20"> @@ -120,6 +117,9 @@ class NotesTabModule extends AbstractModule implements ModuleTabInterface { } ?> </table> + <script> + persistant_toggle("checkbox_note2", ".row_note2"); + </script> <?php return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>'; diff --git a/app/Module/RelativesTabModule.php b/app/Module/RelativesTabModule.php index 661d6bf7a0..1fa62e752b 100644 --- a/app/Module/RelativesTabModule.php +++ b/app/Module/RelativesTabModule.php @@ -297,7 +297,7 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface { /** {@inheritdoc} */ public function getTabContent() { - global $WT_TREE, $show_full, $controller; + global $show_full, $controller; if (isset($show_full)) { $saved_show_full = $show_full; @@ -307,13 +307,10 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface { ob_start(); ?> - <script> - persistant_toggle("checkbox_elder", "elderdate"); - </script> <table class="facts_table"> <tr class="noprint"> <td class="descriptionbox rela"> - <label for="checkbox_elder"> + <label> <input id="checkbox_elder" type="checkbox" checked> <?php echo I18N::translate('Date differences'); ?> </label> @@ -402,6 +399,9 @@ class RelativesTabModule extends AbstractModule implements ModuleTabInterface { </td> </tr> </table> + <script> + persistant_toggle("checkbox_elder", ".elderdate"); + </script> <?php } ?> <br> <?php diff --git a/app/Module/SourcesTabModule.php b/app/Module/SourcesTabModule.php index 02baf06a9c..97a2ed697f 100644 --- a/app/Module/SourcesTabModule.php +++ b/app/Module/SourcesTabModule.php @@ -58,13 +58,10 @@ class SourcesTabModule extends AbstractModule implements ModuleTabInterface { /** {@inheritdoc} */ public function getTabContent() { - global $controller, $WT_TREE; + global $controller; ob_start(); ?> - <script> - persistant_toggle("checkbox_sour2", "row_sour2"); - </script> <table class="facts_table"> <tr class="noprint"> <td colspan="2" class="descriptionbox rela"> @@ -103,6 +100,9 @@ class SourcesTabModule extends AbstractModule implements ModuleTabInterface { } ?> </table> + <script> + persistant_toggle("checkbox_sour2", ".row_sour2"); + </script> <?php return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>'; diff --git a/assets/js-1.7.7/webtrees.js b/assets/js-1.7.7/webtrees.js index 8540d9cc7a..3b494f1334 100644 --- a/assets/js-1.7.7/webtrees.js +++ b/assets/js-1.7.7/webtrees.js @@ -973,13 +973,17 @@ function message(username, method, url) { * Persistant checkbox options to hide/show extra data. * @param checkbox_id - * @param data_class + * @param data_selector */ -function persistant_toggle(checkbox_id, data_class) { +function persistant_toggle(checkbox_id, data_selector) { var checkbox = document.getElementById(checkbox_id); - var elements = document.getElementsByClassName(data_class); + var elements = document.querySelectorAll(data_selector); var display = localStorage.getItem(checkbox_id); + if (!checkbox) { + return; + } + if (display !== "none") { display = ""; } |
