diff options
author | Paul W. Frields <stickster@gmail.com> | 2010-07-10 15:38:01 -0400 |
---|---|---|
committer | Paul W. Frields <stickster@gmail.com> | 2010-07-10 15:38:01 -0400 |
commit | 2ca360a4565ec5ea96252246a907459d499255d5 (patch) | |
tree | d0fede493a04442674eee106960045959674f234 /authfas.module | |
parent | 0624b208cbdc51d17491c0901b8b280a52f0ff71 (diff) | |
download | drupal-authfas-6x-2ca360a4565ec5ea96252246a907459d499255d5.tar.gz drupal-authfas-6x-2ca360a4565ec5ea96252246a907459d499255d5.tar.xz drupal-authfas-6x-2ca360a4565ec5ea96252246a907459d499255d5.zip |
Use hook_form_alter() to insert FAS setting in Edit role page
Diffstat (limited to 'authfas.module')
-rw-r--r-- | authfas.module | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/authfas.module b/authfas.module index 5f9aaf5..bea060a 100644 --- a/authfas.module +++ b/authfas.module @@ -107,8 +107,26 @@ function authfas_menu() { return TRUE; } -function user_admin_role_form_alter(&$form, $form_state, $form_id) { +function authfas_form_alter(&$form, $form_state, $form_id) { + $newform = array(); if ($form_id == "user_admin_role") { - $form['foo'] = array('#title' => t('FOO')); + /** + * 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; } |