? role_weights_1065002-1.patch Index: role_weights.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/role_weights/role_weights.module,v retrieving revision 1.12.2.4 diff -u -r1.12.2.4 role_weights.module --- role_weights.module 18 Oct 2008 00:09:05 -0000 1.12.2.4 +++ role_weights.module 18 Oct 2008 00:46:28 -0000 @@ -281,3 +281,24 @@ return $tables; } + +/** + * Token support + */ +function role_weights_token_values($type, $object = NULL, $options = array()) { + if ($type == 'user') { + $user = $object; + $highest_role = role_weights_get_highest($user->roles); + $tokens['highest-role'] = $user->roles[$highest_role]; + $tokens['highest-role-id'] = $highest_role; + return $tokens; + } +} + +function role_weights_token_list($type = 'all') { + if ($type == 'user' || $type == 'all') { + $tokens['user']['highest-role'] = t("The user's highest role name"); + $tokens['user']['highest-role-id'] = t("The user's highest role id"); + return $tokens; + } +}