You are here

function taxonomy_edge_rebuild_page_confirm in Taxonomy Edge 7

Same name and namespace in other branches
  1. 8 taxonomy_edge.admin.inc \taxonomy_edge_rebuild_page_confirm()
  2. 6 taxonomy_edge.admin.inc \taxonomy_edge_rebuild_page_confirm()
  3. 7.2 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 92
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_may_be_available('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');
}