You are here

function _faq_ask_delete_vocabulary in FAQ_Ask 7

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

Helper function to delete a vocabulary.

Parameters

object $vocabulary: the taxonomy vocabulary about to be deleted

@return: none.

2 calls to _faq_ask_delete_vocabulary()
faq_ask_taxonomy_vocabulary_delete in ./faq_ask.module
Implementation of hook_taxonomy_vocabulary_delete()
faq_ask_taxonomy_vocabulary_update in ./faq_ask.module
Implementation of hook_taxonomy_vocabulary_update()

File

./faq_ask.module, line 1888
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($vocabulary) {
  global $user;
  $name = check_plain($vocabulary->name);
  $uname = $user->name;
  drupal_set_message(t("Vocabulary '@name' is being removed from the Faq_Ask list.", array(
    '@name' => $name,
  )), 'status');
  watchdog('Faq_Ask', 'Vocabulary @voc was deleted from Faq_Ask by @name.', array(
    '@voc' => $name,
    '@name' => $uname,
  ), WATCHDOG - NOTICE);
  $my_vocs = variable_get('faq_ask_vocabularies', array());
  unset($my_vocs[$vocabulary->vid]);
  variable_set('faq_ask_vocabularies', $my_vocs);
}