You are here

function forum_form in Drupal 5

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

Implementation of hook_form().

2 string references to 'forum_form'
forum_form_container in modules/forum/forum.module
Returns a form for adding a container to the forum vocabulary
forum_form_forum in modules/forum/forum.module
Returns a form for adding a forum to the forum vocabulary

File

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

Code

function forum_form(&$node) {
  $type = node_get_types('type', $node);
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => check_plain($type->title_label),
    '#default_value' => $node->title,
    '#required' => TRUE,
    '#weight' => -5,
  );
  if ($node->nid) {
    $forum_terms = taxonomy_node_get_terms_by_vocabulary($node->nid, _forum_get_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_filter']['body'] = array(
    '#type' => 'textarea',
    '#title' => check_plain($type->body_label),
    '#default_value' => $node->body,
    '#rows' => 20,
    '#required' => TRUE,
  );
  $form['body_filter']['format'] = filter_form($node->format);
  return $form;
}