diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-06-04 07:22:23 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-06-04 07:22:23 +0000 |
commit | 1fe90cba4f4015846021d0074d3335ba05fea393 (patch) | |
tree | b7347ec95002ed10a0b6d667e2b93f2d9621493d /modules/forum | |
parent | 712c5758ff9685d9d8a07cbbe91aa814ca32f0a9 (diff) | |
download | brdo-1fe90cba4f4015846021d0074d3335ba05fea393.tar.gz brdo-1fe90cba4f4015846021d0074d3335ba05fea393.tar.bz2 |
- Patch #146667 by Eaton: correct builder argument ordering, eliminate redundant arguments
Diffstat (limited to 'modules/forum')
-rw-r--r-- | modules/forum/forum.module | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 3183480be..461d6e545 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -412,7 +412,7 @@ function forum_update($node) { /** * Implementation of hook_form(). */ -function forum_form(&$node) { +function forum_form(&$node, $form_state) { $type = node_get_types('type', $node); $form['title'] = array('#type' => 'textfield', '#title' => check_plain($type->title_label), '#default_value' => !empty($node->title) ? $node->title : '', '#required' => TRUE, '#weight' => -5); @@ -461,7 +461,7 @@ function forum_delete(&$node) { * * @param $edit Associative array containing a container term to be added or edited. */ -function forum_form_container($edit = array()) { +function forum_form_container(&$form_state, $edit = array()) { $edit += array( 'name' => '', 'description' => '', @@ -528,7 +528,7 @@ function forum_form_main($type, $edit = array()) { * * @param $edit Associative array containing a forum term to be added or edited. */ -function forum_form_forum($edit = array()) { +function forum_form_forum(&$form_state, $edit = array()) { $edit += array( 'name' => '', 'description' => '', @@ -571,7 +571,7 @@ function forum_form_forum($edit = array()) { /** * Process forum form and container form submissions. */ -function forum_form_submit($form, &$form_state, $form_values) { +function forum_form_submit($form, &$form_state) { if ($form['form_id']['#value'] == 'forum_form_container') { $container = TRUE; $type = t('forum container'); @@ -581,18 +581,18 @@ function forum_form_submit($form, &$form_state, $form_values) { $type = t('forum'); } - $status = taxonomy_save_term($form_values); + $status = taxonomy_save_term($form_state['values']); switch ($status) { case SAVED_NEW: if ($container) { $containers = variable_get('forum_containers', array()); - $containers[] = $form_values['tid']; + $containers[] = $form_state['values']['tid']; variable_set('forum_containers', $containers); } - drupal_set_message(t('Created new @type %term.', array('%term' => $form_values['name'], '@type' => $type))); + 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_values['name'], '@type' => $type))); + 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'; @@ -616,10 +616,10 @@ function forum_confirm_delete($tid) { /** * Implementation of forms api _submit call. Deletes a forum after confirmation. */ -function forum_confirm_delete_submit($form, &$form_state, $form_values) { - taxonomy_del_term($form_values['tid']); - drupal_set_message(t('The forum %term and all sub-forums and associated posts have been deleted.', array('%term' => $form_values['name']))); - watchdog('content', 'forum: deleted %term and all its sub-forums and associated posts.', array('%term' => $form_values['name'])); +function forum_confirm_delete_submit($form, &$form_state) { + taxonomy_del_term($form_state['values']['tid']); + drupal_set_message(t('The forum %term and all sub-forums and associated posts have been deleted.', array('%term' => $form_state['values']['name']))); + watchdog('content', 'forum: deleted %term and all its sub-forums and associated posts.', array('%term' => $form_state['values']['name'])); $form_state['redirect'] = 'admin/content/forum'; return; @@ -1185,5 +1185,3 @@ function _forum_get_topic_order_sql($sortby) { $order = _forum_get_topic_order($sortby); return $order['field'] .' '. $order['sort']; } - - |