You are here

function hashtags_enable in Hashtags 6

Same name and namespace in other branches
  1. 6.2 hashtags.install \hashtags_enable()
  2. 7.2 hashtags.install \hashtags_enable()
  3. 7 hashtags.install \hashtags_enable()

Implementation of hook_enable().

File

./hashtags.install, line 6

Code

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']);

    // add Hashtags filter to system input formats
    hashtags_add_filter();
    drupal_set_message('Hashtags module: go to ' . l(t('hashtags vocabulary'), 'admin/content/taxonomy/edit/vocabulary/' . $vocabulary['vid']) . ', check content types that you want Hashtags to work and submit a form');
  }
}