Process callback: Determines which elements get clue in the form.
array $element: Form API element.
array A processed element with the shared elements marked with a clue.
\Drupal\translation_entity\EntityTranslationController::entityFormAlter()
public function entityFormSharedElements($element) {
static $ignored_types;
// @todo Find a more reliable way to determine if a form element concerns a
// multilingual value.
if (!isset($ignored_types)) {
$ignored_types = array_flip(array(
'actions',
'value',
'hidden',
'vertical_tabs',
'token',
));
}
foreach (element_children($element) as $key) {
if (!isset($element[$key]['#type'])) {
$this
->entityFormSharedElements($element[$key]);
}
else {
// Ignore non-widget form elements.
if (isset($ignored_types[$element[$key]['#type']])) {
continue;
}
// Elements are considered to be non multilingual by default.
if (empty($element[$key]['#multilingual'])) {
$this
->addTranslatabilityClue($element[$key]);
}
}
}
return $element;
}