------------------------------ hook_pathauto_user() ------------------------------ The hook_pathauto_user() delivers these possibilities: 1) you can provide aliases for any tab your module adds to the user page 2) you can provide extra placeholders 3) you can add extra code when a new aliases are created for new/updated/deleted users The hook_pathauto_user() has these parameters: 1) $op = action (taburls, placeholders, values, insert, update, delete) 2) $edit = in case of user change (insert, update, delete) this is the form (what is submitted) and contains the new username for example 3) $user = in case of user change (insert, update, delete) this is the $user object provided by the user module 4) $placeholders = in case of user change (insert, update, delete) this contains the placeholders for making new aliasses. ------------------------------ 1) you can provide aliases for any tab your module adds to the user page ------------------------------ These paths will be automatically updated when user changes and when bulkupdate is called, so you don't need to provide indsert, update and delete actions. A new text box will appear in the admin/settings/pathauto function module_pathauto_user($op, $edit=NULL, $user=NULL, $placeholders=NULL) { switch ($op) { case 'taburls': // URLS I have added as tabs to the user account // return an array like: // tab URL path (after /user/1) => tab name (the name that gets shown in the tab) // $settings = array(); if (module_exist('tracker')) { $settings = array('track' => 'tracker'); } return $settings; default: break; } } ------------------------------ 2) you can provide extra placeholders ------------------------------ function module_pathauto_user($op, $edit=NULL, $user=NULL, $placeholders=NULL) { switch ($op) { case 'placeholders': $placeholders = array(); $placeholders[t('[country]')] = t('Country of the user.'); return $placeholders; case 'values': $results = array(); $results[t('[country]')] = pathauto_cleanstring($edit->country); return $results; default: break; } } ------------------------------ 3) you can add extra code when aliases are created for new/updated/deleted users ------------------------------ Use this when you need user based actions where the source is different then usrs/[uid] function module_pathauto_user($op, $edit=NULL, $user=NULL, $placeholders=NULL) { switch ($op) { case 'insert': case 'update': if (module_exist('blog')) { $src = 'blog/'.$user->uid; $alias = pathauto_create_alias('blog', $op, $placeholders, $src); } break; case 'delete': if (module_exist('blog')) { path_set_alias('blog/'.$user->uid); // delete the feed !!!! path_set_alias('blog/'.$user->uid.'/feed'); } default: break; } }