forum_taxonomy

  1. drupal
    1. 4.7
    2. 5 forum.module
    3. 6 forum.module
Versions
4.7 – 6 forum_taxonomy($op, $type, $term = NULL)

Implementation of hook_taxonomy().

Code

modules/forum.module, line 151

<?php
function forum_taxonomy($op, $type, $term = NULL) {
  if ($op == 'delete' && $term['vid'] == _forum_get_vid()) {
    switch ($type) {
      case 'term':
        $results = db_query('SELECT f.nid FROM {forum} f WHERE f.tid = %d', $term['tid']);
        while ($node = db_fetch_object($results)) {
          // node_delete will also remove any association with non-forum vocabularies.
          node_delete($node->nid);
        }

        // For containers, remove the tid from the forum_containers variable.
        $containers = variable_get('forum_containers', array());
        $key = array_search($term['tid'], $containers);
        if ($key !== FALSE) {
          unset($containers[$key]);
        }
        variable_set('forum_containers', $containers);
        break;
      case 'vocabulary':
        variable_del('forum_nav_vocabulary');
    }
  }
}
?>