You are here

function tmgmt_smartling_form_alter in TMGMT Translator Smartling 8.4

File

./tmgmt_smartling.module, line 978
Contains

Code

function tmgmt_smartling_form_alter(&$form, FormStateInterface $form_state) {
  $forms_to_enable_locked_fields = [
    'node_form',
    'taxonomy_term_form',
  ];
  \Drupal::moduleHandler()
    ->alter('tmgmt_smartling_locked_fields_base_form_id_list', $forms_to_enable_locked_fields);
  $form_build_info = $form_state
    ->getBuildInfo();
  if (isset($form_build_info['base_form_id']) && in_array($form_build_info['base_form_id'], $forms_to_enable_locked_fields)) {
    \Drupal::getContainer()
      ->get('tmgmt_smartling.lock_fields_form_manager')
      ->addLockFieldsListToForm($form, $form_state);
  }
}