You are here

function taxonomy_edge_form_taxonomy_overview_vocabularies_alter in Taxonomy Edge 7.2

Same name and namespace in other branches
  1. 8 taxonomy_edge.module \taxonomy_edge_form_taxonomy_overview_vocabularies_alter()
  2. 6 taxonomy_edge.module \taxonomy_edge_form_taxonomy_overview_vocabularies_alter()
  3. 7 taxonomy_edge.module \taxonomy_edge_form_taxonomy_overview_vocabularies_alter()

Hook into the overview of vocabularies to provide rebuild actions.

File

./taxonomy_edge.module, line 221
Selecting all children of a given taxonomy term can be a pain. This module makes it easier to do this, by maintaining a complete list of edges for each term using the adjecency matrix graph theory.

Code

function taxonomy_edge_form_taxonomy_overview_vocabularies_alter(&$form, &$form_state) {
  if (user_access('administer taxonomy edge')) {
    foreach (taxonomy_get_vocabularies() as $vocabulary) {
      $form[$vocabulary->vid]['rebuild_edges'] = array(
        '#type' => 'link',
        '#title' => t('rebuild edges'),
        '#href' => "admin/structure/taxonomy/{$vocabulary->machine_name}/rebuild/edges",
      );
      $form[$vocabulary->vid]['rebuild_order'] = array(
        '#type' => 'link',
        '#title' => t('rebuild order'),
        '#href' => "admin/structure/taxonomy/{$vocabulary->machine_name}/rebuild/order",
      );
    }
    $form['#theme'] = 'taxonomy_edge_overview_vocabularies';
  }
}