From fd216d99ed76dcbaab837c6e9c447c859fa8d60b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Feb 2024 11:45:50 +0100 Subject: [PATCH] NEW Add ALT+s to save a website page in edit mode --- htdocs/website/index.php | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 25fe96f7efe..c4083ba3dfc 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3146,7 +3146,18 @@ if (!GETPOST('hide_websitemenu')) { if (in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesiteconfirm')) || in_array($mode, array('replacesite'))) { if ($action == 'editcss') { - print ''; + // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox + // accesskey is for Mac: CTRL + key for all browsers + $stringforfirstkey = $langs->trans("KeyboardShortcut"); + if ($conf->browser->name == 'chrome') { + $stringforfirstkey .= ' ALT +'; + } elseif ($conf->browser->name == 'firefox') { + $stringforfirstkey .= ' ALT + SHIFT +'; + } else { + $stringforfirstkey .= ' CTL +'; + } + + print ''; } if (preg_match('/^create/', $action) && $action != 'file_manager' && $action != 'replacesite' && $action != 'replacesiteconfirm') { print ''; @@ -3541,7 +3552,18 @@ if (!GETPOST('hide_websitemenu')) { } if (!in_array($mode, array('replacesite')) && !in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesiteconfirm', 'createsite', 'createcontainer', 'createfromclone', 'createpagefromclone', 'deletesite'))) { if ($action == 'editsource' || $action == 'editmeta') { - print ''; + // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox + // accesskey is for Mac: CTRL + key for all browsers + $stringforfirstkey = $langs->trans("KeyboardShortcut"); + if ($conf->browser->name == 'chrome') { + $stringforfirstkey .= ' ALT +'; + } elseif ($conf->browser->name == 'firefox') { + $stringforfirstkey .= ' ALT + SHIFT +'; + } else { + $stringforfirstkey .= ' CTL +'; + } + + print ''; } if (preg_match('/^create/', $action)) { print '';