/** * Initializes the controller before invoking an action method. * * @return void */ protected function initializeAction() { // @todo Evaluate how the intval() call can be used with Extbase validators/filters $this->pageId = (int) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id'); $icons = array('language' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('flags-multiple'), 'integrity' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-information'), 'success' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-ok'), 'info' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-information'), 'warning' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-warning'), 'error' => \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses('status-dialog-error')); $this->pageRenderer->addInlineSetting('Workspaces', 'icons', $icons); $this->pageRenderer->addInlineSetting('Workspaces', 'id', $this->pageId); $this->pageRenderer->addInlineSetting('Workspaces', 'depth', $this->pageId === 0 ? 999 : 1); $this->pageRenderer->addInlineSetting('Workspaces', 'language', $this->getLanguageSelection()); $this->pageRenderer->addCssFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/StyleSheet/module.css'); $this->pageRenderer->addInlineLanguageLabelArray(array('title' => $GLOBALS['LANG']->getLL('title'), 'path' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.path'), 'table' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.table'), 'depth' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_perm.xlf:Depth'), 'depth_0' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_0'), 'depth_1' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_1'), 'depth_2' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_2'), 'depth_3' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_3'), 'depth_4' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_4'), 'depth_infi' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_infi'))); $this->pageRenderer->addInlineLanguageLabelFile('EXT:workspaces/Resources/Private/Language/locallang.xlf'); $this->assignExtensionSettings(); }
/** * Initializes the controller before invoking an action method. * * @return void */ protected function initializeAction() { $this->pageRenderer = $this->getPageRenderer(); // @todo Evaluate how the intval() call can be used with Extbase validators/filters $this->pageId = (int) GeneralUtility::_GP('id'); $iconFactory = GeneralUtility::makeInstance(IconFactory::class); $lang = $this->getLanguageService(); $icons = ['language' => $iconFactory->getIcon('flags-multiple', Icon::SIZE_SMALL)->render(), 'integrity' => $iconFactory->getIcon('status-dialog-information', Icon::SIZE_SMALL)->render(), 'success' => $iconFactory->getIcon('status-dialog-ok', Icon::SIZE_SMALL)->render(), 'info' => $iconFactory->getIcon('status-dialog-information', Icon::SIZE_SMALL)->render(), 'warning' => $iconFactory->getIcon('status-dialog-warning', Icon::SIZE_SMALL)->render(), 'error' => $iconFactory->getIcon('status-dialog-error', Icon::SIZE_SMALL)->render()]; $this->pageRenderer->addInlineSetting('Workspaces', 'icons', $icons); $this->pageRenderer->addInlineSetting('Workspaces', 'id', $this->pageId); $this->pageRenderer->addInlineSetting('Workspaces', 'depth', $this->pageId === 0 ? 999 : 1); $this->pageRenderer->addInlineSetting('Workspaces', 'language', $this->getLanguageSelection()); $this->pageRenderer->addInlineLanguageLabelArray(['title' => $lang->getLL('title'), 'path' => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.path'), 'table' => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.table'), 'depth' => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_mod_web_perm.xlf:Depth'), 'depth_0' => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_0'), 'depth_1' => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_1'), 'depth_2' => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_2'), 'depth_3' => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_3'), 'depth_4' => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_4'), 'depth_infi' => $lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.depth_infi')]); $this->pageRenderer->addInlineLanguageLabelFile('EXT:workspaces/Resources/Private/Language/locallang.xlf'); $this->assignExtensionSettings(); }
/** * Reads locallang file into array (for possible include in header) * * @return void */ protected function loadLocalization() { $wizardLabels = $GLOBALS['LANG']->includeLLFile('EXT:form/Resources/Private/Language/locallang_wizard.xlf', FALSE, TRUE); $controllerLabels = $GLOBALS['LANG']->includeLLFile('EXT:form/Resources/Private/Language/locallang_controller.xlf', FALSE, TRUE); \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($controllerLabels, $wizardLabels); $this->pageRenderer->addInlineLanguageLabelArray($controllerLabels['default']); }
/** * test inline language label as array get merged */ public function testAddInlineLanguageLabelArrayMerged() { $expectedReturnValue = 'TYPO3.lang = {"myKey1":"myValue1","myKey2":"myValue2"}'; $this->fixture->loadExtJS(); $this->fixture->addInlineLanguageLabelArray(array('myKey1' => 'myValue1')); $this->fixture->addInlineLanguageLabelArray(array('myKey2' => 'myValue2')); $this->fixture->enableMoveJsFromHeaderToFooter(); $out = $this->fixture->render(\TYPO3\CMS\Core\Page\PageRenderer::PART_FOOTER); $this->assertContains($expectedReturnValue, $out); }
/** * Initializes the controller before invoking an action method. * * @return void */ protected function initializeAction() { $this->pageId = (int) GeneralUtility::_GP('id'); $this->pageRenderer->addInlineLanguageLabelArray(array('title' => $this->languageService->getLL('title'), 'path' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.path'), 'table' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.table'), 'depth' => $this->languageService->sL('LLL:EXT:lang/locallang_mod_web_perm.xml:Depth'), 'depth_0' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_0'), 'depth_1' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_1'), 'depth_2' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_2'), 'depth_3' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_3'), 'depth_4' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_4'), 'depth_infi' => $this->languageService->sL('LLL:EXT:lang/locallang_core.xml:labels.depth_infi'))); $this->pageRenderer->addInlineLanguageLabelFile('EXT:typo3_forum/Resources/Private/Language/locallang_mod.xml'); $this->pageRenderer->loadExtJS(); $this->pageRenderer->enableExtJSQuickTips(); $this->pageRenderer->addJsFile(ExtensionManagementUtility::extRelPath('lang') . 'res/js/be/typo3lang.js'); $this->pageRenderer->addJsFile($this->backPath . 'js/extjs/ux/Ext.ux.FitToParent.js'); $this->includeJavascriptFromPath('Resources/Public/Javascript/Backend/ExtJS/'); $this->includeJavascriptFromPath('Resources/Public/Javascript/Backend/ForumIndex/'); $this->includeCssFromPath('Resources/Public/Javascript/Backend/ExtJS/'); $this->pageRenderer->addCssFile(ExtensionManagementUtility::extRelPath('typo3_forum') . 'Resources/Public/Stylesheets/typo3_forum-backend.css'); }
/** * Loads data in the HTML head section (e.g. JavaScript or stylesheet information). * * @return void */ protected function loadHeaderData() { // Load CSS Stylesheets: $this->pageRenderer->addCssFile($this->relativePath . 'res/css/customExtJs.css'); // Load Ext JS: $this->pageRenderer->loadExtJS(); $this->pageRenderer->enableExtJSQuickTips(); // Integrate dynamic JavaScript such as configuration or lables: $this->pageRenderer->addInlineSettingArray('Recycler', $this->getJavaScriptConfiguration()); $this->pageRenderer->addInlineLanguageLabelArray($this->getJavaScriptLabels()); // Load Recycler JavaScript: // Load Plugins $uxPath = $this->doc->backpath . 'js/extjs/ux/'; $this->pageRenderer->addJsFile($uxPath . 'Ext.grid.RowExpander.js'); $this->pageRenderer->addJsFile($uxPath . 'Ext.app.SearchField.js'); $this->pageRenderer->addJsFile($uxPath . 'Ext.ux.FitToParent.js'); // Load main script $this->pageRenderer->addJsFile($this->relativePath . 'res/js/t3_recycler.js'); }