function rules_forms_get_form_info in Rules Forms Support 7
Same name and namespace in other branches
- 7.2 rules_forms.module \rules_forms_get_form_info()
Returns form information.
Parameters
string|array $form_id: An optional form ID or $form array from which the form ID can be retrieved.
Return value
array|false An array of forms and their information keyed by form IDs. Or, if a form ID is specified then that form's information is returned. Returns boolean FALSE if a form array without the form ID was passed.
13 calls to rules_forms_get_form_info()
- RulesFormsAPITestCase::testGetFormInfo in ./
rules_forms.test - Tests rules_forms_get_form_info().
- rules_forms_activate in includes/
rules_forms.admin.inc - Activation page for a form ID.
- rules_forms_admin_events in includes/
rules_forms.admin.inc - Defines the forms events settings form.
- rules_forms_after_build in ./
rules_forms.module - Add element IDs on the form if the setting is enabled.
- rules_forms_deactivate_form in ./
rules_forms.module - Deactivate events for a form.
File
- ./
rules_forms.module, line 502 - Rules Forms Support provides events, conditions, and actions for site forms.
Code
function rules_forms_get_form_info($form_id = NULL) {
$form_info = variable_get('rules_forms_form_info', array());
if ($form_id === NULL) {
return $form_info;
}
// Allow the passage of a $form array.
if (!is_string($form_id)) {
if (isset($form_id['form_id'])) {
$form_id = $form_id['form_id']['#value'];
}
else {
return FALSE;
}
}
return isset($form_info[$form_id]) ? $form_info[$form_id] : FALSE;
}