From 18b8361a7e323b5e28fbd9bb21d31ea6a5a83fea Mon Sep 17 00:00:00 2001 From: "Paul W. Frields" Date: Sat, 10 Jul 2010 16:22:43 -0400 Subject: User hook_form_FORM_ID_alter() and different commenting --- authfas.module | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/authfas.module b/authfas.module index f11e8da..82e5f9f 100644 --- a/authfas.module +++ b/authfas.module @@ -49,7 +49,7 @@ function authfas_block($op = 'list', $delta = 0, $edit = array()) { */ function authfas_admin() { $form = array(); - + $form['authfas_fasurl'] = array( '#type' => 'textfield', '#title' => t('Location of FAS instance'), @@ -107,26 +107,22 @@ function authfas_menu() { return TRUE; } -function authfas_form_alter(&$form, $form_state, $form_id) { +function authfas_form_user_admin_role_alter(&$form, $form_state) { $newform = array(); - if ($form_id == "user_admin_role") { - /** - * I'm obviously not very good at PHP because I couldn't figure - * out a more clever way to insert this field into an existing - * $form array. - */ - while (list($key, $val) = each($form)) { - if ($key == 'submit') { - $newform['fasgroup'] = array( - '#type' => 'textfield', - '#title' => 'FAS group mapping', - '#description' => 'Enter the name for a FAS group that maps to this role.', - '#size' => 30, - '#maxlength' => 255, - ); - } - $newform[$key] = $val; + // I'm obviously not very good at PHP because I couldn't figure + // out a more clever way to insert this field into an existing + // $form array. + while (list($key, $val) = each($form)) { + if ($key == 'submit') { + $newform['fasgroup'] = array( + '#type' => 'textfield', + '#title' => 'FAS group mapping', + '#description' => 'Enter the name for a FAS group that maps to this role.', + '#size' => 30, + '#maxlength' => 255, + ); } + $newform[$key] = $val; } $form = $newform; } -- cgit