You are here

function term_merge_merge_form in Term Merge 6

Same name and namespace in other branches
  1. 5 term_merge.module \term_merge_merge_form()

Presents the form to select which node to merge into.

1 string reference to 'term_merge_merge_form'
term_merge_merge in ./term_merge.module

File

./term_merge.module, line 53

Code

function term_merge_merge_form(&$form_state, $tid) {

  //$form[] = array('#value' => $tid);
  $from_term = taxonomy_get_term($tid);
  $from_name = check_plain($from_term->name);
  $term = taxonomy_get_term($tid);
  $form['from_tid'] = array(
    '#type' => 'value',
    '#value' => $tid,
  );
  $form['to_tid'] = _taxonomy_term_select(t("Merge all '{$from_name}' items into"), 'to_tid', -1, $term->vid, '', FALSE, NULL, array(
    $tid,
  ));
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Merge'),
  );
  $form['info'] = array(
    '#value' => "<p>As a result of this operation, '{$from_name}' will be deleted and all the nodes tagged with '{$from_name}' will now be tagged with the selection in the box above. In addition '{$from_name}' will be listed as a synonym for the selected node.</p><p>Note that this operation is not reversible!</p>",
  );
  return $form;
}