You are here

hashtags.install in Hashtags 6.2

File

hashtags.install
View source
<?php

// $Id$

/**
* hook_enable().
*/
function hashtags_enable() {
  if (!variable_get('hashtags_vocabulary', 0)) {

    // Create hashtags taxonomy
    $vocabulary = array(
      'name' => t('Hashtags'),
      'multiple' => 1,
      'tags' => 1,
      'required' => 0,
      'hierarchy' => 1,
      'relations' => 0,
      'module' => 'hashtags',
      'weight' => -10,
    );
    taxonomy_save_vocabulary($vocabulary);
    variable_set('hashtags_vocabulary', $vocabulary['vid']);
  }
}

/**
*  hook_uninstall().
*/
function hashtags_uninstall() {

  // Load the dependent Taxonomy module, in case it has been disabled.
  drupal_load('module', 'taxonomy');

  // Delete the vocabulary.
  $vid = variable_get('hashtags_vocabulary', '');
  taxonomy_del_vocabulary($vid);
  variable_del('hashtags_vocabulary');
}