You are here

function _enable_biblio_keyword_vocabulary in Bibliography Module 6

Same name and namespace in other branches
  1. 7 biblio.install \_enable_biblio_keyword_vocabulary()
  2. 7.2 biblio.install \_enable_biblio_keyword_vocabulary()
1 call to _enable_biblio_keyword_vocabulary()
_add_biblio_keywords in ./biblio.install
Copies keywords from the biblio_keyword column of the biblio table to a taxonomy vocabulary

File

./biblio.install, line 96
Install file for biblio module

Code

function _enable_biblio_keyword_vocabulary() {
  if ($vocabulary = taxonomy_vocabulary_load(variable_get('biblio_keyword_vocabulary', 0))) {

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

  //  else {
  //    // Create the biblio vocabulary if it does not exist.
  //    $vocabulary = array(
  //      'name' => 'Biblio Keywords',
  //      'description' => t('This is a free tag vocabulary which contains the keywords from all nodes created by the biblio module'),
  //      'help' => t('Enter a comma separated list of words. Phrases containing commas should be enclosed in double quotes'),
  //      'nodes' => array('biblio' => 1),
  //      'hierarchy' => 0,
  //      'relations' => 1,
  //      'tags' => 1,
  //      'multiple' => 0,
  //      'required' => 0,
  //      'weight' => 0,
  //      'module' => 'biblio',
  //    );
  //    taxonomy_save_vocabulary($vocabulary);
  //    variable_set('biblio_keyword_vocabulary', $vocabulary['vid']);
  //  }
  return $vocabulary['vid'];
}