forum_enable
- Versions
- 6 – 7
forum_enable()
Code
modules/forum/forum.install, line 13
<?php
function forum_enable() {
if ($vocabulary = taxonomy_vocabulary_load(variable_get('forum_nav_vocabulary', 0))) {
// Existing install. Add back forum node type, if the forums
// vocabulary still exists. Keep all other node types intact there.
$vocabulary = (array) $vocabulary;
$vocabulary['nodes']['forum'] = 1;
taxonomy_save_vocabulary($vocabulary);
}
else {
// 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.
$vocabulary = array(
'name' => t('Forums'),
'multiple' => 0,
'required' => 0,
'hierarchy' => 1,
'relations' => 0,
'module' => 'forum',
'weight' => -10,
'nodes' => array('forum' => 1),
);
taxonomy_save_vocabulary($vocabulary);
variable_set('forum_nav_vocabulary', $vocabulary['vid']);
}
}
?>Login or register to post comments 