Same name and namespace in other branches
  1. 4.7.x modules/forum.module \forum_form()
  2. 5.x modules/forum/forum.module \forum_form()
  3. 6.x modules/forum/forum.module \forum_form()
  4. 7.x modules/forum/forum.module \forum_form()

Implementation of hook_form().

File

modules/forum.module, line 522
Enable threaded discussions about general topics.

Code

function forum_form(&$node) {
  if (!$node->nid) {

    // new topic
    $node->taxonomy[] = arg(3);
  }
  else {
    $node->taxonomy = array(
      $node->tid,
    );
  }
  $output = implode('', taxonomy_node_form('forum', $node));
  if ($node->nid) {

    // if editing, give option to leave shadows
    $shadow = count(taxonomy_node_get_terms($node->nid)) > 1;
    $output .= form_checkbox(t('Leave shadow copy'), 'shadow', 1, $shadow, t('If you move this topic, you can leave a link in the old forum to the new forum.'));
  }
  $output .= form_textarea(t('Body'), 'body', $node->body, 60, 20, '');
  $output .= filter_form('format', $node->format);
  return $output;
}