From 531b45d045cd1468a37ebf1de4d39352e51360b9 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 5 Sep 2007 08:27:57 +0000 Subject: - Patch #172643 by chx and fresco: fixed the leave shadow copy functionality. --- modules/forum/forum.install | 47 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'modules/forum/forum.install') diff --git a/modules/forum/forum.install b/modules/forum/forum.install index b63ea4c44..d17b9ba12 100644 --- a/modules/forum/forum.install +++ b/modules/forum/forum.install @@ -5,33 +5,31 @@ * 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']); + // Create tables. + drupal_install_schema('forum'); } -/** - * 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}"); +function forum_enable() { + // Create the forum vocabulary if it does not exist. Assign the vocabulary + // a low weight so it will appear first in forum topic create and edit + // forms. + $vid = variable_get('forum_nav_vocabulary', 0); + $vocabularies = taxonomy_get_vocabularies(); + if (!isset($vocabularies[$vid])) { + $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); - return $ret; + variable_set('forum_nav_vocabulary', $vocabulary['vid']); + } } /** @@ -43,6 +41,7 @@ function forum_uninstall() { taxonomy_del_vocabulary($vid); db_query("DELETE FROM {node} WHERE type = 'forum'"); + db_query('DROP TABLE {forum}'); variable_del('forum_containers'); variable_del('forum_nav_vocabulary'); variable_del('forum_hot_topic'); -- cgit v1.2.3