From 6950ba0b90b19151432bb9154073e587e695775e Mon Sep 17 00:00:00 2001
From: Mathias Brodala <mbrodala@pagemachine.de>
Date: Mon, 14 Sep 2015 11:13:58 +0200
Subject: [PATCH] [TASK] Improve session timeout dialog

This renames the "Abort" action to "Stay logged in" and makes it
the default in the session timeout dialog. Thus one can simply
press the Space/Return key to stay logged in which is the most
likely action in this situation.

This drops the translation label "mess.refresh_login_abort_button"
from locallang_core.xlf which is now unused. Also the label
"mess.refresh_login_confirm_button" is changed to
"mess.refresh_login_logout_button".

Resolves: #69774
Releases: master
Change-Id: I71b797fb61750a293718e144bc76e28199874c38
Reviewed-on: http://review.typo3.org/43288
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../backend/Classes/Controller/BackendController.php      | 3 +--
 .../backend/Resources/Public/JavaScript/LoginRefresh.js   | 8 ++++----
 typo3/sysext/lang/locallang_core.xlf                      | 5 +----
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/typo3/sysext/backend/Classes/Controller/BackendController.php b/typo3/sysext/backend/Classes/Controller/BackendController.php
index 53b17edc6e71..2a788294930e 100644
--- a/typo3/sysext/backend/Classes/Controller/BackendController.php
+++ b/typo3/sysext/backend/Classes/Controller/BackendController.php
@@ -490,8 +490,7 @@ class BackendController implements \TYPO3\CMS\Core\Http\ControllerInterface {
 			'refresh_login_countdown' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_countdown'),
 			'login_about_to_expire' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.login_refresh_about_to_expire'),
 			'login_about_to_expire_title' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.login_about_to_expire_title'),
-			'refresh_login_abort_button' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_abort_button'),
-			'refresh_login_confirm_button' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_confirm_button'),
+			'refresh_login_logout_button' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_logout_button'),
 			'refresh_login_refresh_button' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_refresh_button'),
 			'tabs_closeAll' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:tabs.closeAll'),
 			'tabs_closeOther' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:tabs.closeOther'),
diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/LoginRefresh.js b/typo3/sysext/backend/Resources/Public/JavaScript/LoginRefresh.js
index 36a27dbf55ff..0712f3f87162 100644
--- a/typo3/sysext/backend/Resources/Public/JavaScript/LoginRefresh.js
+++ b/typo3/sysext/backend/Resources/Public/JavaScript/LoginRefresh.js
@@ -104,7 +104,10 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
 			)
 		);
 		LoginRefresh.$timeoutModal.find('.modal-footer').append(
-			$('<button />', {class: 'btn btn-default', 'data-action': 'refreshSession'}).text(TYPO3.LLL.core.refresh_login_abort_button).on('click', function() {
+			$('<button />', {class: 'btn btn-default', 'data-action': 'logout'}).text(TYPO3.LLL.core.refresh_login_logout_button).on('click', function() {
+				top.location.href = TYPO3.configuration.siteUrl + LoginRefresh.logoutUrl;
+			}),
+			$('<button />', {class: 'btn btn-primary t3js-active', 'data-action': 'refreshSession'}).text(TYPO3.LLL.core.refresh_login_refresh_button).on('click', function() {
 				$.ajax({
 					url: TYPO3.settings.ajaxUrls['BackendLogin::isTimedOut'],
 					method: 'GET',
@@ -112,9 +115,6 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
 						LoginRefresh.hideTimeoutModal();
 					}
 				});
-			}),
-			$('<button />', {class: 'btn btn-primary t3js-active', 'data-action': 'logout'}).text(TYPO3.LLL.core.refresh_login_confirm_button).on('click', function() {
-				top.location.href = TYPO3.configuration.siteUrl + LoginRefresh.logoutUrl;
 			})
 		);
 		LoginRefresh.registerDefaultModalEvents(LoginRefresh.$timeoutModal);
diff --git a/typo3/sysext/lang/locallang_core.xlf b/typo3/sysext/lang/locallang_core.xlf
index d24eccb3298c..cb6efd7b5887 100644
--- a/typo3/sysext/lang/locallang_core.xlf
+++ b/typo3/sysext/lang/locallang_core.xlf
@@ -686,10 +686,7 @@ Do you want to refresh it now?</source>
 			<trans-unit id="mess.login_about_to_expire">
 				<source>Your TYPO3 login is about to expire. Please confirm that you want to stay logged in.</source>
 			</trans-unit>
-			<trans-unit id="mess.refresh_login_abort_button">
-				<source>Abort</source>
-			</trans-unit>
-			<trans-unit id="mess.refresh_login_confirm_button">
+			<trans-unit id="mess.refresh_login_logout_button">
 				<source>Log me out</source>
 			</trans-unit>
 			<trans-unit id="mess.login_refresh_about_to_expire">
-- 
GitLab