You are here

function fboauth_profile_fields in Facebook OAuth (FBOAuth) 6

Same name and namespace in other branches
  1. 7.2 includes/fboauth.profile.inc \fboauth_profile_fields()
  2. 7 includes/fboauth.profile.inc \fboauth_profile_fields()

Return a list of all profile fields supported by Profile module.

Profile module doesn't provide a "pretty" way to do this unfortunately, so altogether this is a pretty ugly looking function.

2 calls to fboauth_profile_fields()
fboauth_profile_create_user in includes/fboauth.profile.inc
Add profile info to a Drupal user array (before account creation).
fboauth_profile_form_alter in includes/fboauth.profile.inc
Add options for Profile module to the Facebook OAuth settings form.

File

includes/fboauth.profile.inc, line 14
Functions to assist with handling with Profile module data.

Code

function fboauth_profile_fields() {
  static $profile_fields;
  if (!isset($profile_fields)) {
    $profile_fields = array();
    $profile_categories = profile_categories();
    foreach ($profile_categories as $profile_category) {
      $result = _profile_get_fields($profile_category['name']);
      while ($field = db_fetch_array($result)) {
        $profile_fields[$field['name']] = $field;
      }
    }
  }
  return $profile_fields;
}