From 75f623c62fc1aa6ae47fae77ad3475efddcc0a91 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 7 Aug 2017 16:16:10 +0200 Subject: [PATCH] Make the Preferences item as selected when visiting Settings without _action --- program/steps/settings/func.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 9129cdbeb..c769a4a5f 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -1403,9 +1403,10 @@ function rcmail_settings_tabs($attrib) 'attrib' => $attrib, )); - $attrib = $plugin['attrib']; - $tagname = $attrib['tagname']; - $tabs = array(); + $selected = $RCMAIL->action ?: 'preferences'; + $attrib = $plugin['attrib']; + $tagname = $attrib['tagname']; + $tabs = array(); foreach ($plugin['actions'] as $action) { $task_action = $action['command'] ? $action['command'] : $action['action']; @@ -1434,7 +1435,7 @@ function rcmail_settings_tabs($attrib) else if (!empty($cmd)) { $classnames[] = $cmd; } - if ($RCMAIL->action == $cmd) { + if ($cmd == $selected) { $classnames[] = $attrib['selclass']; }