/** * @param string $sectionName * @param string $formName * @return Form|NULL */ public function getForm($sectionName = 'Configuration', $formName = 'form') { /** @var Form $form */ $form = $this->getStoredVariable(AbstractFormViewHelper::SCOPE, $formName, $sectionName); if (NULL !== $form && TRUE === isset($this->templatePathAndFilename)) { $form->setOption(Form::OPTION_TEMPLATEFILE, $this->templatePathAndFilename); $signature = ExtensionNamingUtility::getExtensionSignature($this->controllerContext->getRequest()->getControllerExtensionName()); $overrides = (array) $this->configurationService->getTypoScriptByPath('plugin.tx_' . $signature . '.forms.' . $form->getName()); $form->modify($overrides); } return $form; }
/** * @return string * @route off */ public function renderAction() { $row = $this->getRecord(); $extensionKey = $this->provider->getExtensionKey($row); $extensionSignature = ExtensionNamingUtility::getExtensionSignature($extensionKey); $pluginSignature = 'tx_' . $extensionSignature . '_' . $this->request->getPluginName(); $controllerExtensionKey = $this->provider->getControllerExtensionKeyFromRecord($row); $requestActionName = $this->resolveOverriddenFluxControllerActionNameFromRequestParameters($pluginSignature); $controllerActionName = $this->provider->getControllerActionFromRecord($row); $actualActionName = NULL !== $requestActionName ? $requestActionName : $controllerActionName; $controllerName = $this->request->getControllerName(); return $this->performSubRendering($controllerExtensionKey, $controllerName, $actualActionName, $pluginSignature); }
/** * @param string $qualifiedExtensionName * @param Form $form * @return void * @throws \RuntimeException */ public function registerModuleBasedOnFluxForm($qualifiedExtensionName, Form $form) { $extensionKey = ExtensionNamingUtility::getExtensionKey($qualifiedExtensionName); $signature = ExtensionNamingUtility::getExtensionSignature($qualifiedExtensionName); $options = $form->getOption('Fluidbackend'); $formId = $form->getName(); $module = 'web'; if (TRUE === isset($options[Constants::FORM_OPTION_MODULE_GROUP])) { $module = $options[Constants::FORM_OPTION_MODULE_GROUP]; } $position = 'before:help'; if (TRUE === isset($options[Constants::FORM_OPTION_MODULE_POSITION])) { $position = $options[Constants::FORM_OPTION_MODULE_POSITION]; } $navigationComponent = ''; if (TRUE === isset($options[Constants::FORM_OPTION_MODULE_PAGE_TREE]) && TRUE === (bool) $options[Constants::FORM_OPTION_MODULE_PAGE_TREE]) { $navigationComponent = 'typo3-pagetree'; } $icon = MiscellaneousUtility::getIconForTemplate($form); if (TRUE === empty($icon)) { $icon = 'EXT:' . $extensionKey . '/ext_icon.gif'; } if (NULL === $this->getResolver()->resolveFluxControllerClassNameByExtensionKeyAndAction($qualifiedExtensionName, 'render', 'Backend')) { throw new \RuntimeException('Attempt to register a Backend controller without an associated BackendController. Extension key: ' . $extensionKey, 1368826271); } $moduleConfiguration = array('access' => 'user,group', 'icon' => $icon, 'labels' => 'LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_module_' . $formId . '.xlf'); if (FALSE === empty($navigationComponent)) { $moduleConfiguration['navigationComponentId'] = $navigationComponent; } $moduleSignature = 'tx_' . $signature . '_' . ucfirst($formId); if (FALSE === isset($GLOBALS['TBE_MODULES'][$module])) { if (FALSE === strpos($position, ':')) { if ('top' === $position) { $temp_TBE_MODULES = array($module => ''); $temp_TBE_MODULES = RecursiveArrayUtility::mergeRecursiveOverrule($temp_TBE_MODULES, $GLOBALS['TBE_MODULES']); } else { $temp_TBE_MODULES = (array) $GLOBALS['TBE_MODULES']; $temp_TBE_MODULES[$module] = ''; } } else { list($command, $relativeKey) = explode(':', $position); foreach ($GLOBALS['TBE_MODULES'] as $key => $val) { if ($key === $relativeKey) { if ('before' === $command) { $temp_TBE_MODULES[$module] = ''; $temp_TBE_MODULES[$key] = $val; } else { $temp_TBE_MODULES[$key] = $val; $temp_TBE_MODULES[$module] = ''; } } else { $temp_TBE_MODULES[$key] = $val; } } } $GLOBALS['TBE_MODULES'] = (array) $temp_TBE_MODULES; // register pseudo-module acting as group header $moduleConfiguration['labels'] = 'LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_modulegroup.xlf'; ExtensionUtility::registerModule($qualifiedExtensionName, $module, '', $position, array('Backend' => 'render,save'), $moduleConfiguration); } // register individual module in group $moduleConfiguration['labels'] = 'LLL:EXT:' . $extensionKey . '/Resources/Private/Language/locallang_module_' . $formId . '.xlf'; ExtensionUtility::registerModule($qualifiedExtensionName, $module, $moduleSignature, $position, array('Backend' => 'render,save'), $moduleConfiguration); }
/** * Returns the plugin.tx_extsignature.settings array. * Accepts any input extension name type. * * @param string $extensionName * @return array */ public function getSettingsForExtensionName($extensionName) { $signature = ExtensionNamingUtility::getExtensionSignature($extensionName); return (array) $this->getTypoScriptByPath('plugin.tx_' . $signature . '.settings'); }
/** * @param string $qualifiedExtensionName * @return array */ protected function getTypoScriptOverrides($qualifiedExtensionName) { if (static::$overrides === NULL) { $collected = array(); $typoScript = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager')->get('TYPO3\\CMS\\Extbase\\Object\\ObjectManagerInterface')->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT); foreach ((array) ObjectAccess::getPropertyPath($typoScript, 'plugin') as $prefix => $pluginSettings) { if (!empty($pluginSettings['package'])) { $collected[substr($prefix, 3)] = $pluginSettings['package']; } } static::$overrides = $collected; } $packageSignature = ExtensionNamingUtility::getExtensionSignature($qualifiedExtensionName); if (!empty(static::$overrides[$packageSignature])) { return static::$overrides[$packageSignature]; } return array(); }