/** * Initializes the controller before invoking an action method. * * @return void */ protected function initializeAction() { $this->pageRenderer->addInlineLanguageLabelFile('EXT:scheduler_timeline/Resources/Private/Language/locallang.xml'); $this->pageRenderer->addCssFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('scheduler_timeline') . 'Resources/Public/StyleSheet/timeline.css'); $this->pageRenderer->addCssFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('scheduler_timeline') . 'Resources/Public/StyleSheet/bars.css'); $this->pageRenderer->addJsLibrary('jquery', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('scheduler_timeline') . 'Resources/Public/JavaScript/jquery-1.6.2.min.js'); $this->pageRenderer->addJsLibrary('jquery_tooltip', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('scheduler_timeline') . 'Resources/Public/JavaScript/tooltip.js'); $this->pageRenderer->addJsLibrary('jquery_tooltip_dynamic', \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('scheduler_timeline') . 'Resources/Public/JavaScript/tooltip.dynamic.js'); $this->addJsFileToPageRenderer(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('scheduler_timeline') . 'Resources/Public/JavaScript/common.js'); }
/** * Initialize every action. */ public function initializeAction() { $this->pageRenderer->addInlineLanguageLabelFile('EXT:vidi/Resources/Private/Language/locallang.xlf'); // Configure property mapping to retrieve the file object. if ($this->arguments->hasArgument('columns')) { /** @var \Fab\Vidi\TypeConverter\CsvToArrayConverter $typeConverter */ $typeConverter = $this->objectManager->get('Fab\\Vidi\\TypeConverter\\CsvToArrayConverter'); $propertyMappingConfiguration = $this->arguments->getArgument('columns')->getPropertyMappingConfiguration(); $propertyMappingConfiguration->setTypeConverter($typeConverter); } }
/** * 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(); }
/** * Add the needed JavaScript files for all actions */ public function initializeAction() { $this->pageRenderer->addInlineLanguageLabelFile('EXT:extensionmanager/Resources/Private/Language/locallang.xlf'); if ($this->configurationUtility->getCurrentConfiguration('extensionmanager')['offlineMode']['value']) { $this->settings['offlineMode'] = true; } }
/** * Tests the addInlineLanguageLabelFile() method. * * @test */ public function areInlineLanguageLabelsSelectedAndStripped() { $this->fixture->setLanguage($GLOBALS['LANG']->lang); $this->fixture->addInlineLanguageLabelFile('EXT:lang/locallang_core.xml', 'labels.', 'lock'); $out = $this->fixture->render(); $this->assertContains('edRecord', $out); $this->assertContains('edRecord_content', $out); $this->assertContains('edRecordUser', $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'); }
/** * method that adds JS files within the page renderer * * @param array $parameters : An array of available parameters while adding JS to the page renderer * @param \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer : The parent object that triggered this hook * * @return void */ protected function addJS($parameters, &$pageRenderer) { $formprotection = FormProtectionFactory::get(); if (count($parameters['jsFiles'])) { if (method_exists($GLOBALS['SOBE']->doc, 'issueCommand')) { /** @var \TYPO3\CMS\Backend\Clipboard\Clipboard $clipObj */ $clipObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Clipboard\\Clipboard'); // Start clipboard $clipObj->initializeClipboard(); $clipBoardHasContent = FALSE; if (isset($clipObj->clipData['normal']['el']) && strpos(key($clipObj->clipData['normal']['el']), 'tt_content') !== FALSE) { $pasteURL = str_replace('&', '&', $clipObj->pasteUrl('tt_content', 'DD_PASTE_UID', 0)); if (isset($clipObj->clipData['normal']['mode'])) { $clipBoardHasContent = 'copy'; } else { $clipBoardHasContent = 'move'; } } $moveParams = '&cmd[tt_content][DD_DRAG_UID][move]=DD_DROP_UID'; $moveURL = str_replace('&', '&', htmlspecialchars($GLOBALS['SOBE']->doc->issueCommand($moveParams, 1))); $copyParams = '&cmd[tt_content][DD_DRAG_UID][copy]=DD_DROP_UID&DDcopy=1'; $copyURL = str_replace('&', '&', htmlspecialchars($GLOBALS['SOBE']->doc->issueCommand($copyParams, 1))); // add JavaScript library $pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . ExtensionManagementUtility::extRelPath('gridelements') . 'Resources/Public/Backend/JavaScript/dbNewContentElWizardFixDTM.js', $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = ''); // add JavaScript library $pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . ExtensionManagementUtility::extRelPath('gridelements') . 'Resources/Public/Backend/JavaScript/GridElementsDD.js', $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = ''); // add JavaScript library $pageRenderer->addJsFile($GLOBALS['BACK_PATH'] . ExtensionManagementUtility::extRelPath('gridelements') . 'Resources/Public/Backend/JavaScript/GridElementsListView.js', $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = ''); if (!$pageRenderer->getCharSet()) { $pageRenderer->setCharSet($GLOBALS['LANG']->charSet ? $GLOBALS['LANG']->charSet : 'utf-8'); } if (is_array($clipObj->clipData['normal']['el'])) { $arrCBKeys = array_keys($clipObj->clipData['normal']['el']); $intFirstCBEl = str_replace('tt_content|', '', $arrCBKeys[0]); } // pull locallang_db.xml to JS side - only the tx_gridelements_js-prefixed keys $pageRenderer->addInlineLanguageLabelFile('EXT:gridelements/Resources/Private/Language/locallang_db.xml', 'tx_gridelements_js'); $pRaddExtOnReadyCode = ' TYPO3.l10n = { localize: function(langKey){ return TYPO3.lang[langKey]; } } '; $allowedCTypesAndGridTypesClassesByColPos = array(); $layoutSetup = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getSelectedBackendLayout', intval(GeneralUtility::_GP('id')), $this); if (is_array($layoutSetup) && !empty($layoutSetup['__config']['backend_layout.']['rows.'])) { foreach ($layoutSetup['__config']['backend_layout.']['rows.'] as $rows) { foreach ($rows as $row) { if (!empty($layoutSetup['__config']['backend_layout.']['rows.'])) { foreach ($row as $col) { $classes = ''; if ($col['allowed']) { $allowed = explode(',', $col['allowed']); foreach ($allowed as $ctypes) { $ctypes = trim($ctypes); if ($ctypes === '*') { $classes = 't3-allow-all'; break; } else { $ctypes = explode(',', $ctypes); foreach ($ctypes as $ctype) { $classes .= 't3-allow-' . $ctype . ' '; } } } } else { $classes = 't3-allow-all'; } if ($col['allowedGridTypes']) { $allowedGridTypes = explode(',', $col['allowedGridTypes']); $classes .= 't3-allow-gridelements_pi1 '; foreach ($allowedGridTypes as $gridTypes) { $gridTypes = trim($gridTypes); if ($gridTypes !== '*') { $gridTypes = explode(',', $gridTypes); foreach ($gridTypes as $gridType) { $classes .= 't3-allow-gridtype-' . $gridType . ' '; } } } } else { if ($classes !== 't3-allow-all') { $classes .= 't3-allow-gridelements_pi1 '; } } $allowedCTypesAndGridTypesClassesByColPos[] = $col['colPos'] . ':' . trim($classes); } } } } } // add Ext.onReady() code from file $modTSconfig = BackendUtility::getModTSconfig((int) GeneralUtility::_GP('id'), 'mod.web_layout'); $pageRenderer->addExtOnReadyCode($pRaddExtOnReadyCode . "\n\t\t\t\t\t\ttop.pageColumnsAllowedCTypes = '" . join('|', $allowedCTypesAndGridTypesClassesByColPos) . "';\n\t\t\t\t\t\ttop.pasteURL = '" . $pasteURL . "';\n\t\t\t\t\t\ttop.moveURL = '" . $moveURL . "';\n\t\t\t\t\t\ttop.copyURL = '" . $copyURL . "';\n\t\t\t\t\t\ttop.pasteTpl = '" . str_replace('&redirect=1', '', str_replace('DDcopy=1', 'DDcopy=1&reference=DD_REFYN', $copyURL)) . "';\n\t\t\t\t\t\ttop.DDtceActionToken = '" . $formprotection->generateToken('tceAction') . "';\n\t\t\t\t\t\ttop.DDtoken = '" . $formprotection->generateToken('editRecord') . "';\n\t\t\t\t\t\ttop.DDpid = '" . (int) GeneralUtility::_GP('id') . "';\n\t\t\t\t\t\ttop.DDclipboardfilled = '" . ($clipBoardHasContent ? $clipBoardHasContent : 'false') . "';\n\t\t\t\t\t\ttop.pasteReferenceAllowed = '" . ($GLOBALS['BE_USER']->checkAuthMode('tt_content', 'CType', 11, 'explicitAllow') ? 'true' : 'false') . "';\n\t\t\t\t\t\ttop.newElementWizard = '" . ($modTSconfig['properties']['disableNewContentElementWizard'] ? 'false' : 'true') . "';\n\t\t\t\t\t\ttop.DDclipboardElId = '" . $intFirstCBEl . "';\n\t\t\t\t\t" . str_replace(array('top.skipDraggableDetails = 0;', 'insert_ext_baseurl_here', 'insert_server_time_here', 'top.geSprites = {};', "top.backPath = '';"), array($GLOBALS['BE_USER']->uc['dragAndDropHideNewElementWizardInfoOverlay'] ? 'top.skipDraggableDetails = true;' : 'top.skipDraggableDetails = false;', GeneralUtility::locationHeaderUrl('/' . ExtensionManagementUtility::siteRelPath('gridelements')), time() . '000', "top.geSprites = {\n\t\t\t\t\t\t\tcopyfrompage: '" . IconUtility::getSpriteIconClasses('extensions-gridelements-copyfrompage') . "',\n\t\t\t\t\t\t\t\tpastecopy: '" . IconUtility::getSpriteIconClasses('extensions-gridelements-pastecopy') . "',\n\t\t\t\t\t\t\t\tpasteref: '" . IconUtility::getSpriteIconClasses('extensions-gridelements-pasteref') . "'\n\t\t\t\t\t\t\t};", "top.backPath = '" . $GLOBALS['BACK_PATH'] . "';"), file_get_contents(ExtensionManagementUtility::extPath('gridelements') . 'Resources/Public/Backend/JavaScript/GridElementsDD_onReady.js')), TRUE); } } }
/** * wrapper function called by hook (\TYPO3\CMS\Core\Page\PageRenderer->render-preProcess) * * @param array $parameters : An array of available parameters * @param \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer : The parent object that triggered this hook * * @return void */ public function addJSCSS($parameters, &$pageRenderer) { if (get_class($GLOBALS['SOBE']) === 'TYPO3\\CMS\\Recordlist\\RecordList') { $pageRenderer->loadRequireJsModule('TYPO3/CMS/Gridelements/GridElementsOnReady'); return; } if (get_class($GLOBALS['SOBE']) === 'TYPO3\\CMS\\Backend\\Controller\\PageLayoutController') { $iconFactory = GeneralUtility::makeInstance(IconFactory::class); $pageRenderer->loadRequireJsModule('TYPO3/CMS/Gridelements/GridElementsOnReady'); $pageRenderer->loadRequireJsModule('TYPO3/CMS/Gridelements/GridElementsDragDrop'); $pageRenderer->loadRequireJsModule('TYPO3/CMS/Gridelements/GridElementsDragInWizard'); /** @var Clipboard $clipObj */ $clipObj = GeneralUtility::makeInstance(Clipboard::class); // Start clipboard $clipObj->initializeClipboard(); $clipObj->lockToNormal(); if (!$pageRenderer->getCharSet()) { $pageRenderer->setCharSet($GLOBALS['LANG']->charSet ? $GLOBALS['LANG']->charSet : 'utf-8'); } // pull locallang_db.xml to JS side - only the tx_gridelements_js-prefixed keys $pageRenderer->addInlineLanguageLabelFile('EXT:gridelements/Resources/Private/Language/locallang_db.xml', 'tx_gridelements_js'); $pAddExtOnReadyCode = ' TYPO3.l10n = { localize: function(langKey){ return TYPO3.lang[langKey]; } } '; $allowedContentTypesClassesByColPos = array(); $allowedGridTypesClassesByColPos = array(); $layoutSetup = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getSelectedBackendLayout', intval(GeneralUtility::_GP('id')), $this); if (is_array($layoutSetup) && !empty($layoutSetup['__config']['backend_layout.']['rows.'])) { foreach ($layoutSetup['__config']['backend_layout.']['rows.'] as $rows) { foreach ($rows as $row) { if (!empty($layoutSetup['__config']['backend_layout.']['rows.'])) { foreach ($row as $col) { $classes = ''; $gridClasses = ''; if ($col['allowed']) { $allowed = explode(',', $col['allowed']); foreach ($allowed as $contentTypes) { $contentTypes = trim($contentTypes); if ($contentTypes === '*') { $classes = 't3-allow-all'; break; } else { $contentTypes = explode(',', $contentTypes); foreach ($contentTypes as $contentType) { $classes .= 't3-allow-' . $contentType . ' '; } } } } else { $classes = 't3-allow-all'; } if ($col['allowedGridTypes']) { $allowedGridTypes = explode(',', $col['allowedGridTypes']); $classes .= 't3-allow-gridelements_pi1 '; foreach ($allowedGridTypes as $gridTypes) { $gridTypes = trim($gridTypes); if ($gridTypes !== '*') { $gridTypes = explode(',', $gridTypes); foreach ($gridTypes as $gridType) { $gridClasses .= 't3-allow-gridtype t3-allow-gridtype-' . $gridType . ' '; } } } if ($classes !== 't3-allow-all') { $classes .= 't3-allow-gridelements_pi1 '; } } $allowedContentTypesClassesByColPos[$col['colPos']] .= ' ' . trim($classes); $allowedGridTypesClassesByColPos[$col['colPos']] .= ' ' . trim($gridClasses); } } } } } // add Ext.onReady() code from file $pAddExtOnReadyCode .= "\n top.pageColumnsAllowedCTypes = " . json_encode($allowedContentTypesClassesByColPos) . ";\n top.pageColumnsAllowedGridTypes = " . json_encode($allowedGridTypesClassesByColPos) . ";\n top.pasteReferenceAllowed = " . ($this->getBackendUser()->checkAuthMode('tt_content', 'CType', 'shortcut', 'explicitAllow') ? 'true' : 'false') . ";\n top.skipDraggableDetails = " . ($this->getBackendUser()->uc['dragAndDropHideNewElementWizardInfoOverlay'] ? 'true' : 'false') . ";\n top.backPath = '" . $GLOBALS['BACK_PATH'] . "';\n top.browserUrl = '" . BackendUtility::getModuleUrl('wizard_element_browser') . "'"; $elFromTable = $clipObj->elFromTable('tt_content'); if (!empty($elFromTable)) { $pasteItem = substr(key($elFromTable), 11); $pasteRecord = BackendUtility::getRecord('tt_content', (int) $pasteItem); $pasteTitle = $pasteRecord['header'] ? $pasteRecord['header'] : $pasteItem; $copyMode = $clipObj->clipData['normal']['mode'] ? '-' . $clipObj->clipData['normal']['mode'] : ''; $pAddExtOnReadyCode .= "\n top.pasteIntoLinkTemplate = " . json_encode('<a data-pasteitem="' . $pasteItem . '" data-pastetitle="' . $pasteTitle . '" class="t3js-paste t3js-paste' . $copyMode . ' t3js-paste-into btn btn-default" title="' . $this->getLanguageService()->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:tx_gridelements_js.pasteinto') . '">' . $iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL)->render() . '</a>') . ";\n top.pasteAfterLinkTemplate = " . json_encode('<a data-pasteitem="' . $pasteItem . '" data-pastetitle="' . $pasteTitle . '" class="t3js-paste t3js-paste' . $copyMode . ' t3js-paste-after btn btn-default" title="' . $this->getLanguageService()->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:tx_gridelements_js.pasteafter') . '">' . $iconFactory->getIcon('actions-document-paste-into', Icon::SIZE_SMALL)->render() . '</a>') . ";"; if ($this->getBackendUser()->checkAuthMode('tt_content', 'CType', 'shortcut', 'explicitAllow')) { $pAddExtOnReadyCode .= "\n top.pasteReferencesAllowed = true;"; } } else { $pAddExtOnReadyCode .= "\n top.pasteIntoLinkTemplate = '';\n top.pasteAfterLinkTemplate = '';"; } $pAddExtOnReadyCode .= "\n top.copyFromAnotherPageLinkTemplate = " . json_encode('<a class="t3js-paste-new btn btn-default" title="' . $this->getLanguageService()->sL('LLL:EXT:gridelements/Resources/Private/Language/locallang_db.xml:tx_gridelements_js.copyfrompage') . '">' . $iconFactory->getIcon('actions-insert-reference', Icon::SIZE_SMALL)->render() . '</a>') . ";"; $pageRenderer->addJsInlineCode('gridelementsExtOnReady', $pAddExtOnReadyCode); } }
/** * Add the needed JavaScript files for all actions */ public function initializeAction() { $this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/notifications.js'); $this->pageRenderer->addInlineLanguageLabelFile('EXT:extensionmanager/Resources/Private/Language/locallang.xlf'); }
/** * Add the needed JavaScript files for all actions */ public function initializeAction() { $this->pageRenderer->addInlineLanguageLabelFile('EXT:extensionmanager/Resources/Private/Language/locallang.xlf'); }
/** * Main method of modfuncreport * * @return string Module content */ public function main() { $GLOBALS['LANG']->includeLLFile('EXT:linkvalidator/Resources/Private/Language/Module/locallang.xlf'); $this->searchLevel = GeneralUtility::_GP('search_levels'); if (isset($this->pObj->id)) { $this->modTS = BackendUtility::getModTSconfig($this->pObj->id, 'mod.linkvalidator'); $this->modTS = $this->modTS['properties']; } $update = GeneralUtility::_GP('updateLinkList'); $prefix = ''; if (!empty($update)) { $prefix = 'check'; } $set = GeneralUtility::_GP($prefix . 'SET'); $this->pObj->handleExternalFunctionValue(); if (isset($this->searchLevel)) { $this->pObj->MOD_SETTINGS['searchlevel'] = $this->searchLevel; } else { $this->searchLevel = $this->pObj->MOD_SETTINGS['searchlevel']; } if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['linkvalidator']['checkLinks'] as $linkType => $value) { // Compile list of all available types. Used for checking with button "Check Links". if (strpos($this->modTS['linktypes'], $linkType) !== FALSE) { $this->availableOptions[$linkType] = 1; } // Compile list of types currently selected by the checkboxes if ($this->pObj->MOD_SETTINGS[$linkType] && empty($set) || $set[$linkType]) { $this->checkOpt[$linkType] = 1; $this->pObj->MOD_SETTINGS[$linkType] = 1; } else { $this->pObj->MOD_SETTINGS[$linkType] = 0; unset($this->checkOpt[$linkType]); } } } $GLOBALS['BE_USER']->pushModuleData('web_info', $this->pObj->MOD_SETTINGS); $this->initialize(); // Localization $this->pageRenderer->addInlineLanguageLabelFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('linkvalidator', 'Resources/Private/Language/Module/locallang.xlf')); $this->pageRenderer->addJsInlineCode('linkvalidator', 'function toggleActionButton(prefix) { var buttonDisable = true; Ext.select(\'.\' + prefix ,false).each(function(checkBox,i){ checkDom = checkBox.dom; if (checkDom.checked){ buttonDisable = false; } }); if (prefix == \'check\'){ checkSub = document.getElementById(\'updateLinkList\'); } else { checkSub = document.getElementById(\'refreshLinkList\'); } checkSub.disabled = buttonDisable; }'); // Add JS $this->pageRenderer->addJsFile($this->doc->backPath . 'js/extjs/ux/Ext.ux.FitToParent.js'); $this->pageRenderer->addJsFile($this->doc->backPath . 'sysext/backend/Resources/Public/JavaScript/flashmessages.js'); $this->pageRenderer->addJsFile($this->doc->backPath . 'sysext/backend/Resources/Public/JavaScript/iframepanel.js'); if ($this->modTS['showCheckLinkTab'] == 1) { $this->updateListHtml = '<input type="submit" name="updateLinkList" id="updateLinkList" value="' . $GLOBALS['LANG']->getLL('label_update') . '"/>'; } $this->refreshListHtml = '<input type="submit" name="refreshLinkList" id="refreshLinkList" value="' . $GLOBALS['LANG']->getLL('label_refresh') . '"/>'; $this->processor = GeneralUtility::makeInstance('TYPO3\\CMS\\Linkvalidator\\LinkAnalyzer'); $this->updateBrokenLinks(); $brokenLinkOverView = $this->processor->getLinkCounts($this->pObj->id); $this->checkOptHtml = $this->getCheckOptions($brokenLinkOverView); $this->checkOptHtmlCheck = $this->getCheckOptions($brokenLinkOverView, 'check'); $this->createTabs(); return '<div id="linkvalidator-modfuncreport"></div>'; }
/** * Add the needed JavaScript files for all actions */ public function initializeAction() { $this->pageRenderer->addJsFile('../t3lib/js/extjs/notifications.js'); $this->pageRenderer->addInlineLanguageLabelFile('EXT:extensionmanager/Resources/Private/Language/locallang.xlf'); }