You are here

function taxonomy_edge_init in Taxonomy Edge 6

Implements hook_init().

File

./taxonomy_edge.module, line 50
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_init() {
  if (!empty($_SESSION['taxonomy_edge_rebuild_module_enabled'])) {
    unset($_SESSION['taxonomy_edge_rebuild_module_enabled']);
    module_load_include('rebuild.inc', 'taxonomy_edge');
    $vids = array();
    foreach (taxonomy_get_vocabularies() as $vocabulary) {
      $vids[] = $vocabulary->vid;
    }
    taxonomy_edge_rebuild_all_batch($vids);
    batch_process();
  }
}