/** * {@inheritdoc} */ protected function alterRoutes(RouteCollection $collection) { foreach ($this->rulesUiManager->getDefinitions() as $name => $definition) { $ui_definition = $this->rulesUiManager->getDefinition($name); $this->registerRoutes($ui_definition, $collection); } }
/** * @cover \Drupal\rules\Ui\RulesUiManager */ public function testUiManager() { $definition = $this->rulesUiManager->getDefinitions(); $this->assertTrue(isset($definition['rules_test_ui_embed.settings_conditions'])); $this->assertInstanceOf(RulesUiDefinition::class, $definition['rules_test_ui_embed.settings_conditions']); $this->assertTrue(!empty($definition['rules_test_ui_embed.settings_conditions']->label)); $this->assertEquals(RulesUiConfigHandler::class, $definition['rules_test_ui_embed.settings_conditions']->getClass()); }
/** * {@inheritdoc} */ public function enhance(array $defaults, Request $request) { // @var $route \Symfony\Component\Routing\Route $route = $defaults[RouteObjectInterface::ROUTE_OBJECT]; $plugin_id = $route->getOption('_rules_ui'); $defaults['rules_ui_handler'] = $this->rulesUiManager->createInstance($plugin_id); return $defaults; }