You are here

function location_user_locationapi in Location 7.4

Same name and namespace in other branches
  1. 5.3 location_user.module \location_user_locationapi()
  2. 6.3 location_user.module \location_user_locationapi()
  3. 7.3 location_user.module \location_user_locationapi()

Implementation of hook_locationapi().

File

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

Code

function location_user_locationapi(&$obj, $op, $a3 = NULL, $a4 = NULL, $a5 = NULL) {
  switch ($op) {
    case 'instance_links':
      foreach ($obj as $k => $v) {
        if ($v['uid'] != 0) {
          $account = user_load($v['uid']);
          $obj[$k]['href'] = 'user/' . $v['uid'];
          $obj[$k]['title'] = $account->name;
          $obj[$k]['type'] = t('User location');
        }
      }
  }
}