function translation_entity_translatable_form

Form constructor for the confirmation of translatability switching.

1 string reference to 'translation_entity_translatable_form'
translation_entity_menu in drupal/core/modules/translation_entity/translation_entity.module
Implements hook_menu().

File

drupal/core/modules/translation_entity/translation_entity.admin.inc, line 13
The entity translation administration forms.

Code

function translation_entity_translatable_form(array $form, array &$form_state, $field_name) {
  $field = field_info_field($field_name);
  $t_args = array(
    '%name' => $field_name,
  );
  $warning = t('By submitting this form these changes will apply to the %name field everywhere it is used.', $t_args);
  if ($field['translatable']) {
    $title = t('Are you sure you want to disable translation for the %name field?', $t_args);
    $warning .= "<br>" . t("<strong>All the existing translations of this field will be deleted.</strong><br>This action cannot be undone.");
  }
  else {
    $title = t('Are you sure you want to enable translation for the %name field?', $t_args);
  }

  // We need to keep some information for later processing.
  $form_state['field'] = $field;

  // Store the 'translatable' status on the client side to prevent outdated form
  // submits from toggling translatability.
  $form['translatable'] = array(
    '#type' => 'hidden',
    '#default_value' => $field['translatable'],
  );
  return confirm_form($form, $title, '', $warning);
}