You are here

function entity_translation_unified_form_form_node_type_form_process in Entity Translation Unified Form 7

Same name and namespace in other branches
  1. 8 entity_translation_unified_form.module \entity_translation_unified_form_form_node_type_form_process()

Add an "enable" checkbox to the node type's multilingual settings.

1 string reference to 'entity_translation_unified_form_form_node_type_form_process'
entity_translation_unified_form_form_node_type_form_alter in ./entity_translation_unified_form.module
Implements hook_form_FORM_ID_alter().

File

./entity_translation_unified_form.module, line 21
Places entity translated fields inline in a single form.

Code

function entity_translation_unified_form_form_node_type_form_process(&$form, $form_state) {
  $type = $form['#node_type']->type;

  // Hide settings when entity translation is disabled for this content type.
  $states = array(
    'visible' => array(
      ':input[name="language_content_type"]' => array(
        'value' => ENTITY_TRANSLATION_ENABLED,
      ),
    ),
  );
  $form['workflow']['entity_translation_unified_form'] = array(
    '#title' => t('Unified form'),
    '#type' => 'fieldset',
    '#weight' => 10,
    '#states' => $states,
  );
  $form['workflow']['entity_translation_unified_form']['entity_translation_unified_form_enable'] = array(
    '#title' => t('Place all entity-translatable fields for all enabled languages inline on the node add/edit form'),
    '#type' => 'checkbox',
    '#default_value' => variable_get('entity_translation_unified_form_enable_' . $type, FALSE),
    '#disabled' => FALSE,
    '#states' => $states,
  );
  return $form;
}