function translation_entity_language_configuration_element_process

Process callback: Expands the language_configuration form element.

Parameters

array $element: Form API element.

Return value

Processed language configuration element.

1 call to translation_entity_language_configuration_element_process()
translation_entity_enable_widget in drupal/core/modules/translation_entity/translation_entity.module
Returns a widget to enable entity translation per entity bundle.
1 string reference to 'translation_entity_language_configuration_element_process'
translation_entity_element_info_alter in drupal/core/modules/translation_entity/translation_entity.module
Implements hook_element_info_alter().

File

drupal/core/modules/translation_entity/translation_entity.module, line 661
Allows entities to be translated into different languages.

Code

function translation_entity_language_configuration_element_process(array $element, array &$form_state, array &$form) {
  $form_state['translation_entity']['key'] = $element['#name'];
  $context = $form_state['language'][$element['#name']];
  $element['translation_entity'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable translation'),
    '#default_value' => translation_entity_enabled($context['entity_type'], $context['bundle']),
    '#element_validate' => array(
      'translation_entity_language_configuration_element_validate',
    ),
    '#prefix' => '<label>' . t('Translation') . '</label>',
  );
  $form['#submit'][] = 'translation_entity_language_configuration_element_submit';
  return $element;
}