I did some cleanup to make use of some of D6's features. We can call drupal_get_form() directly from the menu system and ditch some of the _page functions. Also by using the %menu loaders we can get rid of arg() calls and make the forms more re-usable. I split apply_for_role_manage_form() in to apply_for_role_approve_form() and apply_for_role_remove_form() it's pretty close in terms of line count and now each is much more focused on what it does.
I also did some work on apply_for_role_apply_form() to cut down the number of SQL queries run. Now it just runs one query to load all their role applications then does some array foo to limit it down to the desired rows.
There's also a bug fix rolled in here, the apply_for_role_multiple variable was being loaded with a default value of array() which wouldn't pass the $multiple == 1 test.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | afr_cleanup.patch | 10.29 KB | drewish |
| afr_cleanup.patch | 9.59 KB | drewish |
Comments
Comment #1
drewish commentedfound another bug with the variable_get('apply_for_role_register', array()) it'll never evaluate to true.
Comment #2
Soren Jones commentedAndrew,
Very, very cool.
Best,
Soren
Comment #3
Soren Jones commentedComment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.