/** * {@inheritdoc} */ public function getFieldDefinition($arrOverrides = array()) { $arrFieldDef = parent::getFieldDefinition($arrOverrides); $arrFieldDef['inputType'] = 'text'; // we do not need to set mandatory, as we will automatically update our value when isunique is given. if ($this->get('isunique')) { $arrFieldDef['eval']['mandatory'] = false; } return $arrFieldDef; }
/** * {@inheritdoc} */ public function getFieldDefinition($arrOverrides = array()) { $arrFieldDef = parent::getFieldDefinition($arrOverrides); $arrFieldDef['inputType'] = 'text'; // We do not need to set mandatory, as we will automatically update our value when isunique is given. if ($this->get('isunique')) { $arrFieldDef['eval']['mandatory'] = false; } // If "force_alias" is ture set alwaysSave to true. if ($this->get('force_alias')) { $arrFieldDef['eval']['alwaysSave'] = true; } return $arrFieldDef; }
/** * {@inheritdoc} */ public function getFieldDefinition($overrides = array()) { $arrFieldDef = parent::getFieldDefinition($overrides); $arrFieldDef['inputType'] = 'text'; if (!isset($arrFieldDef['eval']['tl_class'])) { $arrFieldDef['eval']['tl_class'] = ''; } $arrFieldDef['eval']['tl_class'] .= ' wizard inline'; if (!$this->get('trim_title')) { $arrFieldDef['eval']['size'] = 2; $arrFieldDef['eval']['multiple'] = true; $arrFieldDef['eval']['tl_class'] .= ' metamodelsattribute_url'; } /** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher */ $dispatcher = $this->getMetaModel()->getServiceContainer()->getEventDispatcher(); $dispatcher->addListener(ManipulateWidgetEvent::NAME, array(new UrlWizardHandler($this->getMetaModel(), $this->getColName()), 'getWizard')); return $arrFieldDef; }
/** * {@inheritDoc} */ public function getTranslatedDataFor($arrIds, $strLangCode) { $arrReturn = parent::getTranslatedDataFor($arrIds, $strLangCode); // Per definition: // - all values that are not contained are defaulting to false in the fallback language. // - all values in published not contained are defaulting to false. if ($this->isFixingOfValuesNeeded($arrReturn, $arrIds, $strLangCode)) { // We have to lock the retrieval to prevent endless recursion. $this->doNotFixValues = true; $fixedValues = array(); foreach (array_diff($arrIds, array_keys($arrReturn)) as $itemId) { $arrReturn[$itemId] = $this->widgetToValue(false, $itemId); $fixedValues[$itemId] = $arrReturn[$itemId]; } if (count($fixedValues)) { $this->setTranslatedDataFor($fixedValues, $strLangCode); } // Unlock the retrieval again as we have fixed the values in the database. $this->doNotFixValues = false; } return $arrReturn; }
/** * {@inheritDoc} */ public function getTranslatedDataFor($arrIds, $strLangCode) { $arrValues = parent::getTranslatedDataFor($arrIds, $strLangCode); foreach ($arrValues as $intId => $arrValue) { $arrValues[$intId]['value'] = ToolboxFile::convertUuidsOrPathsToMetaModels(deserialize($arrValue['value'], true)); } return $arrValues; }
/** * {@inheritDoc} */ public function getFieldDefinition($arrOverrides = array()) { $arrFieldDef = parent::getFieldDefinition($arrOverrides); $arrFieldDef['inputType'] = 'textarea'; return $arrFieldDef; }