function pcp_admin_settings_form_data in Profile Complete Percent 5
Same name and namespace in other branches
- 6.2 pcp.module \pcp_admin_settings_form_data()
- 6 pcp.module \pcp_admin_settings_form_data()
- 7 includes/pcp.admin.inc \pcp_admin_settings_form_data()
Function that sets up parameters to be used when the pcp_admin_settings_form() function is executed.
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_form in ./
pcp.module - Admin settings form
- pcp_condition_check_profile_fields_completeness_form in ./
pcp.module - Rules Condition form configuration - select the profile fields to check
File
- ./
pcp.module, line 168 - Allows users with valid permissions to tag profile fields created from the profile module as required fields for a users profile to be considered complete.
Code
function pcp_admin_settings_form_data() {
$profile_fields_options = array();
$default_values = array();
$profile_fields = pcp_get_profile_fields();
foreach ($profile_fields as $key => $value) {
$profile_fields_options[$value['fid']] = $value['title'];
}
$tagged_profile_fields = pcp_get_tagged_profile_fields();
foreach ($tagged_profile_fields as $key => $value) {
$default_values[] = $value['fid'];
}
$options = array();
$options['profile_fields_options'] = $profile_fields_options;
$options['default_values'] = $default_values;
return $options;
}