/** * Get a newsletter-conf-template parameter * * @param string $key Parameter key * @return mixed Parameter value */ public static function confParam($key) { // Look for a config in the module TS first. static $configTS; if (!is_array($configTS) && isset($GLOBALS['TYPO3_DB'])) { $beConfManager = self::getObjectManager()->get(\TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager::class); $configTS = $beConfManager->getTypoScriptSetup(); $configTS = $configTS['module.']['tx_newsletter.']['config.']; } if (isset($configTS[$key])) { return $configTS[$key]; } // Else fallback to the extension config. if (!is_array(self::$configuration)) { self::$configuration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['newsletter']); } return self::$configuration[$key]; }
/** * Returns a frontend URI independently of current context, with or without extbase, and with or without TSFE * @param string $actionName * @param array $controllerArguments * @param string $controllerName * @param string $extensionName * @param string $pluginName * @return string absolute URI */ public static function buildFrontendUri($actionName, array $controllerArguments, $controllerName, $extensionName = 'newsletter', $pluginName = 'p') { if (!self::$uriBuilder) { self::$uriBuilder = self::buildUriBuilder($extensionName, $pluginName); } $controllerArguments['action'] = $actionName; $controllerArguments['controller'] = $controllerName; $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager'); $extensionService = $objectManager->get('TYPO3\\CMS\\Extbase\\Service\\ExtensionService'); $pluginNamespace = $extensionService->getPluginNamespace($extensionName, $pluginName); $arguments = array($pluginNamespace => $controllerArguments); self::$uriBuilder->reset()->setUseCacheHash(false)->setCreateAbsoluteUri(true)->setArguments($arguments); return self::$uriBuilder->buildFrontendUri() . '&type=1342671779'; }