function location_user_locationapi in Location 6.3
Same name and namespace in other branches
- 5.3 location_user.module \location_user_locationapi()
- 7.3 location_user.module \location_user_locationapi()
- 7.4 location_user.module \location_user_locationapi()
Implementation of hook_locationapi().
File
- ./
location_user.module, line 96 - 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(array(
'uid' => $v['uid'],
));
$obj[$k]['href'] = 'user/' . $v['uid'];
$obj[$k]['title'] = $account->name;
$obj[$k]['type'] = t('User location');
}
}
}
}