function forum_form_forum in Drupal 6
Same name and namespace in other branches
- 4 modules/forum.module \forum_form_forum()
- 5 modules/forum/forum.module \forum_form_forum()
- 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.:
See also
Related topics
1 string reference to 'forum_form_forum'
- forum_form_main in modules/
forum/ forum.admin.inc - @file Administrative page callbacks for the forum module.
File
- modules/
forum/ forum.admin.inc, line 29 - Administrative page callbacks for the forum module.
Code
function forum_form_forum(&$form_state, $edit = array()) {
$edit += array(
'name' => '',
'description' => '',
'tid' => NULL,
'weight' => 0,
);
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Forum name'),
'#default_value' => $edit['name'],
'#maxlength' => 255,
'#description' => t('Short but meaningful name for this collection of threaded discussions.'),
'#required' => TRUE,
);
$form['description'] = array(
'#type' => 'textarea',
'#title' => t('Description'),
'#default_value' => $edit['description'],
'#description' => t('Description and guidelines for discussions within this forum.'),
);
$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('Forums are displayed in ascending order by weight (forums with equal weights are displayed alphabetically).'),
);
$form['vid'] = array(
'#type' => 'hidden',
'#value' => variable_get('forum_nav_vocabulary', ''),
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
);
if ($edit['tid']) {
$form['delete'] = array(
'#type' => 'submit',
'#value' => t('Delete'),
);
$form['tid'] = array(
'#type' => 'hidden',
'#value' => $edit['tid'],
);
}
$form['#submit'][] = 'forum_form_submit';
$form['#theme'] = 'forum_form';
return $form;
}