/** * Register all listeners to handle creation of a data container. * * @return void */ protected function registerEventsInDispatcher() { $serviceContainer = $this->getServiceContainer(); $this->addListener(GetBreadcrumbEvent::NAME, function (GetBreadcrumbEvent $event) use($serviceContainer) { if ($event->getEnvironment()->getDataDefinition()->getName() !== 'tl_metamodel_rendersettings') { return; } $subscriber = new BreadCrumbRenderSettings($serviceContainer); $subscriber->getBreadcrumb($event); })->addListener(ModelToLabelEvent::NAME, array($this, 'modelToLabel'))->addListener(DecodePropertyValueForWidgetEvent::NAME, array($this, 'decodeJumpToValue'))->addListener(EncodePropertyValueFromWidgetEvent::NAME, array($this, 'encodeJumpToValue'))->addListener(BuildWidgetEvent::NAME, array($this, 'buildJumpToWidget'))->addListener(GetPropertyOptionsEvent::NAME, array($this, 'getTemplateOptions'))->addListener(GetOptionsEvent::NAME, array($this, 'getCssFilesOptions'))->addListener(GetOptionsEvent::NAME, array($this, 'getJsFilesOptions')); }
/** * {@inheritDoc} */ public function getBreadcrumbElements(EnvironmentInterface $environment, $elements) { if (!isset($this->renderSettingsId)) { if (!isset($this->renderSettingId)) { $this->renderSettingsId = $this->extractIdFrom($environment, 'pid'); } else { $this->renderSettingsId = $this->getRenderSettingItem()->pid; } } $elements = parent::getBreadcrumbElements($environment, $elements); $renderSettings = $this->getRenderSettings(); $elements[] = array('url' => $this->generateUrl('tl_metamodel_rendersetting', $this->seralizeId('tl_metamodel_rendersettings', $this->renderSettingsId)), 'text' => sprintf($this->getBreadcrumbLabel($environment, 'tl_metamodel_rendersetting'), $renderSettings->name), 'icon' => $this->getBaseUrl() . '/system/modules/metamodels/assets/images/icons/rendersetting.png'); return $elements; }