/** * Constructor */ public function __construct() { $this->getLanguageService()->includeLLFile('EXT:lowlevel/Resources/Private/Language/locallang.xlf'); $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class); $this->view = GeneralUtility::makeInstance(StandaloneView::class); $this->view->getRequest()->setControllerExtensionName('lowlevel'); }
public function __construct() { $this->view = GeneralUtility::makeInstance(StandaloneView::class); $this->view->getRequest()->setControllerExtensionName('lowlevel'); $this->pageId = (int) GeneralUtility::_GET('id'); $this->urlService = new UrlService(); $this->pageSpeedRepository = new PageSpeedRepository(); $this->configuration = new Configuration(); $this->addScripts(); }
/** * Initialize the handler * * @param AbstractLinkBrowserController $linkBrowser * @param string $identifier * @param array $configuration Page TSconfig * * @return void */ public function initialize(AbstractLinkBrowserController $linkBrowser, $identifier, array $configuration) { $this->linkBrowser = $linkBrowser; $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class); $this->view = GeneralUtility::makeInstance(\TYPO3\CMS\Fluid\View\StandaloneView::class); $this->view->getRequest()->setControllerExtensionName('recordlist'); $this->view->setTemplateRootPaths([GeneralUtility::getFileAbsFileName('EXT:recordlist/Resources/Private/Templates/LinkBrowser')]); $this->view->setPartialRootPaths([GeneralUtility::getFileAbsFileName('EXT:recordlist/Resources/Private/Partials/LinkBrowser')]); $this->view->setLayoutRootPaths([GeneralUtility::getFileAbsFileName('EXT:recordlist/Resources/Private/Layouts/LinkBrowser')]); }
/** * Constructor */ public function __construct() { $this->view = GeneralUtility::makeInstance(StandaloneView::class); $this->view->getRequest()->setControllerExtensionName('lowlevel'); // Prepare blinding for all database connection types foreach (array_keys($GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']) as $connectionName) { if ($connectionName !== 'Default') { $this->blindedConfigurationOptions['TYPO3_CONF_VARS']['DB']['Connections'][$connectionName] = $this->blindedConfigurationOptions['TYPO3_CONF_VARS']['DB']['Connections']['Default']; } } }
/** * Set some extbase variables if given * * @param array $conf Configuration array * @return void */ protected function setExtbaseVariables(array $conf) { /** @var $request \TYPO3\CMS\Extbase\Mvc\Request */ $requestPluginName = isset($conf['extbase.']['pluginName.']) ? $this->cObj->stdWrap($conf['extbase.']['pluginName'], $conf['extbase.']['pluginName.']) : $conf['extbase.']['pluginName']; if ($requestPluginName) { $this->view->getRequest()->setPluginName($requestPluginName); } $requestControllerExtensionName = isset($conf['extbase.']['controllerExtensionName.']) ? $this->cObj->stdWrap($conf['extbase.']['controllerExtensionName'], $conf['extbase.']['controllerExtensionName.']) : $conf['extbase.']['controllerExtensionName']; if ($requestControllerExtensionName) { $this->view->getRequest()->setControllerExtensionName($requestControllerExtensionName); } $requestControllerName = isset($conf['extbase.']['controllerName.']) ? $this->cObj->stdWrap($conf['extbase.']['controllerName'], $conf['extbase.']['controllerName.']) : $conf['extbase.']['controllerName']; if ($requestControllerName) { $this->view->getRequest()->setControllerName($requestControllerName); } $requestControllerActionName = isset($conf['extbase.']['controllerActionName.']) ? $this->cObj->stdWrap($conf['extbase.']['controllerActionName'], $conf['extbase.']['controllerActionName.']) : $conf['extbase.']['controllerActionName']; if ($requestControllerActionName) { $this->view->getRequest()->setControllerActionName($requestControllerActionName); } if ($requestPluginName && $requestControllerExtensionName && $requestControllerName && $requestControllerActionName) { $configurationManager = GeneralUtility::makeInstance(ObjectManager::class)->get(ConfigurationManager::class); $configurationManager->setConfiguration(['extensionName' => $requestControllerExtensionName, 'pluginName' => $requestPluginName]); if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$requestControllerExtensionName]['plugins'][$requestPluginName]['controllers'])) { $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions'][$requestControllerExtensionName]['plugins'][$requestPluginName]['controllers'] = [$requestControllerName => ['actions' => [$requestControllerActionName]]]; } $requestBuilder = GeneralUtility::makeInstance(ObjectManager::class)->get(RequestBuilder::class); $this->view->getRenderingContext()->getControllerContext()->setRequest($requestBuilder->build()); } }
/** * Render drop down * * @return string Drop down HTML */ public function getDropDown() { if (!$this->checkAccess()) { return ''; } $request = $this->standaloneView->getRequest(); $request->setControllerExtensionName('backend'); $this->standaloneView->assignMultiple(array('installToolUrl' => BackendUtility::getModuleUrl('system_extinstall'), 'messages' => $this->systemMessages, 'count' => $this->totalCount > $this->maximumCountInBadge ? $this->maximumCountInBadge . '+' : $this->totalCount, 'severityBadgeClass' => $this->severityBadgeClass, 'systemInformation' => $this->systemInformation)); return $this->standaloneView->render(); }
/** * @return \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController */ public function __construct() { $this->getLanguageService()->includeLLFile('EXT:scheduler/Resources/Private/Language/locallang.xlf'); $this->MCONF = array('name' => $this->moduleName); $this->backPath = $GLOBALS['BACK_PATH']; $this->cshKey = '_MOD_' . $this->moduleName; $this->backendTemplatePath = ExtensionManagementUtility::extPath('scheduler') . 'Resources/Private/Templates/Backend/SchedulerModule/'; $this->view = GeneralUtility::makeInstance(\TYPO3\CMS\Fluid\View\StandaloneView::class); $this->view->getRequest()->setControllerExtensionName('scheduler'); $this->moduleUri = BackendUtility::getModuleUrl($this->moduleName); }
/** * renderContent renders sie given Fluidtemplate an adds the given data to the view helper. * Your templates have to be in "Resources/Private/Html/Content/" * * @param array $data Daten für das Fluid-Template * @param string $templateFile * * @return string Content */ public function renderContent($data, $templateFile) { if (file_exists($templateFile)) { $this->view->getRequest()->setControllerExtensionName($this->extKey); $this->view->setTemplatePathAndFilename($templateFile); $this->view->assign('data', $data); $content = $this->view->render(); } else { $content = 'Could not load template!'; } return $content; }
/** * @return \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController */ public function __construct() { $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class); $this->getLanguageService()->includeLLFile('EXT:scheduler/Resources/Private/Language/locallang.xlf'); $this->MCONF = array('name' => $this->moduleName); $this->cshKey = '_MOD_' . $this->moduleName; $this->backendTemplatePath = ExtensionManagementUtility::extPath('scheduler') . 'Resources/Private/Templates/Backend/SchedulerModule/'; $this->view = GeneralUtility::makeInstance(\TYPO3\CMS\Fluid\View\StandaloneView::class); $this->view->getRequest()->setControllerExtensionName('scheduler'); $this->moduleUri = BackendUtility::getModuleUrl($this->moduleName); $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class); $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Modal'); $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/SplitButtons'); }
/** * main method * * @return string */ public function main() { $this->view = $this->objectManager->get('\\TYPO3\\CMS\\Fluid\\View\\StandaloneView'); $this->view->getRequest()->setControllerExtensionName($this->getExtensionName()); $this->view->getRequest()->setPluginName('UpdateScript'); $this->view->getRequest()->setControllerName('UpdateScript'); $this->view->setLayoutRootPaths($this->getTemplateFolders('layout')); $this->view->setPartialRootPaths($this->getTemplateFolders('partial')); $this->view->assign('requestUri', GeneralUtility::getIndpEnv('REQUEST_URI')); $action = GeneralUtility::_GP('action') ? GeneralUtility::_GP('action') : 'Main'; if (is_callable(array($this, $action . 'Action'))) { $this->view->setTemplatePathAndFilename($this->getTemplatePath('UpdateScript/' . ucfirst($action) . '.html')); $content = call_user_func_array(array($this, $action . 'Action'), array()); } return $content; }
/** * Set some extbase variables if given * * @param array $conf Configuration array * @return void */ protected function setExtbaseVariables(array $conf) { /** @var $request \TYPO3\CMS\Extbase\Mvc\Request */ $requestPluginName = isset($conf['extbase.']['pluginName.']) ? $this->cObj->stdWrap($conf['extbase.']['pluginName'], $conf['extbase.']['pluginName.']) : $conf['extbase.']['pluginName']; if ($requestPluginName) { $this->view->getRequest()->setPluginName($requestPluginName); } $requestControllerExtensionName = isset($conf['extbase.']['controllerExtensionName.']) ? $this->cObj->stdWrap($conf['extbase.']['controllerExtensionName'], $conf['extbase.']['controllerExtensionName.']) : $conf['extbase.']['controllerExtensionName']; if ($requestControllerExtensionName) { $this->view->getRequest()->setControllerExtensionName($requestControllerExtensionName); } $requestControllerName = isset($conf['extbase.']['controllerName.']) ? $this->cObj->stdWrap($conf['extbase.']['controllerName'], $conf['extbase.']['controllerName.']) : $conf['extbase.']['controllerName']; if ($requestControllerName) { $this->view->getRequest()->setControllerName($requestControllerName); } $requestControllerActionName = isset($conf['extbase.']['controllerActionName.']) ? $this->cObj->stdWrap($conf['extbase.']['controllerActionName'], $conf['extbase.']['controllerActionName.']) : $conf['extbase.']['controllerActionName']; if ($requestControllerActionName) { $this->view->getRequest()->setControllerActionName($requestControllerActionName); } }
/** * Add sys_notes as additional content to the footer of the page module * * @param array $params * @param PageLayoutController $parentObject * @return string */ public function render(array $params = array(), PageLayoutController $parentObject) { if ($parentObject->MOD_SETTINGS['function'] == 1) { $pageInfo = $parentObject->pageinfo; if ($this->pageCanBeIndexed($pageInfo)) { // template $this->loadCss(); $this->loadJavascript(); //load partial paths info from typoscript $this->view = GeneralUtility::makeInstance(StandaloneView::class); $this->view->setFormat('html'); $this->view->getRequest()->setControllerExtensionName('cs_seo'); $absoluteResourcesPath = ExtensionManagementUtility::extPath('cs_seo') . 'Resources/'; $layoutPaths = [$absoluteResourcesPath . 'Private/Layouts/']; $partialPaths = [$absoluteResourcesPath . 'Private/Partials/']; // load partial paths info from TypoScript if ($this->isTYPO3VersionGreather6) { /** @var ObjectManager $objectManager */ $objectManager = GeneralUtility::makeInstance(ObjectManager::class); /** @var ConfigurationManagerInterface $configurationManager */ $configurationManager = $objectManager->get(ConfigurationManagerInterface::class); $tsSetup = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, 'csseo'); $layoutPaths = $tsSetup["view"]["layoutRootPaths"] ?: $layoutPaths; $partialPaths = $tsSetup["view"]["partialRootPaths"] ?: $partialPaths; } $this->view->setLayoutRootPaths($layoutPaths); $this->view->setPartialRootPaths($partialPaths); $this->view->setTemplatePathAndFilename(ExtensionManagementUtility::extPath('cs_seo') . 'Resources/Private/Templates/PageHook.html'); $results = $this->getResults($pageInfo, $parentObject->current_sys_language); $score = $results['Percentage']; unset($results['Percentage']); $this->view->assignMultiple(['score' => $score, 'results' => $results, 'page' => $parentObject->pageinfo]); return $this->view->render(); } } }
/** * Constructor */ public function __construct() { $this->view = GeneralUtility::makeInstance(StandaloneView::class); $this->view->getRequest()->setControllerExtensionName('lowlevel'); }
/** * Constructor */ public function __construct() { $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class); $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class); $this->presetRepository = GeneralUtility::makeInstance(PresetRepository::class); $templatePath = ExtensionManagementUtility::extPath('impexp') . 'Resources/Private/'; /* @var $view StandaloneView */ $this->standaloneView = GeneralUtility::makeInstance(StandaloneView::class); $this->standaloneView->setTemplateRootPaths([$templatePath . 'Templates/ImportExport/']); $this->standaloneView->setLayoutRootPaths([$templatePath . 'Layouts/']); $this->standaloneView->setPartialRootPaths([$templatePath . 'Partials/']); $this->standaloneView->getRequest()->setControllerExtensionName('impexp'); }