function forum_form

7.x forum.module forum_form($node, $form_state)
6.x forum.module forum_form(&$node, $form_state)

Implementation of hook_form().

File

drupal-6.x/modules/forum/forum.module, line 450
Enable threaded discussions about general topics.

Code

function forum_form(&$node, $form_state) {
  $type = node_get_types('type', $node);
  $form['title'] = array('#type' => 'textfield', '#title' => check_plain($type->title_label), '#default_value' => !empty($node->title) ? $node->title : '', '#required' => TRUE, '#weight' => -5);

  if (!empty($node->nid)) {
    $vid = variable_get('forum_nav_vocabulary', '');
    $forum_terms = taxonomy_node_get_terms_by_vocabulary($node, $vid);
    // if editing, give option to leave shadows
    $shadow = (count($forum_terms) > 1);
    $form['shadow'] = array('#type' => 'checkbox', '#title' => t('Leave shadow copy'), '#default_value' => $shadow, '#description' => t('If you move this topic, you can leave a link in the old forum to the new forum.'));
  }

  $form['body_field'] = node_body_field($node, $type->body_label, 1);

  $form['#submit'][] = 'forum_submit';
  // Assign the forum topic submit handler.

  return $form;
}