profile_categories

Versions
4.6 – 6
profile_categories()

Code

modules/profile/profile.module, line 751

<?php
function profile_categories() {
  // Hide hidden profile fields from users that don't have permission to administer users.
  // For these users, categories with only hidden profile fields will not be returned.
  if (user_access('administer users')) {
    $result = db_query("SELECT DISTINCT(category) FROM {profile_fields}");
  }
  else {
    $result = db_query("SELECT DISTINCT(category) FROM {profile_fields} WHERE visibility <> %d", PROFILE_HIDDEN);
  }

  while ($category = db_fetch_object($result)) {
    $data[] = array('name' => $category->category, 'title' => $category->category, 'weight' => 3);
  }
  return $data;
}
?>
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.