function _profile_get_fields

7.x profile.module _profile_get_fields($category, $register = FALSE)
6.x profile.module _profile_get_fields($category, $register = FALSE)
3 calls to _profile_get_fields()
profile_form_alter in drupal-7.x/modules/profile/profile.module
Implements hook_form_alter().
profile_save_profile in drupal-7.x/modules/profile/profile.module
profile_user_form_validate in drupal-7.x/modules/profile/profile.module
Form validation handler for the user register/profile form.

File

drupal-7.x/modules/profile/profile.module, line 614
Support for configurable user profiles.

Code

function _profile_get_fields($category, $register = FALSE) {
  $query = db_select('profile_field');
  if ($register) {
    $query->condition('register', 1);
  }
  else {
    $query->condition('category', db_like($category), 'LIKE');
  }
  if (!user_access('administer users')) {
    $query->condition('visibility', PROFILE_HIDDEN, '<>');
  }
  return $query
  ->fields('profile_field')
    ->orderBy('category', 'ASC')
    ->orderBy('weight', 'ASC')
    ->execute();
}