From ac65ff9074223e7b09c1c609c9d82da45b28aa55 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 14 May 2007 13:43:38 +0000 Subject: - Patch #138706 by eaton, chx, webchick, yched et al: form api 3 ... yay. :) --- modules/path/path.module | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'modules/path/path.module') diff --git a/modules/path/path.module b/modules/path/path.module index 0312c941e..d6beffcf1 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -105,10 +105,11 @@ function path_admin_delete_confirm($pid) { /** * Execute URL alias deletion **/ -function path_admin_delete_confirm_submit($form_id, $form_values) { +function path_admin_delete_confirm_submit($form_values, $form, &$form_state) { if ($form_values['confirm']) { path_admin_delete($form_values['pid']); - return 'admin/build/path'; + $form_state['redirect'] = 'admin/build/path'; + return; } } @@ -178,8 +179,8 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL, $language = '' * Return a form for editing or creating an individual URL alias. */ function path_form($edit = array('src' => '', 'dst' => '', 'language' => '', 'pid' => NULL)) { - $form['#submit']['path_form_submit'] = array(); - $form['#validate']['path_form_validate'] = array(); + $form['#submit'][] = 'path_form_submit'; + $form['#validate'][] = 'path_form_validate'; $form['#alias'] = $edit; $form['src'] = array( @@ -369,7 +370,7 @@ function path_load($pid) { /** * Verify that a new URL alias is valid */ -function path_form_validate($form_id, $form_values) { +function path_form_validate($form_values, $form, &$form_state) { $src = $form_values['src']; $dst = $form_values['dst']; $pid = isset($form_values['pid']) ? $form_values['pid'] : 0; @@ -384,12 +385,13 @@ function path_form_validate($form_id, $form_values) { /** * Save a new URL alias to the database. */ -function path_form_submit($form_id, $form_values) { +function path_form_submit($form_values, $form, &$form_state) { // Language is only set if locale module is enabled path_set_alias($form_values['src'], $form_values['dst'], isset($form_values['pid']) ? $form_values['pid'] : 0, isset($form_values['language']) ? $form_values['language'] : ''); drupal_set_message(t('The alias has been saved.')); - return 'admin/build/path'; + $form_state['redirect'] = 'admin/build/path'; + return; } /** -- cgit v1.2.3