[TASK] Use JsConfirmation bit mask constants instead of raw integers 04/43504/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 23 Sep 2015 13:31:25 +0000 (15:31 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Wed, 23 Sep 2015 13:33:59 +0000 (15:33 +0200)
Resolves: #70047
Releases: master
Change-Id: Icf74209194f267490dfc71f0c3573540ef1cd7b5
Reviewed-on: http://review.typo3.org/43504
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/backend/Classes/Form/Container/SingleFieldContainer.php

index 0871f88..a683c08 100644 (file)
@@ -1099,7 +1099,7 @@ class ClickMenu {
         */
        public function FILE_delete($path) {
                $loc = 'top.content.list_frame';
-               if ($this->backendUser->jsConfirmation(4)) {
+               if ($this->backendUser->jsConfirmation(JsConfirmation::DELETE)) {
                        $conf = 'confirm(' . GeneralUtility::quoteJSvalue((sprintf($this->languageService->sL('LLL:EXT:lang/locallang_core.xlf:mess.delete'), basename($path)) . BackendUtility::referenceCount('_FILE', $path, ' (There are %s reference(s) to this file!)'))) . ')';
                } else {
                        $conf = '1==1';
index b31c7d0..eb08985 100644 (file)
@@ -16,6 +16,7 @@ namespace TYPO3\CMS\Backend\Form\Container;
 
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
+use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Backend\Form\Utility\FormEngineUtility;
@@ -117,7 +118,7 @@ class SingleFieldContainer extends AbstractContainer {
                        || !empty($this->data['processedTca']['ctrl']['requestUpdate'])
                        && GeneralUtility::inList(str_replace(' ', '', $this->data['processedTca']['ctrl']['requestUpdate']), $fieldName)
                ) {
-                       if ($backendUser->jsConfirmation(1)) {
+                       if ($backendUser->jsConfirmation(JsConfirmation::TYPE_CHANGE)) {
                                $alertMsgOnChange = 'if (confirm(TBE_EDITOR.labels.onChangeAlert) && TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
                        } else {
                                $alertMsgOnChange = 'if (TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';