You are here

function lingotek_entity_disassociate_form in Lingotek Translation 7.5

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

Form constructor for the entity disassociate form. (Formerly "Reset Translations")

1 string reference to 'lingotek_entity_disassociate_form'
lingotek_disassociate_nodes in ./lingotek.bulk_grid.inc
Callback function to disassociate translations for multiple nodes at a time

File

./lingotek.bulk_grid.inc, line 1692
Bulk Grid form

Code

function lingotek_entity_disassociate_form($form, $form_state, $entity_ids = array(), $collapse_fieldset = TRUE) {
  if (isset($form_state['entity_ids']) && empty($entity_ids)) {
    $entity_ids = $form_state['entity_ids'];
    $collapse_fieldset = FALSE;
  }
  $form = array();
  if (!is_array($entity_ids)) {
    $entity_ids = array(
      $entity_ids,
    );
  }
  $form['disassociate_translations'] = array(
    '#type' => 'fieldset',
    '#prefix' => format_plural(count($entity_ids), '', '<div class="messages warning">' . t('This action will apply to @count entities.') . '</div>'),
    '#title' => t('Disassociate Translations'),
    '#description' => t("Disassociates the entity translations on Lingotek's servers from the copies downloaded to Drupal. Additional translation using Lingotek will require re-uploading the entity to restart the translation process."),
    '#suffix' => '<i>' . t("Note: This action should only be used to change the Lingotek project or TM vault associated with the entities.") . '<i>',
    '#collapsible' => $collapse_fieldset,
    '#collapsed' => $collapse_fieldset,
  );
  $form['disassociate_translations']['confirm'] = array(
    '#type' => 'checkbox',
    '#title' => t('Also remove all document(s) from Lingotek TMS'),
    '#default_value' => FALSE,
  );
  $form['disassociate_translations']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Disassociate Translations'),
  );
  $form['entity_ids'] = array(
    '#type' => 'hidden',
    '#value' => json_encode($entity_ids),
  );
  return $form;
}