You are here

function og_vocab_taxonomy in OG Vocabulary 5

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

File

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

Code

function og_vocab_taxonomy($op, $type, $edit = NULL) {
  if ($type == 'vocabulary') {
    switch ($op) {
      case 'update':
        if ($edit['og']) {
          $sql = "UPDATE {og_vocab} SET nid=%d WHERE vid=%d";
          db_query($sql, $edit['og'], $edit['vid']);
        }
        break;
      case 'insert':
        if ($edit['og']) {
          $sql = "INSERT {og_vocab} (nid, vid) VALUES (%d, %d)";
          db_query($sql, $edit['og'], $edit['vid']);
        }
        break;
      case 'delete':
        $sql = "DELETE FROM {og_vocab} WHERE vid = %d";
        db_query($sql, $edit['vid']);
    }
  }
}