summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2010-07-10 15:38:01 -0400
committerPaul W. Frields <stickster@gmail.com>2010-07-10 15:38:01 -0400
commit2ca360a4565ec5ea96252246a907459d499255d5 (patch)
treed0fede493a04442674eee106960045959674f234
parent0624b208cbdc51d17491c0901b8b280a52f0ff71 (diff)
downloaddrupal-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
-rw-r--r--authfas.module22
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;
}