drupal/modules/forum/forum.install

54 lines
1.2 KiB
Plaintext

<?php
// $Id$
/**
* Implementation of hook_install().
*/
function forum_install() {
// Create the forum vocabulary. Assign the vocabulary a low weight so
// it will appear first in forum topic create and edit forms.
$vocabulary = array(
'name' => t('Forums'),
'multiple' => 0,
'required' => 1,
'hierarchy' => 1,
'relations' => 0,
'module' => 'forum',
'weight' => -10,
'nodes' => array('forum' => 1),
);
taxonomy_save_vocabulary($vocabulary);
variable_set('forum_nav_vocabulary', $vocabulary['vid']);
}
/**
* Remove forum table; forums now use the general term_node table to support multiple
* node types.
*/
function forum_update_6001() {
$ret = array();
$ret[] = update_sql("DROP TABLE {forum}");
return $ret;
}
/**
* Implementation of hook_uninstall().
*/
function forum_uninstall() {
$vid = variable_get('forum_nav_vocabulary', '');
// Delete the vocabulary.
taxonomy_del_vocabulary($vid);
db_query("DELETE FROM {node} WHERE type = 'forum'");
variable_del('forum_containers');
variable_del('forum_nav_vocabulary');
variable_del('forum_hot_topic');
variable_del('forum_per_page');
variable_del('forum_order');
variable_del('forum_block_num_0');
variable_del('forum_block_num_1');
}