You are here

function lingotek_disassociate_all_form_submit in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lingotek.admin.inc \lingotek_disassociate_all_form_submit()
  2. 7.6 lingotek.admin.inc \lingotek_disassociate_all_form_submit()

File

./lingotek.admin.inc, line 1950

Code

function lingotek_disassociate_all_form_submit($form_state, $form) {
  $doc_ids = LingotekSync::getAllLocalDocIds();
  $api = LingotekApi::instance();
  $operations = array();
  $remove_from_tms = $form_state['disassociate_all_translations']['confirm']['#value'];
  if ($remove_from_tms) {

    //disassociate on TMS
    lingotek_batch_disassociate_content_worker($api, $doc_ids);
  }

  //disassociate on CMS
  LingotekSync::disassociateAllEntities();
  LingotekSync::disassociateAllChunks();
  drupal_set_message(t('All local translations have been disassociated from Lingotek.'));
}