You are here

function _pcp_enable_field in Profile Complete Percent 7

2 calls to _pcp_enable_field()
pcp_admin_settings_submit in includes/pcp.admin.inc
Submit callback.
_pcp_save_profile_fields in includes/pcp.admin.inc
Utility function used to save fields.

File

./pcp.module, line 585
Allows users with valid permissions to tag profile fields (core fields or Profile2 fields) for a users profile to be considered complete.

Code

function _pcp_enable_field($entity_type, $bundle, $field_name) {
  $enabled_fields = variable_get('pcp_enabled_fields', array());
  $field_identifier = implode(':', array(
    $entity_type,
    $bundle,
    $field_name,
  ));
  if (!in_array($field_identifier, $enabled_fields)) {
    $enabled_fields[$field_identifier] = $field_identifier;
    variable_set('pcp_enabled_fields', $enabled_fields);
    return TRUE;
  }
  return FALSE;
}