2 namespace TYPO3\CMS\Extbase\Service;
68 $pluginSignature = strtolower($extensionName .
'_' . $pluginName);
69 $defaultPluginNamespace =
'tx_' . $pluginSignature;
70 $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, $extensionName, $pluginName);
71 if (!isset($frameworkConfiguration[
'view'][
'pluginNamespace']) || empty($frameworkConfiguration[
'view'][
'pluginNamespace'])) {
72 return $defaultPluginNamespace;
74 return $frameworkConfiguration[
'view'][
'pluginNamespace'];
92 $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
94 if ($extensionName === $frameworkConfiguration[
'extensionName']) {
95 if (isset($frameworkConfiguration[
'controllerConfiguration'][$controllerName]) && in_array($actionName, $frameworkConfiguration[
'controllerConfiguration'][$controllerName][
'actions'])) {
96 return $frameworkConfiguration[
'pluginName'];
99 if (!is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'])) {
102 $pluginNames = array();
103 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'] as $pluginName => $pluginConfiguration) {
104 if (!is_array($pluginConfiguration[
'controllers'])) {
107 foreach ($pluginConfiguration[
'controllers'] as $pluginControllerName => $pluginControllerActions) {
108 if (strtolower($pluginControllerName) !== strtolower($controllerName)) {
111 if (in_array($actionName, $pluginControllerActions[
'actions'])) {
112 $pluginNames[] = $pluginName;
116 if (count($pluginNames) > 1) {
117 throw new \TYPO3\CMS\Extbase\Exception(
'There is more than one plugin that can handle this request (Extension: "' . $extensionName .
'", Controller: "' . $controllerName .
'", action: "' . $actionName .
'"). Please specify "pluginName" argument', 1280825466);
119 return !empty($pluginNames) ? $pluginNames[0] : null;
133 $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, $extensionName, $pluginName);
134 if (isset($frameworkConfiguration[
'controllerConfiguration'][$controllerName]) && is_array($frameworkConfiguration[
'controllerConfiguration'][$controllerName]) && is_array($frameworkConfiguration[
'controllerConfiguration'][$controllerName][
'nonCacheableActions']) && in_array($actionName, $frameworkConfiguration[
'controllerConfiguration'][$controllerName][
'nonCacheableActions'])) {
154 $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, $extensionName, $pluginName);
155 if (!isset($frameworkConfiguration[
'view'][
'defaultPid']) || empty($frameworkConfiguration[
'view'][
'defaultPid'])) {
158 $pluginSignature = strtolower($extensionName .
'_' . $pluginName);
159 if ($frameworkConfiguration[
'view'][
'defaultPid'] ===
'auto') {
160 if (!array_key_exists($pluginSignature, $this->targetPidPluginCache)) {
161 $pages =
$GLOBALS[
'TYPO3_DB']->exec_SELECTgetRows(
'pid',
'tt_content',
'list_type=' .
$GLOBALS[
'TYPO3_DB']->fullQuoteStr($pluginSignature,
'tt_content') .
' AND CType="list"' .
$GLOBALS[
'TSFE']->sys_page->enableFields(
'tt_content') .
' AND sys_language_uid=' .
$GLOBALS[
'TSFE']->sys_language_uid,
'',
'', 2);
162 if (count($pages) > 1) {
163 throw new \TYPO3\CMS\Extbase\Exception(
'There is more than one "' . $pluginSignature .
'" plugin in the current page tree. Please remove one plugin or set the TypoScript configuration "plugin.tx_' . $pluginSignature .
'.view.defaultPid" to a fixed page id', 1280773643);
165 $this->targetPidPluginCache[$pluginSignature] = !empty($pages) ? $pages[0][
'pid'] : null;
167 return $this->targetPidPluginCache[$pluginSignature];
169 return (
int)$frameworkConfiguration[
'view'][
'defaultPid'];
181 if (!is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'][$pluginName][
'controllers'])) {
184 $controllers =
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'][$pluginName][
'controllers'];
185 return key($controllers);
198 if (!is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'][$pluginName][
'controllers'][$controllerName][
'actions'])) {
201 $actions =
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'extbase'][
'extensions'][$extensionName][
'plugins'][$pluginName][
'controllers'][$controllerName][
'actions'];
202 return current($actions);
215 $settings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, $extensionName);
216 $formatToPageTypeMapping = isset($settings[
'view'][
'formatToPageTypeMapping']) ? $settings[
'view'][
'formatToPageTypeMapping'] : array();
217 if (is_array($formatToPageTypeMapping) && array_key_exists($format, $formatToPageTypeMapping)) {
218 $targetPageType = (int)$formatToPageTypeMapping[$format];
220 return $targetPageType;