Implements hook_form_BASE_FORM_ID_alter().
function forum_form_taxonomy_vocabulary_form_alter(&$form, &$form_state, $form_id) {
$vid = config('forum.settings')
->get('vocabulary');
$vocabulary = $form_state['controller']
->getEntity();
if ($vid == $vocabulary
->id()) {
$form['help_forum_vocab'] = array(
'#markup' => t('This is the designated forum vocabulary. Some of the normal vocabulary options have been removed.'),
'#weight' => -1,
);
// Forum's vocabulary always has single hierarchy. Forums and containers
// have only one parent or no parent for root items. By default this value
// is 0.
$form['hierarchy']['#value'] = TAXONOMY_HIERARCHY_SINGLE;
// Do not allow to delete forum's vocabulary.
$form['actions']['delete']['#access'] = FALSE;
// Do not allow to change a vid of forum's vocabulary.
$form['vid']['#disabled'] = TRUE;
}
}