function forum_form

You are here

7 forum.module forum_form($node, $form_state)
4.6 forum.module forum_form(&$node)
4.7 forum.module forum_form(&$node)
5 forum.module forum_form(&$node)
6 forum.module forum_form(&$node, $form_state)

Implements hook_form().

3 string references to 'forum_form'
forum_form_container in modules/forum/forum.admin.inc
Form constructor for adding and editing forum containers.
forum_form_forum in modules/forum/forum.admin.inc
Form constructor for adding and editing a forum.
forum_theme in modules/forum/forum.module
Implements hook_theme().

File

modules/forum/forum.module, line 731
Provides discussion forums.

Code

function forum_form($node, $form_state) {
  $type = node_type_get_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)) {
    $forum_terms = $node->taxonomy_forums;
    // 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['forum_tid'] = array(
      '#type' => 'value',
      '#value' => $node->forum_tid,
    );
  }

  return $form;
}

Comments

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

the code above will get the subject for the create forum topic ,

where to find the code of drop down that contain the forum list.

pls help me