function pcp_admin_settings_form_data in Profile Complete Percent 7
Same name and namespace in other branches
- 5 pcp.module \pcp_admin_settings_form_data()
- 6.2 pcp.module \pcp_admin_settings_form_data()
- 6 pcp.module \pcp_admin_settings_form_data()
Function that sets up parameters to be used when the pcp_admin_settings_form() function is executed.
Parameters
$entity_type: this parameter indicates the source of the profile fields. accepted values include user and profile2.
$bundle: (optional) NULL The bundle to return fields for.
Return value
- assoc array
['profile_fields_options']
- An associative array of all fields created from the profile module.
['default_values']
- An indexed array of all (if any) default values for the form.
2 calls to pcp_admin_settings_form_data()
- pcp_admin_settings in includes/
pcp.admin.inc - Form builder; Configure PCP fields for core profile.
- pcp_form_profile2_type_form_alter in ./
pcp.module - Implements hook_form_FORM_ID_alter(). Form builder; Configure PCP fields for profile2 profile types.
File
- includes/
pcp.admin.inc, line 128 - Admin interface for the pcp module
Code
function pcp_admin_settings_form_data($entity_type = 'user', $bundle = 'user') {
$options = array();
$field_conditions = array(
'entity_type' => $entity_type,
'bundle' => $bundle,
);
$options['profile_fields_options'] = pcp_get_profile_fields($field_conditions);
$options['default_values'] = pcp_get_tagged_profile_fields($entity_type, $bundle, NULL);
return $options;
}