forum_form

Versions
4.6 – 5
forum_form(&$node)
6
forum_form(&$node, $form_state)
7
forum_form($node, $form_state)

Implementation of hook_form().

Code

modules/forum.module, line 522

<?php
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.