Index: core.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/docs/developer/hooks/core.php,v
retrieving revision 1.168.2.21
diff -u -p -r1.168.2.21 core.php
--- core.php	8 Jul 2008 22:13:57 -0000	1.168.2.21
+++ core.php	8 Jul 2008 22:28:10 -0000
@@ -1959,149 +1959,6 @@ function hook_term_path($term) {
 }
 
 /**
- * Create a hierarchical representation of a vocabulary.
- *
- * The most common supplier of this function is taxonomy.module. That is the example
- * given below.
- *
- * @see taxonomy_get_tree()
- * @see blogapi_metaweblog_get_category_list()
- *
- * @param $vid
- *   Which vocabulary to generate the tree for.
- *
- * @param $parent
- *   The term ID under which to generate the tree. If 0, generate the tree
- *   for the entire vocabulary.
- *
- * @param $depth
- *   Internal use only.
- *
- * @param $max_depth
- *   The number of levels of the tree to return. Leave NULL to return all levels.
- *
- * @return
- *   An array of all term objects in the tree. Each term object is extended
- *   to have "depth" and "parents" attributes in addition to its normal ones.
- *   Results are statically cached.
- */
-function hook_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL) {
-  static $children, $parents, $terms;
-
-  $depth++;
-
-  // We cache trees, so it's not CPU-intensive to call get_tree() on a term
-  // and its children, too.
-  if (!isset($children[$vid])) {
-    $children[$vid] = array();
-
-    $result = db_query(db_rewrite_sql('SELECT t.tid, t.*, parent FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d ORDER BY weight, name', 't', 'tid'), $vid);
-    while ($term = db_fetch_object($result)) {
-      $children[$vid][$term->parent][] = $term->tid;
-      $parents[$vid][$term->tid][] = $term->parent;
-      $terms[$vid][$term->tid] = $term;
-    }
-  }
-
-  $max_depth = (is_null($max_depth)) ? count($children[$vid]) : $max_depth;
-  $tree = array();
-  if (!empty($children[$vid][$parent])) {
-    foreach ($children[$vid][$parent] as $child) {
-      if ($max_depth > $depth) {
-        $term = drupal_clone($terms[$vid][$child]);
-        $term->depth = $depth;
-        // The "parent" attribute is not useful, as it would show one parent only.
-        unset($term->parent);
-        $term->parents = $parents[$vid][$child];
-        $tree[] = $term;
-
-        if (!empty($children[$vid][$child])) {
-          $tree = array_merge($tree, taxonomy_get_tree($vid, $child, $depth, $max_depth));
-        }
-      }
-    }
-  }
-
-  return $tree;
-}
-
-/**
- * Find all parents of a given term ID.
- *
- * The most common supplier of this function is taxonomy.module. That is the example
- * given below.
- *
- * @see taxonomy_get_parents()
- * @see blogapi_metaweblog_get_category_list()
- *
- * @param $tid
- *   The term id for which to retrieve the parents.
- *
- * @param $key
- *   The column name to use to use for naming array elements.
- *     May be any column name from the term_data table.
- *     Defaults to 'tid'.
- *
- * @return
- *   An array of all parent term objects. Empty array if none.
- */
-function hook_get_parents($tid, $key = 'tid') {
-  if ($tid) {
-    $result = db_query(db_rewrite_sql('SELECT t.tid, t.* FROM {term_data} t INNER JOIN {term_hierarchy} h ON h.parent = t.tid WHERE h.tid = %d ORDER BY weight, name', 't', 'tid'), $tid);
-    $parents = array();
-    while ($parent = db_fetch_object($result)) {
-      $parents[$parent->$key] = $parent;
-    }
-    return $parents;
-  }
-  else {
-    return array();
-  }
-}
-
-/**
- * Return an array of all vocabulary objects.
- *
- * The most common supplier of this function is taxonomy.module. That is the example
- * given below.
- *
- * @see taxonomy_get_vocabularies()
- * @see blogapi_metaweblog_get_category_list()
- *
- * @param $type
- *   If set, return only those vocabularies associated with this node type.
- *
- * @return
- *   An array of all vocabulary objects.
- */
-function hook_get_vocabularies($type = NULL) {
-  if ($type) {
-    $result = db_query(db_rewrite_sql("SELECT v.vid, v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE n.type = '%s' ORDER BY v.weight, v.name", 'v', 'vid'), $type);
-  }
-  else {
-    $result = db_query(db_rewrite_sql('SELECT v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} n ON v.vid = n.vid ORDER BY v.weight, v.name', 'v', 'vid'));
-  }
-
-  $vocabularies = array();
-  $node_types = array();
-  while ($voc = db_fetch_object($result)) {
-    // If no node types are associated with a vocabulary, the LEFT JOIN will
-    // return a NULL value for type.
-    if (isset($voc->type)) {
-      $node_types[$voc->vid][$voc->type] = $voc->type;
-      unset($voc->type);
-      $voc->nodes = $node_types[$voc->vid];
-    }
-    elseif (!isset($voc->nodes)) {
-      $voc->nodes = array();
-    }
-    $vocabularies[$voc->vid] = $voc;
-  }
-
-  return $vocabularies;
-}
-
-/**
  * Allows modules to define their own text groups that can be translated.
  *
  * @param $op
