You are here

function location_user_user_view in Location 7.4

Same name and namespace in other branches
  1. 7.3 location_user.module \location_user_user_view()

Implement hook_user_view().

File

./location_user.module, line 116
Associate locations with users.

Code

function location_user_user_view($account) {
  global $user;
  if ($user->uid == $account->uid && user_access('view own user location') || user_access('administer users') || user_access('view all user locations') || user_access('administer user locations')) {
    if (variable_get('location_display_location', 1) && isset($account->locations) && count($account->locations)) {
      $settings = variable_get('location_settings_user', array());
      $account->content['locations'] = location_display($settings, $account->locations);
    }
  }
}