Fixing minor issue with widget api and removing homepage menu

This commit is contained in:
2016-09-23 12:30:58 +02:00
parent a3e7c60e01
commit 010c7652a6
6 changed files with 18 additions and 44 deletions

View File

@@ -269,7 +269,7 @@ abstract class AbstractWidgetsCompilerPass implements CompilerPassInterface
return $this->cacheAndGetOrdering($place, $ordering + 1);
} else {
// cache the ordering
$this->cacheOrdering[$place] = $ordering;
$this->cacheOrdering[$place][] = $ordering;
return $ordering;
}

View File

@@ -167,13 +167,18 @@ trait AddWidgetConfigurationTrait
->info("the ordering of the widget. May be a number with decimal")
->example("10.58")
->end()
->enumNode(WidgetsCompilerPass::WIDGET_CONFIG_ALIAS)
->values($this->getWidgetAliasesbyPlace($place, $containerBuilder))
->info("the widget alias (see config for your bundle)")
->scalarNode(WidgetsCompilerPass::WIDGET_CONFIG_ALIAS)
// this node is scalar: when the configuration is build, the
// tagged services are not available. But when the config reference
// is build, the services are avaialble => we add the possible aliases
// in the info.
->info("the widget alias (see your installed bundles config). "
. "Possible values are (maybe incomplete) : ".
\implode(", ", $this->getWidgetAliasesbyPlace($place, $containerBuilder)))
->isRequired()
->end()
;
// adding the possible config on each widget under the widget_alias
foreach ($this->filterWidgetByPlace($place) as $factory) {
$builder = new TreeBuilder();
@@ -207,6 +212,10 @@ trait AddWidgetConfigurationTrait
* get the all possible aliases for the given place. This method
* search within service tags and widget factories
*
* **Note** that services are not available when the config is build: the whole
* aliases will be checked in compiler pass, or when the command
* `config:dump-reference` is runned.
*
* @param type $place
* @param ContainerBuilder $containerBuilder
* @return type
@@ -219,7 +228,7 @@ trait AddWidgetConfigurationTrait
foreach ($this->filterWidgetByPlace($place) as $factory) {
$result[] = $factory->getWidgetAlias();
}
// append the aliases added without factory
foreach ($containerBuilder
->findTaggedServiceIds(WidgetsCompilerPass::WIDGET_SERVICE_TAG_NAME)