diff options
| author | Greg Roach <fisharebest@gmail.com> | 2016-06-23 08:14:47 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2016-06-23 08:14:47 +0100 |
| commit | 877e7017bb20173c57feef674a7a2b87e9c92d5d (patch) | |
| tree | feae238088e7d2afcf6c248c8415c3c42f13ccff /app/Module/IndividualFactsTabModule.php | |
| parent | 07660c6784de912dff03f94c7d3f0f2b3d77a4d9 (diff) | |
| download | webtrees-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.php | 58 |
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>'; } |
