? allow_multiple_tables.patch Index: token.pages.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/token/token.pages.inc,v retrieving revision 1.13 diff -u -p -r1.13 token.pages.inc --- token.pages.inc 18 Dec 2010 01:53:33 -0000 1.13 +++ token.pages.inc 15 Feb 2011 22:47:50 -0000 @@ -33,8 +33,10 @@ function theme_tree_table($variables) { * @ingroup themeable */ function theme_token_tree($variables) { + static $counter = 0; $token_types = $variables['token_types']; $info = token_get_info(); + $prefix = $counter > 0 ? 'tree-' . $counter . '-' : ''; if ($token_types == 'all') { $token_types = array_keys($info['types']); @@ -56,6 +58,7 @@ function theme_token_tree($variables) { } if (count($token_types) > 1) { + $type_info['prefix'] = $prefix; $row = _token_token_tree_format_row($type, $type_info, TRUE); unset($row['data']['value']); $rows[] = $row; @@ -71,6 +74,7 @@ function theme_token_tree($variables) { if (!empty($token_info['restricted']) && empty($variables['show_restricted'])) { continue; } + $token_info['prefix'] = $prefix; if (count($token_types) > 1 && !isset($token_info['parent'])) { $token_info['parent'] = $type; } @@ -93,6 +97,7 @@ function theme_token_tree($variables) { $table_options['caption'] = t('Click a token to insert it into the field you\'ve last clicked.'); $table_options['attributes']['class'][] = 'token-click-insert'; } + $counter++; return theme('tree_table', $table_options); } @@ -102,7 +107,7 @@ function theme_token_tree($variables) { */ function _token_token_tree_format_row($token, array $token_info, $is_group = FALSE) { $row = array( - 'id' => _token_clean_css_identifier($token), + 'id' => $token_info['prefix'] . _token_clean_css_identifier($token), 'class' => array(), 'data' => array( 'name' => $token_info['name'], @@ -126,7 +131,7 @@ function _token_token_tree_format_row($t $row['data']['value'] = $token_info['value']; } if (!empty($token_info['parent'])) { - $row['parent'] = _token_clean_css_identifier($token_info['parent']); + $row['parent'] = $token_info['prefix'] . _token_clean_css_identifier($token_info['parent']); } }