diff options
author | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-03-31 06:43:46 +0000 |
---|---|---|
committer | Gerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org> | 2006-03-31 06:43:46 +0000 |
commit | 603a6618ee17ad8d49cc1c4929133644da243f55 (patch) | |
tree | e24d7b1919bb0aa33d9cf8b71ee626f0dea0e3a4 /modules | |
parent | b22d877ff84ad31b17d19090b8480ca2911ccef4 (diff) | |
download | brdo-603a6618ee17ad8d49cc1c4929133644da243f55.tar.gz brdo-603a6618ee17ad8d49cc1c4929133644da243f55.tar.bz2 |
#28625, Forum vocabulary does not handle standard vocabulary features correctly, removed these features by means of formapi, patch by profix898, with some love by dopry and chx
Diffstat (limited to 'modules')
-rw-r--r-- | modules/forum.module | 24 | ||||
-rw-r--r-- | modules/forum/forum.module | 24 |
2 files changed, 48 insertions, 0 deletions
diff --git a/modules/forum.module b/modules/forum.module index 47eb04d3c..267d3e120 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -203,6 +203,30 @@ function forum_admin_configure() { } /** + * Implementation of hook_form_alter(). + */ +function forum_form_alter($form_id, &$form) { + // hide critical options from forum vocabulary + if ($form_id == 'taxonomy_form_vocabulary') { + if ($form['vid']['#value'] == _forum_get_vid()) { + $form['help_forum_vocab'] = array( + '#value' => t('This is the designated forum vocabulary. Some of the normal vocabulary options have been removed.'), + '#weight' => -1, + ); + $form['nodes']['forum'] = array('#type' => 'checkbox', '#value' => 1, '#title' => t('forum topic'), '#attributes' => array('disabled' => '' ), '#description' => t('forum topic is affixed to the forum vocabulary.')); + $form['hierarchy'] = array('#type' => 'value', '#value' => 1); + unset($form['relations']); + unset($form['tags']); + unset($form['multiple']); + $form['required'] = array('#type' => 'value', '#value' => 1); + } + else { + unset($form['nodes']['forum']); + } + } +} + +/** * Implementation of hook_load(). */ function forum_load($node) { diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 47eb04d3c..267d3e120 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -203,6 +203,30 @@ function forum_admin_configure() { } /** + * Implementation of hook_form_alter(). + */ +function forum_form_alter($form_id, &$form) { + // hide critical options from forum vocabulary + if ($form_id == 'taxonomy_form_vocabulary') { + if ($form['vid']['#value'] == _forum_get_vid()) { + $form['help_forum_vocab'] = array( + '#value' => t('This is the designated forum vocabulary. Some of the normal vocabulary options have been removed.'), + '#weight' => -1, + ); + $form['nodes']['forum'] = array('#type' => 'checkbox', '#value' => 1, '#title' => t('forum topic'), '#attributes' => array('disabled' => '' ), '#description' => t('forum topic is affixed to the forum vocabulary.')); + $form['hierarchy'] = array('#type' => 'value', '#value' => 1); + unset($form['relations']); + unset($form['tags']); + unset($form['multiple']); + $form['required'] = array('#type' => 'value', '#value' => 1); + } + else { + unset($form['nodes']['forum']); + } + } +} + +/** * Implementation of hook_load(). */ function forum_load($node) { |