You are here

function lingotek_form_field_ui_field_edit_form_alter in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.2 lingotek.module \lingotek_form_field_ui_field_edit_form_alter()

Implements hook_form_FORM_ID_alter().

Enable Lingotek translation on a field type

File

./lingotek.module, line 940

Code

function lingotek_form_field_ui_field_edit_form_alter(&$form, &$form_state) {
  if (!lingotek_supported_field_type($form['#field']['type'])) {
    return $form;
  }
  $default = 0;
  if (array_key_exists('lingotek_translatable', $form['#field'])) {
    $default = $form['#field']['lingotek_translatable'];
  }
  $form['field']['lingotek_translatable'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable Lingotek Translation'),
    '#description' => t('This allows fields to be translatable using the Lingotek Collaborative Translations Platform.'),
    '#default_value' => $default,
  );
  array_push($form['#submit'], 'lingotek_update_field');
  return $form;
}