function profile_user_categories

7.x profile.module profile_user_categories()

Implements hook_user_categories().

File

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

Code

function profile_user_categories() {
  $result = db_query("SELECT DISTINCT(category) FROM {profile_field}");
  $data = array();
  foreach ($result as $category) {
    $data[] = array(
      'name' => $category->category,
      'title' => $category->category,
      'weight' => 3,
      'access callback' => 'profile_category_access',
      'access arguments' => array(1, $category->category)
    );
  }
  return $data;
}