You are here

function webform_civicrm_enabled_fields in Webform CiviCRM Integration 7

Same name and namespace in other branches
  1. 6.2 webform_civicrm_utils.inc \webform_civicrm_enabled_fields()
  2. 6 webform_civicrm_utils.inc \webform_civicrm_enabled_fields()
  3. 7.2 webform_civicrm_utils.inc \webform_civicrm_enabled_fields()

Get ids of enabled CiviCRM fields for a webform @Param $node - node object

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 344
Webform CiviCRM module's utility functions.

Code

function webform_civicrm_enabled_fields($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;
}