Commit fce26fe7 authored by catch's avatar catch

Issue #2291721 by alexpott: Use methods instead of array access in when using...

Issue #2291721 by alexpott: Use methods instead of array access in when using DataDefinition objects from TypedConfig .
parent cb5263f0
...@@ -28,7 +28,7 @@ public function getFormElement(DataDefinitionInterface $definition, LanguageInte ...@@ -28,7 +28,7 @@ public function getFormElement(DataDefinitionInterface $definition, LanguageInte
$format = $this->t('Displayed as %date_format', array('%date_format' => \Drupal::service('date')->format(REQUEST_TIME, 'custom', $value))); $format = $this->t('Displayed as %date_format', array('%date_format' => \Drupal::service('date')->format(REQUEST_TIME, 'custom', $value)));
return array( return array(
'#type' => 'textfield', '#type' => 'textfield',
'#title' => $this->t($definition['label']) . '<span class="visually-hidden"> (' . $language->name . ')</span>', '#title' => $this->t($definition->getLabel()) . '<span class="visually-hidden"> (' . $language->name . ')</span>',
'#description' => $description, '#description' => $description,
'#default_value' => $value, '#default_value' => $value,
'#attributes' => array('lang' => $language->id), '#attributes' => array('lang' => $language->id),
......
...@@ -29,7 +29,7 @@ public function getFormElement(DataDefinitionInterface $definition, LanguageInte ...@@ -29,7 +29,7 @@ public function getFormElement(DataDefinitionInterface $definition, LanguageInte
return array( return array(
'#type' => 'textarea', '#type' => 'textarea',
'#default_value' => $value, '#default_value' => $value,
'#title' => $this->t($definition['label']) . '<span class="visually-hidden"> (' . $language->name . ')</span>', '#title' => $this->t($definition->getLabel()) . '<span class="visually-hidden"> (' . $language->name . ')</span>',
'#rows' => $rows, '#rows' => $rows,
'#attributes' => array('lang' => $language->id), '#attributes' => array('lang' => $language->id),
); );
......
...@@ -24,7 +24,7 @@ public function getFormElement(DataDefinitionInterface $definition, LanguageInte ...@@ -24,7 +24,7 @@ public function getFormElement(DataDefinitionInterface $definition, LanguageInte
return array( return array(
'#type' => 'textfield', '#type' => 'textfield',
'#default_value' => $value, '#default_value' => $value,
'#title' => $this->t($definition['label']) . '<span class="visually-hidden"> (' . $language->name . ')</span>', '#title' => $this->t($definition->getLabel()) . '<span class="visually-hidden"> (' . $language->name . ')</span>',
'#attributes' => array('lang' => $language->id), '#attributes' => array('lang' => $language->id),
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment