Ok, I'm stumped.
I have a function that identifies form names on a page and puts them into an array. Looks like this:
$formIdArray=array();
//implements Drupal's "hook_form_alter"...
function forumModify_form_alter(&$form, &$form_state, $form_id)
{
echo "Form ID is $form_id<br />";
global $formIdArray[]=$form_id;
}
The next hook I need to implement is hook_form_formID_alter(), where formID is replaced with the name of the form that I got from the first hook_form_alter(). My question is how do I create a dynamic function name, that changes based on the name of the form extracted from the hook above.
example: My hook_form_alter() method gives me two forms on the page, forum_form_forum and search_form_forum. I need to create hooks that act like this:
function hook_form_search_form_forum_alter(&$form, &$form_state)
function hook_form_forum_form_forum_alter(&$form, &$form_state)
The function code within each function will be identical, I just need to make the function names on the fly. I realize it might be done if I install the RunKit PECL library, but I was hoping to avoid that.
Any ideas?
BTW, I hate Drupal...