You are here

function taxonomy_edge_rebuild_page_confirm in Taxonomy Edge 8

Same name and namespace in other branches
  1. 6 taxonomy_edge.admin.inc \taxonomy_edge_rebuild_page_confirm()
  2. 7.2 taxonomy_edge.admin.inc \taxonomy_edge_rebuild_page_confirm()
  3. 7 taxonomy_edge.admin.inc \taxonomy_edge_rebuild_page_confirm()

Confirmation for rebuilding trees

1 string reference to 'taxonomy_edge_rebuild_page_confirm'
taxonomy_edge_menu in ./taxonomy_edge.module
Implements hook_menu().

File

./taxonomy_edge.admin.inc, line 63
Pages for taxonomy edge settings and more.

Code

function taxonomy_edge_rebuild_page_confirm($form, &$form_state, $type, $vocabulary) {
  $form = array();
  if (!empty($vocabulary)) {
    $vocabulary = taxonomy_vocabulary_machine_name_load($vocabulary);
    if (!lock()
      ->lockMayBeAvailable('taxonomy_edge_rebuild_' . $type . '_' . $vocabulary->vid)) {
      drupal_set_message(t('Rebuild already in progress'), 'warning');
      drupal_goto();
    }
    $form['vocabulary'] = array(
      '#type' => 'value',
      '#value' => $vocabulary,
    );
    $msg = t('Are you sure you want to rebuild %type for vocabulary %name?', array(
      '%type' => $type,
      '%name' => $vocabulary->name,
    ));
  }
  else {
    $msg = t('Are you sure you want to rebuild %type for all vocabularies?', array(
      '%type' => $type,
    ));
  }
  $form['type'] = array(
    '#type' => 'value',
    '#value' => $type,
  );
  return confirm_form($form, $msg, 'admin/structure/taxonomy');
}