function webform_civicrm_enabled_fields in Webform CiviCRM Integration 6
Same name and namespace in other branches
- 6.2 webform_civicrm_utils.inc \webform_civicrm_enabled_fields()
- 7 webform_civicrm_utils.inc \webform_civicrm_enabled_fields()
- 7.2 webform_civicrm_utils.inc \webform_civicrm_enabled_fields()
Get ids of enabled CiviCRM fields for a webform @Param $node - entire node object, or just the NID works too
4 calls to webform_civicrm_enabled_fields()
- webform_civicrm_configure_form in ./
webform_civicrm_forms.inc - Form to configure CiviCRM options for a Webform
- webform_civicrm_configure_form_submit in ./
webform_civicrm_forms.inc - Submission handler, saves CiviCRM options for a Webform node
- webform_civicrm_contact_match in ./
webform_civicrm_utils.inc - Create or update CiviCRM contact Called by both presave and insert webform hooks in order to handle the optional contact_id field correctly
- _webform_civicrm_webform_frontend_form_alter in ./
webform_civicrm_forms.inc - Alter front-end of webforms: Called by hook_form_alter() when rendering a civicrm-enabled webform Add custom prefix. Display message. Block unknown users. Set webform default values.
File
- ./
webform_civicrm_utils.inc, line 334 - Webform CiviCRM module's utility functions.
Code
function webform_civicrm_enabled_fields($node) {
if (!is_object($node)) {
$node = node_load($node);
}
if (!is_array($node->webform['components'])) {
return;
}
$fields = webform_civicrm_get_fields();
$enabled = array();
foreach ($node->webform['components'] as $c) {
if (array_key_exists($c['form_key'], $fields)) {
$enabled[$c['form_key']] = $c['cid'];
}
}
return $enabled;
}