You are here

function forum_form_forum in Drupal 5

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

Returns a form for adding a forum to the forum vocabulary

Parameters

$edit Associative array containing a forum term to be added or edited.:

1 string reference to 'forum_form_forum'
forum_form_main in modules/forum/forum.module

File

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

Code

function forum_form_forum($edit = array()) {
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Forum name'),
    '#default_value' => $edit['name'],
    '#maxlength' => 64,
    '#description' => t('The forum name is used to identify related discussions.'),
    '#required' => TRUE,
  );
  $form['description'] = array(
    '#type' => 'textarea',
    '#title' => t('Description'),
    '#default_value' => $edit['description'],
    '#description' => t('The forum description can give users more information about the discussion topics it contains.'),
  );
  $form['parent']['#tree'] = TRUE;
  $form['parent'][0] = _forum_parent_select($edit['tid'], t('Parent'), 'forum');
  $form['weight'] = array(
    '#type' => 'weight',
    '#title' => t('Weight'),
    '#default_value' => $edit['weight'],
    '#description' => t('When listing forums, those with lighter (smaller) weights get listed before containers with heavier (larger) weights. Forums with equal weights are sorted alphabetically.'),
  );
  $form['vid'] = array(
    '#type' => 'hidden',
    '#value' => _forum_get_vid(),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  if ($edit['tid']) {
    $form['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
    );
    $form['tid'] = array(
      '#type' => 'hidden',
      '#value' => $edit['tid'],
    );
  }
  $form['#base'] = 'forum_form';
  return $form;
}