function _profile_get_fields in Drupal 7
Same name and namespace in other branches
- 5 modules/profile/profile.module \_profile_get_fields()
- 6 modules/profile/profile.module \_profile_get_fields()
3 calls to _profile_get_fields()
- profile_form_alter in modules/
profile/ profile.module - Implements hook_form_alter().
- profile_save_profile in modules/
profile/ profile.module - profile_user_form_validate in modules/
profile/ profile.module - Form validation handler for the user register/profile form.
File
- 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();
}