You are here

function og_vocab_taxonomy in OG Vocabulary 6

Same name and namespace in other branches
  1. 5 og_vocab.module \og_vocab_taxonomy()

Implementation of hook_taxonomy().

File

./og_vocab.module, line 369
Give each group its own system controlled vocabularies.

Code

function og_vocab_taxonomy($op, $type, $edit = NULL) {
  if ($type == 'vocabulary') {
    if ($op == 'update' || $op == 'insert') {
      if (isset($edit['og'])) {
        if ($edit['og']) {
          og_vocab_write_record($edit['og'], $edit['vid']);
        }
        else {

          // Delete an existing associationm, since 'og' == 0.
          og_vocab_remove_record($edit['vid']);
        }
      }
    }
    elseif ($op == 'delete') {
      og_vocab_remove_record($edit['vid']);
    }
  }
}