本文整理汇总了PHP中FluidTYPO3\Flux\Core::getRegisteredProviderExtensionKeys方法的典型用法代码示例。如果您正苦于以下问题:PHP Core::getRegisteredProviderExtensionKeys方法的具体用法?PHP Core::getRegisteredProviderExtensionKeys怎么用?PHP Core::getRegisteredProviderExtensionKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FluidTYPO3\Flux\Core
的用法示例。
在下文中一共展示了Core::getRegisteredProviderExtensionKeys方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPathConfigurationsFromRootTypoScriptTemplates
/**
* Gets a collection of path configurations for content elements
* based on each root TypoScript template in the provided array
* of templates. Returns an array of paths indexed by the root
* page UID.
*
* @param array $templates
* @return array
*/
protected function getPathConfigurationsFromRootTypoScriptTemplates($templates)
{
$allTemplatePaths = array();
$registeredExtensionKeys = Core::getRegisteredProviderExtensionKeys('Content');
foreach ($templates as $templateRecord) {
$pageUid = $templateRecord['pid'];
/** @var \TYPO3\CMS\Core\TypoScript\ExtendedTemplateService $template */
$template = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\ExtendedTemplateService');
$template->tt_track = 0;
$template->init();
/** @var \TYPO3\CMS\Frontend\Page\PageRepository $sys_page */
$sys_page = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
$rootLine = $sys_page->getRootLine($pageUid);
$template->runThroughTemplates($rootLine);
$template->generateConfig();
$oldTemplatePathLocation = (array) $template->setup['plugin.']['tx_fed.']['fce.'];
$newTemplatePathLocation = (array) $template->setup['plugin.']['tx_fluidcontent.']['collections.'];
$registeredPathCollections = array();
foreach ($registeredExtensionKeys as $registeredExtensionKey) {
$nativeViewLocation = $this->getContentConfiguration($registeredExtensionKey);
if (FALSE === isset($nativeViewLocation['extensionKey'])) {
$nativeViewLocation['extensionKey'] = ExtensionNamingUtility::getExtensionKey($registeredExtensionKey);
}
$registeredPathCollections[$registeredExtensionKey] = $nativeViewLocation;
}
$merged = GeneralUtility::array_merge_recursive_overrule($oldTemplatePathLocation, $newTemplatePathLocation);
$merged = GeneralUtility::removeDotsFromTS($merged);
$merged = GeneralUtility::array_merge($merged, $registeredPathCollections);
$allTemplatePaths[$pageUid] = $merged;
}
return $allTemplatePaths;
}
示例2: canRegisterProviderExtensionKey
/**
* @test
*/
public function canRegisterProviderExtensionKey()
{
$fakeExtensionKey = 'flux';
$fakeControllerName = 'Flux';
Core::registerProviderExtensionKey($fakeExtensionKey, $fakeControllerName);
$registered = Core::getRegisteredProviderExtensionKeys($fakeControllerName);
$this->assertContains($fakeExtensionKey, $registered);
}
示例3: getPageConfiguration
/**
* Get definitions of paths for Page Templates defined in TypoScript
*
* @param string $extensionName
* @return array
* @api
*/
public function getPageConfiguration($extensionName = null)
{
if (null !== $extensionName && true === empty($extensionName)) {
// Note: a NULL extensionName means "fetch ALL defined collections" whereas
// an empty value that is not null indicates an incorrect caller. Instead
// of returning ALL paths here, an empty array is the proper return value.
// However, dispatch a debug message to inform integrators of the problem.
$this->message('Template paths have been attempted fetched using an empty value that is NOT NULL in ' . get_class($this) . '. This indicates a potential problem with your TypoScript configuration - a ' . 'value which is expected to be an array may be defined as a string. This error is not fatal but may ' . 'prevent the affected collection (which cannot be identified here) from showing up', GeneralUtility::SYSLOG_SEVERITY_NOTICE);
return [];
}
if (null !== $extensionName) {
return $this->getViewConfigurationForExtensionName($extensionName);
}
$configurations = [];
$registeredExtensionKeys = Core::getRegisteredProviderExtensionKeys('Page');
foreach ($registeredExtensionKeys as $registeredExtensionKey) {
$configurations[$registeredExtensionKey] = $this->getViewConfigurationForExtensionName($registeredExtensionKey);
}
return $configurations;
}
示例4: getContentConfiguration
/**
* Get definitions of paths for FCEs defined in TypoScript
*
* @param string $extensionName
* @return array
* @api
*/
public function getContentConfiguration($extensionName = NULL)
{
if (NULL !== $extensionName) {
return $this->getViewConfigurationForExtensionName($extensionName);
}
$registeredExtensionKeys = (array) Core::getRegisteredProviderExtensionKeys('Content');
$configuration = array();
foreach ($registeredExtensionKeys as $registeredExtensionKey) {
$configuration[$registeredExtensionKey] = $this->getContentConfiguration($registeredExtensionKey);
}
return $configuration;
}
示例5: performDummyRegistration
/**
* @return void
*/
protected function performDummyRegistration()
{
Core::registerProviderExtensionKey($this->extensionName, $this->getControllerName());
$this->assertContains($this->extensionName, Core::getRegisteredProviderExtensionKeys($this->getControllerName()));
}
示例6: getRegisteredProviderExtensionKeys
/**
* @return array
*/
protected function getRegisteredProviderExtensionKeys()
{
return Core::getRegisteredProviderExtensionKeys('Backend');
}
示例7: getPageConfiguration
/**
* Get definitions of paths for Page Templates defined in TypoScript
*
* @param string $extensionName
* @return array
* @api
*/
public function getPageConfiguration($extensionName = NULL)
{
$cacheKey = NULL === $extensionName ? 'pages_global' : 'pages_' . $extensionName;
if (TRUE === isset(self::$cache[$cacheKey])) {
return self::$cache[$cacheKey];
}
if (NULL !== $extensionName && TRUE === empty($extensionName)) {
// Note: a NULL extensionName means "fetch ALL defined collections" whereas
// an empty value that is not null indicates an incorrect caller. Instead
// of returning ALL paths here, an empty array is the proper return value.
// However, dispatch a debug message to inform integrators of the problem.
$this->message('Template paths have been attempted fetched using an empty value that is NOT NULL in ' . get_class($this) . '. This indicates a potential problem with your TypoScript configuration - a value which is expected to be ' . 'an array may be defined as a string. This error is not fatal but may prevent the affected collection (which cannot ' . 'be identified here) from showing up', GeneralUtility::SYSLOG_SEVERITY_NOTICE);
return array();
}
if (TYPO3_MODE === 'BE') {
// Hack. This is no fun matter, but the TYPO3 BackendConfigurationManager
// is incapable of considering how to fetch a page UID from the "editconf"
// array which is used when editing a particular page. The result is that
// because Flux uses Extbase's resolve methods for TypoScript, the methods
// will use the fallback behavior (only root TS templates). Forcibly setting
// this GET['id'] should not have a negative effect on other scripts and will
// fix the problem - because Extbase will instantly detect and use this ID.
// New behaviour has one flaw: editing multiple pages will cause every page
// to use the first page's TypoScript settings and therefore page templates -
// which could be a problem when editing multiple pages each having own TS.
if (TRUE === isset($GLOBALS['SOBE']->editconf['pages'])) {
$_GET['id'] = key($GLOBALS['SOBE']->editconf['pages']);
}
}
$newLocation = (array) $this->getTypoScriptSubConfiguration($extensionName, 'collections', 'fluidpages');
$oldLocation = (array) $this->getTypoScriptSubConfiguration($extensionName, 'page', 'fed');
$merged = (array) GeneralUtility::array_merge_recursive_overrule($oldLocation, $newLocation);
if (NULL === $extensionName) {
$registeredExtensionKeys = Core::getRegisteredProviderExtensionKeys('Page');
foreach ($registeredExtensionKeys as $registeredExtensionKey) {
$extensionViewPaths = $this->getPageConfiguration($registeredExtensionKey);
if (FALSE === isset($extensionViewPaths['extensionKey'])) {
$extensionViewPaths['extensionKey'] = ExtensionNamingUtility::getExtensionKey($registeredExtensionKey);
}
// preemptive caching; once read here, the cached value is returned when asking for specific extensions later
if (FALSE === isset($extensionViewPaths['templateRootPath'])) {
$this->sendWarningAboutMissingTemplatePath($registeredExtensionKey);
continue;
}
self::$cache[$registeredExtensionKey] = $extensionViewPaths;
$merged[$registeredExtensionKey] = $extensionViewPaths;
}
} else {
$nativeViewLocation = $this->getViewConfigurationForExtensionName($extensionName);
if (TRUE === is_array($nativeViewLocation)) {
$merged = GeneralUtility::array_merge_recursive_overrule($nativeViewLocation, $merged);
}
if (FALSE === isset($nativeViewLocation['extensionKey'])) {
$merged['extensionKey'] = ExtensionNamingUtility::getExtensionKey($extensionName);
}
if (FALSE === isset($merged['templateRootPath'])) {
$this->sendWarningAboutMissingTemplatePath($extensionName);
}
}
self::$cache[$cacheKey] = $merged;
return $merged;
}