You are here

function _faq_ask_delete_vocabulary in FAQ_Ask 6

Same name and namespace in other branches
  1. 6.2 faq_ask.module \_faq_ask_delete_vocabulary()
  2. 7 faq_ask.module \_faq_ask_delete_vocabulary()

Helper function to delete a vocabulary. @param. $vid - the taxonomy vocabulary id. $array - the array provided in hook_taxonomy. $my_vocs - the array of faq_ask vocabularies.

@return: none.

1 call to _faq_ask_delete_vocabulary()
faq_ask_taxonomy in ./faq_ask.module
Implementation of hook_taxonomy(). @param: op: 'insert', 'update, 'delete' type: 'term', 'vocabulary' array: depends on other two.

File

./faq_ask.module, line 962
This module is an add-on to the FAQ module that allows users with the 'ask question' permission to create a question which will be queued for an 'expert' to answer.

Code

function _faq_ask_delete_vocabulary($vid, $array, $my_vocs) {
  global $user;
  $name = check_plain($array['name']);
  $uname = $user->name;
  drupal_set_message("Vocabulary '{$name}' is being removed from the Faq_Ask list.", 'status');
  watchdog('Faq_Ask', 'Vocabulary @voc was deleted from Faq_Ask by @name.', array(
    '@voc' => $name,
    '@name' => $uname,
  ), WATCHDOG - NOTICE);
  unset($my_vocs[$vid]);
  variable_set('faq_ask_vocabularies', $my_vocs);
}