/** * renders the items in the top toolbar * * @return string top toolbar elements as HTML */ protected function renderToolbar() { // move search to last position if (array_key_exists('liveSearch', $this->toolbarItems)) { $search = $this->toolbarItems['liveSearch']; unset($this->toolbarItems['liveSearch']); $this->toolbarItems['liveSearch'] = $search; } $toolbar = '<ul id="typo3-toolbar">'; $toolbar .= '<li>' . $this->getLoggedInUserLabel() . '</li> <li><div id="logout-button" class="toolbar-item no-separator">' . $this->moduleMenu->renderLogoutButton() . '</div></li>'; foreach ($this->toolbarItems as $toolbarItem) { $menu = $toolbarItem->render(); if ($menu) { $additionalAttributes = $toolbarItem->getAdditionalAttributes(); $toolbar .= '<li' . $additionalAttributes . '>' . $menu . '</li>'; } } return $toolbar . '</ul>'; }
/** * Generates the JavaScript code for the backend. * * @return void */ protected function generateJavascript() { $pathTYPO3 = t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')) . '/'; $goToModuleSwitch = $this->moduleMenu->getGotoModuleJavascript(); $moduleFramesHelper = implode(LF, $this->moduleMenu->getFsMod()); // If another page module was specified, replace the default Page module with the new one $newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule')); $pageModule = t3lib_BEfunc::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout'; $menuFrameName = 'menu'; if ($GLOBALS['BE_USER']->uc['noMenuMode'] === 'icons') { $menuFrameName = 'topmenuFrame'; } // determine security level from conf vars and default to super challenged if ($GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel']) { $this->loginSecurityLevel = $GLOBALS['TYPO3_CONF_VARS']['BE']['loginSecurityLevel']; } else { $this->loginSecurityLevel = 'superchallenged'; } $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, 'inWorkspace' => $GLOBALS['BE_USER']->workspace !== 0 ? 1 : 0, 'workspaceFrontendPreviewEnabled' => $GLOBALS['BE_USER']->user['workspace_preview'] ? 1 : 0, 'veriCode' => $GLOBALS['BE_USER']->veriCode(), 'denyFileTypes' => PHP_EXTENSIONS_DEFAULT, 'moduleMenuWidth' => $this->menuWidth - 1, 'topBarHeight' => isset($GLOBALS['TBE_STYLES']['dims']['topFrameH']) ? intval($GLOBALS['TBE_STYLES']['dims']['topFrameH']) : 30, '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'), 'tabs_closeAll' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:tabs.closeAll'), 'tabs_closeOther' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:tabs.closeOther'), 'tabs_close' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:tabs.close'), 'donateWindow_title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:donateWindow.title'), 'donateWindow_message' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:donateWindow.message'), 'donateWindow_button_donate' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:donateWindow.button_donate'), 'donateWindow_button_disable' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:donateWindow.button_disable'), 'donateWindow_button_postpone' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:donateWindow.button_postpone')); $t3LLLfileUpload = array('windowTitle' => $GLOBALS['LANG']->getLL('fileUpload_windowTitle'), 'buttonSelectFiles' => $GLOBALS['LANG']->getLL('fileUpload_buttonSelectFiles'), 'buttonCancelAll' => $GLOBALS['LANG']->getLL('fileUpload_buttonCancelAll'), 'infoComponentMaxFileSize' => $GLOBALS['LANG']->getLL('fileUpload_infoComponentMaxFileSize'), 'infoComponentFileUploadLimit' => $GLOBALS['LANG']->getLL('fileUpload_infoComponentFileUploadLimit'), 'infoComponentFileTypeLimit' => $GLOBALS['LANG']->getLL('fileUpload_infoComponentFileTypeLimit'), 'infoComponentOverrideFiles' => $GLOBALS['LANG']->getLL('fileUpload_infoComponentOverrideFiles'), 'processRunning' => $GLOBALS['LANG']->getLL('fileUpload_processRunning'), 'uploadWait' => $GLOBALS['LANG']->getLL('fileUpload_uploadWait'), 'uploadStarting' => $GLOBALS['LANG']->getLL('fileUpload_uploadStarting'), 'uploadProgress' => $GLOBALS['LANG']->getLL('fileUpload_uploadProgress'), 'uploadSuccess' => $GLOBALS['LANG']->getLL('fileUpload_uploadSuccess'), 'errorQueueLimitExceeded' => $GLOBALS['LANG']->getLL('fileUpload_errorQueueLimitExceeded'), 'errorQueueFileSizeLimit' => $GLOBALS['LANG']->getLL('fileUpload_errorQueueFileSizeLimit'), 'errorQueueZeroByteFile' => $GLOBALS['LANG']->getLL('fileUpload_errorQueueZeroByteFile'), 'errorQueueInvalidFiletype' => $GLOBALS['LANG']->getLL('fileUpload_errorQueueInvalidFiletype'), 'errorUploadHttp' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadHttpError'), 'errorUploadMissingUrl' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadMissingUrl'), 'errorUploadIO' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadIO'), 'errorUploadSecurityError' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadSecurityError'), 'errorUploadLimit' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadLimit'), 'errorUploadFailed' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadFailed'), 'errorUploadFileIDNotFound' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadFileIDNotFound'), 'errorUploadFileValidation' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadFileValidation'), 'errorUploadFileCancelled' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadFileCancelled'), 'errorUploadStopped' => $GLOBALS['LANG']->getLL('fileUpload_errorUploadStopped'), 'allErrorMessageTitle' => $GLOBALS['LANG']->getLL('fileUpload_allErrorMessageTitle'), 'allErrorMessageText' => $GLOBALS['LANG']->getLL('fileUpload_allErrorMessageText'), 'allError401' => $GLOBALS['LANG']->getLL('fileUpload_allError401'), 'allError2038' => $GLOBALS['LANG']->getLL('fileUpload_allError2038')); // Convert labels/settings back to UTF-8 since json_encode() only works with UTF-8: if ($GLOBALS['LANG']->charSet !== 'utf-8') { $t3Configuration['username'] = $GLOBALS['LANG']->csConvObj->conv($t3Configuration['username'], $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. */ function typoSetup() { // this.PATH_typo3 = TYPO3.configuration.PATH_typo3; this.PATH_typo3_enc = TYPO3.configuration.PATH_typo3_enc; this.username = TYPO3.configuration.username; this.uniqueID = TYPO3.configuration.uniqueID; this.navFrameWidth = 0; this.securityLevel = TYPO3.configuration.securityLevel; this.veriCode = TYPO3.configuration.veriCode; this.denyFileTypes = TYPO3.configuration.denyFileTypes; } var TS = new typoSetup(); var currentModuleLoaded = ""; /** * Frameset Module object * * Used in main modules with a frameset for submodules to keep the ID between modules * Typically that is set by something like this in a Web>* sub module: * if (top.fsMod) top.fsMod.recentIds["web"] = "\'.intval($this->id).\'"; * if (top.fsMod) top.fsMod.recentIds["file"] = "...(file reference/string)..."; */ function fsModules() { // this.recentIds=new Array(); // used by frameset modules to track the most recent used id for list frame. this.navFrameHighlightedID=new Array(); // used by navigation frames to track which row id was highlighted last time this.currentMainLoaded=""; this.currentBank="0"; } var fsMod = new fsModules();' . $moduleFramesHelper . ';'; // add goToModule code $this->pageRenderer->addExtOnReadyCode(' top.goToModule = ' . $goToModuleSwitch . '; '); // Check editing of page: $this->handlePageEditing(); $this->setStartupModule(); }