You are here

function pcp_admin_settings_form_data in Profile Complete Percent 6

Same name and namespace in other branches
  1. 5 pcp.module \pcp_admin_settings_form_data()
  2. 6.2 pcp.module \pcp_admin_settings_form_data()
  3. 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.
1 call to pcp_admin_settings_form_data()
pcp_admin_settings_form in ./pcp.module
Admin settings form

File

./pcp.module, line 166
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 = 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['profile_fields_options'] = $profile_fields_options;
  $options['default_values'] = $default_values;
  return $options;
}