Last modified should not be shown if not configured at all

This commit is contained in:
phl0
2026-01-02 13:02:03 +01:00
parent ff46d3005f
commit 27785d243d
2 changed files with 4 additions and 4 deletions

View File

@@ -126,7 +126,7 @@
\"qth\":{\"show\":\"true\"},
\"frequency\":{\"show\":\"true\"},
\"dcl\":{\"show\":\"true\"},
\"last_modification\":{\"show\":\"true\"},
\"last_modification\":{\"show\":\"false\"},
}";
}
$current_opts = json_decode($options);
@@ -236,7 +236,7 @@
echo "\nuser_options={...user_options, ...o_template};";
}
if (!isset($current_opts->last_modification)) {
echo "\nvar o_template = { last_modification: {show: 'true'}};";
echo "\nvar o_template = { last_modification: {show: 'false'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
@@ -874,7 +874,7 @@ $options = json_decode($options);
<?php if (($options->datetime->show ?? "true") == "true") {
echo '<th>' . __("Date/Time") . '</th>';
} ?>
<?php if (($options->last_modification->show ?? "true") == "true") {
<?php if (($options->last_modification->show ?? "false") == "true") {
echo '<th>' . __("Last modified") . '</th>';
} ?>
<?php if (($options->de->show ?? "true") == "true") {

View File

@@ -192,7 +192,7 @@
</tr>
<tr>
<td><span title="<?= __("This is meant for debugging purposes only and not designed to be displayed by default"); ?>"><?= __("Last modified"); ?> <small id="debug_last_modified" class="badge text-bg-danger"><?= __("For debugging only"); ?></small></span></td>
<td><div class="form-check"><input class="form-check-input" name="last_modification" type="checkbox" <?php if (($options->last_modification->show ?? "true") == "true") { echo 'checked'; } ?>></div></td>
<td><div class="form-check"><input class="form-check-input" name="last_modification" type="checkbox" <?php if (($options->last_modification->show ?? "false") == "true") { echo 'checked'; } ?>></div></td>
</tr>
</tbody>
</table>