View source
<?php
function hashtags_enable() {
if (!variable_get('hashtags_vocabulary', 0)) {
$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']);
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');
}
}
function hashtags_uninstall() {
drupal_load('module', 'taxonomy');
$vid = variable_get('hashtags_vocabulary', '');
taxonomy_del_vocabulary($vid);
variable_del('hashtags_vocabulary');
$module = 'hashtags';
db_query("DELETE FROM {filters} WHERE module = '%s'", $module);
drupal_set_message(t('Hashtags module: Hashtags filter has been removed from all input format'));
}
function hashtags_update_6001() {
$ret = array();
hashtags_add_filter();
$ret[] = array(
'success' => TRUE,
'query' => 'Hashtags filter has been added to system input formats.',
);
return $ret;
}