summaryrefslogtreecommitdiff
path: root/app/Module/IndividualFactsTabModule.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2016-06-23 08:14:47 +0100
committerGreg Roach <fisharebest@gmail.com>2016-06-23 08:14:47 +0100
commit877e7017bb20173c57feef674a7a2b87e9c92d5d (patch)
treefeae238088e7d2afcf6c248c8415c3c42f13ccff /app/Module/IndividualFactsTabModule.php
parent07660c6784de912dff03f94c7d3f0f2b3d77a4d9 (diff)
downloadwebtrees-877e7017bb20173c57feef674a7a2b87e9c92d5d.tar.gz
webtrees-877e7017bb20173c57feef674a7a2b87e9c92d5d.tar.bz2
webtrees-877e7017bb20173c57feef674a7a2b87e9c92d5d.zip
Replace default checkbox settings with persistant user settings
Diffstat (limited to 'app/Module/IndividualFactsTabModule.php')
-rw-r--r--app/Module/IndividualFactsTabModule.php58
1 files changed, 32 insertions, 26 deletions
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>';
}