You are here

function recipe_enable in Recipe 6

Implementation of hook_enable(). Remember last used recipe vocabs.

File

./recipe.install, line 200
Install, update and uninstall functions for the recipe module.

Code

function recipe_enable() {
  $vocab_ids = variable_get('recipe_last_vocab_ids', FALSE);
  if ($vocab_ids) {
    foreach ($vocab_ids as $vid) {
      if ($vocabulary = taxonomy_vocabulary_load($vid)) {

        // Existing install. Add back recipe node type, if the recipe
        // vocabulary still exists. Keep all other node types intact there.
        $vocabulary = (array) $vocabulary;
        $vocabulary['nodes']['recipe'] = 1;
        taxonomy_save_vocabulary($vocabulary);
      }
    }
  }
}