function translation_form_node_type_form_alter

Implements hook_form_FORM_ID_alter() for node_type_form().

File

drupal/core/modules/translation/translation.module, line 161
Manages content translations.

Code

function translation_form_node_type_form_alter(&$form, &$form_state) {

  // Hide form element if default language is a constant.
  // TODO: When form #states allows OR values change this to use form #states.
  $form['#attached']['library'][] = array(
    'translation',
    'drupal.translation',
  );

  // Add translation option to content type form.
  $form['language']['node_type_language_translation_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable translation'),
    '#default_value' => variable_get('node_type_language_translation_enabled_' . $form['#node_type']->type, FALSE),
    '#element_validate' => array(
      'translation_node_type_language_translation_enabled_validate',
    ),
    '#prefix' => "<label class='form-item-node-type-language-translation-enabled'>" . t('Translation') . "</label>",
  );
}