예제 #1
0
파일: Subscriber.php 프로젝트: zonky2/core
 /**
  * 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_dcasetting') {
             return;
         }
         $subscriber = new BreadCrumbInputScreenSetting($serviceContainer);
         $subscriber->getBreadcrumb($event);
     })->addListener(ModelToLabelEvent::NAME, array($this, 'handleModelToLabel'))->addListener(DcGeneralEvents::ACTION, array($this, 'handleAddAll'))->addListener(DecodePropertyValueForWidgetEvent::NAME, array($this, 'decodeLegendTitleValue'))->addListener(EncodePropertyValueFromWidgetEvent::NAME, array($this, 'encodeLegendTitleValue'))->addListener(BuildWidgetEvent::NAME, array($this, 'buildLegendTitleWidget'))->addListener(GetPropertyOptionsEvent::NAME, array($this, 'getAttributeOptions'))->addListener(GetPropertyOptionsEvent::NAME, array($this, 'getRichTextEditorOptions'))->addListener(ManipulateWidgetEvent::NAME, array($this, 'getWizardForTlClass'))->addListener(BuildDataDefinitionEvent::NAME, array($this, 'buildPaletteRestrictions'));
 }
 /**
  * {@inheritDoc}
  */
 public function getBreadcrumbElements(EnvironmentInterface $environment, $elements)
 {
     if (!isset($this->inputScreenSettingId)) {
         if (!isset($this->inputScreenSettingConditionId)) {
             $this->inputScreenSettingId = $this->extractIdFrom($environment, 'pid');
         } else {
             $this->inputScreenSettingId = $this->getInputScreenSettingCondition()->pid;
         }
     }
     $elements = parent::getBreadcrumbElements($environment, $elements);
     $elements[] = array('url' => $this->generateUrl('tl_metamodel_dcasetting_condition', $this->seralizeId('tl_metamodel_dcasetting', $this->inputScreenSettingId)), 'text' => sprintf($this->getBreadcrumbLabel($environment, 'tl_metamodel_dcasetting_condition'), $this->getConditionAttribute()), 'icon' => $this->getBaseUrl() . '/system/modules/metamodels/assets/images/icons/dca_condition.png');
     return $elements;
 }