diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-09-05 08:27:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-09-05 08:27:57 +0000 |
commit | 531b45d045cd1468a37ebf1de4d39352e51360b9 (patch) | |
tree | 7c012819cd42d7511066b1598363add079a5a3aa /modules/forum/forum.install | |
parent | 2db2c039fb5caabf511c95f15034ec18b39533d4 (diff) | |
download | brdo-531b45d045cd1468a37ebf1de4d39352e51360b9.tar.gz brdo-531b45d045cd1468a37ebf1de4d39352e51360b9.tar.bz2 |
- Patch #172643 by chx and fresco: fixed the leave shadow copy functionality.
Diffstat (limited to 'modules/forum/forum.install')
-rw-r--r-- | modules/forum/forum.install | 47 |
1 files changed, 23 insertions, 24 deletions
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'); |