In Drupal 6 we have some constructions which are very helpful. You want to modify sth after node has been submited? No problem you can easly do it by using hooks. In some module create some functions which will called:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
function my_module_form_alter(&$form, $form_state, $form_id) { if($form_id == 'name_of_your_form') { $form['#after_build'][] = '_my_module_after_build'; } } function _my_module_after_build(&$form, $form_state) { // here you should add that piece of code // $form['#redirect'] = 'your-page-after-submit'; $form['#submit'][] = 'my_module_action_after_submit'; } function my_module_action_after_submit($form, &$form_state) { // and here you have all you want, you can modify $form_state variable // to change status or other variables in node // $form_state['values']['status'] = false; return $form_state; } |
And that’s all you should know about it. Now you can simply modify whatever you want to modify.
See you!
Leave a Reply