function forum_form_submit in Drupal 6
Same name and namespace in other branches
- 4 modules/forum.module \forum_form_submit()
- 5 modules/forum/forum.module \forum_form_submit()
- 7 modules/forum/forum.admin.inc \forum_form_submit()
Process forum form and container form submissions.
2 string references to 'forum_form_submit'
- forum_form_container in modules/
forum/ forum.admin.inc - Returns a form for adding a container to the forum vocabulary
- forum_form_forum in modules/
forum/ forum.admin.inc - Returns a form for adding a forum to the forum vocabulary
File
- modules/
forum/ forum.admin.inc, line 71 - Administrative page callbacks for the forum module.
Code
function forum_form_submit($form, &$form_state) {
if ($form['form_id']['#value'] == 'forum_form_container') {
$container = TRUE;
$type = t('forum container');
}
else {
$container = FALSE;
$type = t('forum');
}
$status = taxonomy_save_term($form_state['values']);
switch ($status) {
case SAVED_NEW:
if ($container) {
$containers = variable_get('forum_containers', array());
$containers[] = $form_state['values']['tid'];
variable_set('forum_containers', $containers);
}
drupal_set_message(t('Created new @type %term.', array(
'%term' => $form_state['values']['name'],
'@type' => $type,
)));
break;
case SAVED_UPDATED:
drupal_set_message(t('The @type %term has been updated.', array(
'%term' => $form_state['values']['name'],
'@type' => $type,
)));
break;
}
$form_state['redirect'] = 'admin/content/forum';
return;
}