_profile_get_fields

Versions
5 – 7
_profile_get_fields($category, $register = FALSE)

▾ 3 functions call _profile_get_fields()

profile_form_alter in modules/profile/profile.module
Implement 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.

Code

modules/profile/profile.module, line 605

<?php
function _profile_get_fields($category, $register = FALSE) {
  $query = db_select('profile_field');
  if ($register) {
    $query->condition('register', 1);
  }
  else {
    // Use LOWER(:category) instead of PHP's strtolower() to avoid UTF-8 conversion issues.
    $query->where('LOWER(category) = LOWER(:category)', array(':category' => $category));
  }
  if (!user_access('administer users')) {
    $query->condition('visibility', PROFILE_HIDDEN, '<>');
  }
  return $query
    ->fields('profile_field')
    ->orderBy('category', 'ASC')
    ->orderBy('weight', 'ASC')
    ->execute();
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.