From 2ca360a4565ec5ea96252246a907459d499255d5 Mon Sep 17 00:00:00 2001 From: "Paul W. Frields" Date: Sat, 10 Jul 2010 15:38:01 -0400 Subject: Use hook_form_alter() to insert FAS setting in Edit role page --- authfas.module | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'authfas.module') 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; } -- cgit