Index: typo3/backend.php =================================================================== --- typo3/backend.php (revision 6574) +++ typo3/backend.php (working copy) @@ -349,50 +349,42 @@ $this->loginSecurityLevel = 'superchallenged'; } - $this->js .= ' - Ext.BLANK_IMAGE_URL = "' . - // t3lib_div::locationHeaderUrl() will include '/typo3/' in the URL - htmlspecialchars(t3lib_div::locationHeaderUrl('gfx/clear.gif')) . - '"; - - - TYPO3.configuration = ' . json_encode(array( - 'siteUrl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL'), - 'PATH_typo3' => $pathTYPO3, - 'PATH_typo3_enc' => rawurlencode($pathTYPO3), - 'username' => htmlspecialchars($GLOBALS['BE_USER']->user['username']), - 'uniqueID' => t3lib_div::shortMD5(uniqid('')), - 'securityLevel' => $this->loginSecurityLevel, - 'TYPO3_mainDir' => TYPO3_mainDir, - 'pageModule' => $pageModule, - 'condensedMode' => $GLOBALS['BE_USER']->uc['condensedMode'] ? 1 : 0 , - 'workspaceFrontendPreviewEnabled' => $GLOBALS['BE_USER']->workspace != 0 && !$GLOBALS['BE_USER']->user['workspace_preview'] ? 0 : 1, - 'veriCode' => $GLOBALS['BE_USER']->veriCode(), - 'denyFileTypes' => PHP_EXTENSIONS_DEFAULT, - 'showRefreshLoginPopup' => isset($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) ? intval($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) : FALSE, - )) . '; - TYPO3.LLL = { - core : ' . json_encode(array( - 'waitTitle' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_logging_in') , - 'refresh_login_failed' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_failed'), - 'refresh_login_failed_message' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_failed_message'), - 'refresh_login_title' => sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_title'), htmlspecialchars($GLOBALS['BE_USER']->user['username'])), - 'login_expired' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.login_expired'), - 'refresh_login_username' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_username'), - 'refresh_login_password' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_password'), - 'refresh_login_emptyPassword' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_emptyPassword'), - 'refresh_login_button' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_button'), - 'refresh_logout_button' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_logout_button'), - 'please_wait' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.please_wait'), - 'be_locked' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.be_locked'), - 'refresh_login_countdown_singular' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_countdown_singular'), - 'refresh_login_countdown' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_countdown'), - 'login_about_to_expire' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.login_about_to_expire'), - 'login_about_to_expire_title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.login_about_to_expire_title'), - 'refresh_login_refresh_button' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_refresh_button'), - 'refresh_direct_logout_button' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_direct_logout_button'), - )) . ', - fileUpload: ' . json_encode(array( + $t3Configuration = array( + 'siteUrl' => t3lib_div::getIndpEnv('TYPO3_SITE_URL'), + 'PATH_typo3' => $pathTYPO3, + 'PATH_typo3_enc' => rawurlencode($pathTYPO3), + 'username' => htmlspecialchars($GLOBALS['BE_USER']->user['username']), + 'uniqueID' => t3lib_div::shortMD5(uniqid('')), + 'securityLevel' => $this->loginSecurityLevel, + 'TYPO3_mainDir' => TYPO3_mainDir, + 'pageModule' => $pageModule, + 'condensedMode' => $GLOBALS['BE_USER']->uc['condensedMode'] ? 1 : 0 , + 'workspaceFrontendPreviewEnabled' => $GLOBALS['BE_USER']->workspace != 0 && !$GLOBALS['BE_USER']->user['workspace_preview'] ? 0 : 1, + 'veriCode' => $GLOBALS['BE_USER']->veriCode(), + 'denyFileTypes' => PHP_EXTENSIONS_DEFAULT, + 'showRefreshLoginPopup' => isset($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) ? intval($GLOBALS['TYPO3_CONF_VARS']['BE']['showRefreshLoginPopup']) : FALSE, + ); + $t3LLLcore = array( + 'waitTitle' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_logging_in') , + 'refresh_login_failed' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_failed'), + 'refresh_login_failed_message' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_failed_message'), + 'refresh_login_title' => sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_title'), htmlspecialchars($GLOBALS['BE_USER']->user['username'])), + 'login_expired' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.login_expired'), + 'refresh_login_username' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_username'), + 'refresh_login_password' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_password'), + 'refresh_login_emptyPassword' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_emptyPassword'), + 'refresh_login_button' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_button'), + 'refresh_logout_button' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_logout_button'), + 'please_wait' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.please_wait'), + 'be_locked' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.be_locked'), + 'refresh_login_countdown_singular' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_countdown_singular'), + 'refresh_login_countdown' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_countdown'), + 'login_about_to_expire' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.login_about_to_expire'), + 'login_about_to_expire_title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.login_about_to_expire_title'), + 'refresh_login_refresh_button' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_login_refresh_button'), + 'refresh_direct_logout_button' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:mess.refresh_direct_logout_button'), + ); + $t3LLLfileUpload = array( 'windowTitle' => $GLOBALS['LANG']->getLL('fileUpload_windowTitle'), 'buttonSelectFiles' => $GLOBALS['LANG']->getLL('fileUpload_buttonSelectFiles'), 'buttonCancelAll' => $GLOBALS['LANG']->getLL('fileUpload_buttonCancelAll'), @@ -419,8 +411,22 @@ 'errorUploadFileValidation' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadFileValidation'), 'errorUploadFileCancelled' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadFileCancelled'), 'errorUploadStopped' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadStopped'), - )) . '}; + ); + // Convert labels/settings back to UTF-8 since json_encode() only works with UTF-8: + if ($GLOBALS['LANG']->charSet !== 'utf-8') { + $GLOBALS['LANG']->csConvObj->convArray($t3Configuration, $GLOBALS['LANG']->charSet, 'utf-8'); + $GLOBALS['LANG']->csConvObj->convArray($t3LLLcore, $GLOBALS['LANG']->charSet, 'utf-8'); + $GLOBALS['LANG']->csConvObj->convArray($t3LLLfileUpload, $GLOBALS['LANG']->charSet, 'utf-8'); + } + + $this->js .= ' + TYPO3.configuration = ' . json_encode($t3Configuration) . '; + TYPO3.LLL = { + core : ' . json_encode($t3LLLcore) . ', + fileUpload: ' . json_encode($t3LLLfileUpload) . ' + }; + /** * TypoSetup object. */