[TASK] Optimize button in LoginRefresh 00/41300/5
authorFrank Nägler <typo3@naegler.net>
Wed, 15 Jul 2015 12:56:21 +0000 (14:56 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 16 Jul 2015 13:50:43 +0000 (15:50 +0200)
Switch order of buttons and logic in LoginRefresh Dialog.

Resolves: #68168
Releases: master
Change-Id: Ie097f647d42a5bfdb2b596f164f9e1fa98d02560
Reviewed-on: http://review.typo3.org/41300
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Resources/Public/JavaScript/LoginRefresh.js
typo3/sysext/lang/locallang_core.xlf

index 6a5b5a3..5c66fe3 100644 (file)
@@ -464,10 +464,11 @@ class BackendController {
                        'be_locked' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.be_locked'),
                        'refresh_login_countdown_singular' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_countdown_singular'),
                        '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_about_to_expire'),
+                       '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_refresh_button' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_login_refresh_button'),
-                       'refresh_direct_logout_button' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:mess.refresh_direct_logout_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'),
                        'tabs_close' => $lang->sL('LLL:EXT:lang/locallang_core.xlf:tabs.close'),
index bf7f8da..36a27db 100644 (file)
@@ -88,6 +88,7 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
         */
        LoginRefresh.initializeTimeoutModal = function() {
                LoginRefresh.$timeoutModal = LoginRefresh.generateModal(LoginRefresh.identifier.loginrefresh);
+               LoginRefresh.$timeoutModal.addClass('t3-modal-notice');
                LoginRefresh.$timeoutModal.find('.modal-header h4').text(TYPO3.LLL.core.login_about_to_expire_title);
                LoginRefresh.$timeoutModal.find('.modal-body').append(
                        $('<p />').text(TYPO3.LLL.core.login_about_to_expire),
@@ -103,7 +104,7 @@ 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_refresh_button).on('click', function() {
+                       $('<button />', {class: 'btn btn-default', 'data-action': 'refreshSession'}).text(TYPO3.LLL.core.refresh_login_abort_button).on('click', function() {
                                $.ajax({
                                        url: TYPO3.settings.ajaxUrls['BackendLogin::isTimedOut'],
                                        method: 'GET',
@@ -112,11 +113,10 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
                                        }
                                });
                        }),
-                       $('<button />', {class: 'btn btn-default', 'data-action': 'logout'}).text(TYPO3.LLL.core.refresh_direct_logout_button).on('click', function() {
+                       $('<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);
 
                $('body').append(LoginRefresh.$timeoutModal);
@@ -192,6 +192,7 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
                }
 
                LoginRefresh.$loginForm = LoginRefresh.generateModal(LoginRefresh.identifier.loginFormModal);
+               LoginRefresh.$loginForm.addClass('t3-modal-notice');
                LoginRefresh.$loginForm.find('.modal-header h4').text(TYPO3.LLL.core.refresh_login_title);
                LoginRefresh.$loginForm.find('.modal-body').append(
                        $('<p />').text(TYPO3.LLL.core.login_expired),
@@ -204,10 +205,7 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
                        )
                );
                LoginRefresh.$loginForm.find('.modal-footer').append(
-                       $('<button />', {type: 'submit', form: 'beLoginRefresh', class: 'btn btn-default', 'data-action': 'refreshSession'}).text(TYPO3.LLL.core.refresh_login_button),
-                       $('<button />', {class: 'btn btn-default', 'data-action': 'logout'}).text(TYPO3.LLL.core.refresh_direct_logout_button).on('click', function() {
-                               top.location.href = TYPO3.configuration.siteUrl + LoginRefresh.logoutUrl;
-                       })
+                       $('<button />', {type: 'submit', form: 'beLoginRefresh', class: 'btn btn-primary', 'data-action': 'refreshSession'}).text(TYPO3.LLL.core.refresh_login_button)
                );
 
                LoginRefresh.registerDefaultModalEvents(LoginRefresh.$loginForm).on('submit', LoginRefresh.submitForm);
@@ -353,6 +351,8 @@ define('TYPO3/CMS/Backend/LoginRefresh', ['jquery', 'bootstrap'], function($) {
                        LoginRefresh.startTask();
                }).on('shown.bs.modal', function() {
                        LoginRefresh.stopTask();
+                       // focus the button which was configured as active button
+                       LoginRefresh.$timeoutModal.find('.modal-footer .t3js-active').first().focus();
                });
 
                return $modal;
index 3b56df8..de55aea 100644 (file)
@@ -638,6 +638,15 @@ 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">
+                               <source>Log me out</source>
+                       </trans-unit>
+                       <trans-unit id="mess.login_refresh_about_to_expire">
+                               <source>Your TYPO3 login is about to expire. Please confirm that you want to be logged out.</source>
+                       </trans-unit>
                        <trans-unit id="mess.login_about_to_expire_title">
                                <source>TYPO3 login expiration notice</source>
                        </trans-unit>