summaryrefslogtreecommitdiff
path: root/modules/forum/forum.install
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-07-02 17:08:36 +0000
committerDries Buytaert <dries@buytaert.net>2007-07-02 17:08:36 +0000
commitb6c069ad7d8bbc53a4e10b8a6c71326cab7f284c (patch)
tree79ec2a02a65af67d180a9c8db65d75725350e423 /modules/forum/forum.install
parent5644ad02641b008016a03aedce5101dd47107341 (diff)
downloadbrdo-b6c069ad7d8bbc53a4e10b8a6c71326cab7f284c.tar.gz
brdo-b6c069ad7d8bbc53a4e10b8a6c71326cab7f284c.tar.bz2
- Patch #20295 by pyromanfo, webchick, Gurpartap Singh et al: allow forum topics to be custom node types.
Diffstat (limited to 'modules/forum/forum.install')
-rw-r--r--modules/forum/forum.install34
1 files changed, 30 insertions, 4 deletions
diff --git a/modules/forum/forum.install b/modules/forum/forum.install
index 1c8d17b74..b63ea4c44 100644
--- a/modules/forum/forum.install
+++ b/modules/forum/forum.install
@@ -5,16 +5,42 @@
* Implementation of hook_install().
*/
function forum_install() {
- // Create tables.
- drupal_install_schema('forum');
+ // 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() {
- // Remove tables.
- drupal_uninstall_schema('forum');
+ $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');