You are here

function entity_translation_unified_form_form_node_type_form_submit in Entity Translation Unified Form 8

Same name and namespace in other branches
  1. 7 entity_translation_unified_form.module \entity_translation_unified_form_form_node_type_form_submit()

Submit handler. Sets content type-specific variable that is used to determine whether or not the content type may used unified forms.

1 string reference to 'entity_translation_unified_form_form_node_type_form_submit'
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 154

Code

function entity_translation_unified_form_form_node_type_form_submit(&$form, FormStateInterface $form_state) {
  $entity_type_id = 'node';
  $bundle = $form_state
    ->getValues()['type'];
  $enabled = $form_state
    ->getValues()['entity_translation_unified_form_enable'];
  entity_translation_unified_form_set_bundle_enabled($entity_type_id, $bundle, $enabled);
  $enabled = $form_state
    ->getValues()['entity_translation_unified_form_sbs_enable'];
  entity_translation_unified_form_set_sbs_enabled($entity_type_id, $bundle, $enabled);
  $enabled = $form_state
    ->getValues()['entity_translation_unified_form_moderation_sync_disable'];
  entity_translation_unified_form_set_moderation_sync_disabled($entity_type_id, $bundle, $enabled);
  $enabled = $form_state
    ->getValues()['entity_translation_unified_form_translate_labels'];
  entity_translation_unified_form_set_translate_labels_enabled($entity_type_id, $bundle, $enabled);
}