From 7f7c9cc81bd8e761924e1bfac29394b28ea6fdff Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 24 Sep 2026 11:39:40 -0400 Subject: [PATCH] refactor: name the options tabs after what they hold The Display tab holds skin, css and navbar choices kept in a cookie for the session looking at the page. They are not stored configuration and do not affect anyone else, but the tab was named as though they were the system's display settings. The settings that genuinely are the system's display configuration -- the navbar, titles, thumbnails, event sorting, animations, alarm popups -- sit on a tab labelled Web, which says where they apply rather than what they do. So the labels swap to match: the cookie tab becomes This Session, and the Web tab becomes Display. A short note at the top of This Session says the settings are kept in a cookie rather than saved on the server, since a name alone will not carry that. The note goes inside the form rather than beside it, because #optionsContainer is a flex row and two siblings there split the width between them. Labels only. The category keys are untouched, so ?tab=display and ?tab=web keep working, no configuration entry moves, and no migration is needed. The one-off version/Versions case that was inline in the menu builder becomes a small map beside the other two, applied at both places that build the item list. Only en_gb gains the new strings. Language files are loaded with en_gb as the base and the chosen language layered over it, so the other 27 show the English until somebody translates them. Display and Web are already translated in 22 of them, and those translations stay correct: the word Display now labels the tab that actually holds display settings. Verified on a running install: the sidebar renders This Session for tab=display and Display for tab=web, the note spans the full width above the fields, all three tabs return 200 with their entry counts unchanged and no php diagnostics. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015Y6FieTwEXuLhhR4e2yiax --- web/lang/en_gb.php | 2 ++ web/skins/classic/includes/functions.php | 18 ++++++++++++++++-- web/skins/classic/views/options.php | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/web/lang/en_gb.php b/web/lang/en_gb.php index af4f6fd65..08c272bcf 100644 --- a/web/lang/en_gb.php +++ b/web/lang/en_gb.php @@ -776,6 +776,8 @@ $SLANG = array( 'TargetColorspace' => 'Target colorspace', 'Removed' => 'removed', 'DeprecatedColoursSetting' => 'Deprecated - will be auto-detected in a future release', + 'ThisSession' => 'This Session', + 'ThisSessionHint' => 'These settings apply to this browser session only. They are kept in a cookie rather than saved on the server, so they do not affect other sessions or other users.', 'TimeDelta' => 'Time Delta', 'TimelineTip1' => 'Pass your mouse over the graph to view a snapshot image and event details.', // Added 2013.08.15. 'TimelineTip2' => 'Click on the coloured sections of the graph, or the image, to view the event.', // Added 2013.08.15. diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index 4650e0813..34ab3977f 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -1918,6 +1918,20 @@ function xhtmlFooter() { class ZM_Menu { public static $submenuOptionsItems = []; + // A tab is not always named after its category key. 'display' holds + // per-browser state kept in a cookie rather than stored configuration, and + // 'web' holds the display settings that are stored, so labelling either one + // after its key tells the user the wrong thing. + private static $categoryLabels = [ + 'version' => 'Versions', + 'display' => 'ThisSession', + 'web' => 'Display', + ]; + + private static function categoryLabel($cat) { + return translate(isset(self::$categoryLabels[$cat]) ? self::$categoryLabels[$cat] : mb_ucfirst($cat)); + } + public function __construct(string $typeMenu, array $menuItems) { } @@ -1934,7 +1948,7 @@ class ZM_Menu { $added = true; } if ($added) { - self::$submenuOptionsItems[$cat] = translate(mb_ucfirst(($cat == 'version') ? 'Versions' : $cat)); + self::$submenuOptionsItems[$cat] = self::categoryLabel($cat); unset($categoriesOptionsInDB[$key]); } } @@ -1943,7 +1957,7 @@ class ZM_Menu { if (count($categoriesOptionsInDB)) { foreach ($categoriesOptionsInDB as $cat) { if (!in_array(strtolower($cat), ['dynamic', 'hidden'], $strict = false)) // Prohibited categories - self::$submenuOptionsItems[$cat] = translate(mb_ucfirst($cat)); + self::$submenuOptionsItems[$cat] = self::categoryLabel($cat); } } } diff --git a/web/skins/classic/views/options.php b/web/skins/classic/views/options.php index ea2cc5b7c..1914587bb 100644 --- a/web/skins/classic/views/options.php +++ b/web/skins/classic/views/options.php @@ -55,6 +55,9 @@ if ($tab == 'display') {
+ +