Index: nodereference.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/cck/Attic/nodereference.module,v retrieving revision 1.39.2.38 diff -u -r1.39.2.38 nodereference.module --- nodereference.module 4 Aug 2008 22:28:16 -0000 1.39.2.38 +++ nodereference.module 13 Aug 2008 14:04:15 -0000 @@ -56,6 +56,12 @@ $views[t('Default Views')][$view->name] = $view->name; } if (count($views) > 1) { + if (module_exists('token')) { + $tokens_help = theme('token_help', 'global', '[', ']'); + } + else { + $tokens_help = t('You must install the token module to use tokens!'); + } $form['advanced'] = array( '#type' => 'fieldset', '#title' => t('Advanced - Nodes that can be referenced (View)'), @@ -74,7 +80,7 @@ '#title' => t('View arguments'), '#default_value' => isset($field['advanced_view_args']) ? $field['advanced_view_args'] : '', '#required' => FALSE, - '#description' => t('Provide a comma separated list of arguments to pass to the view.'), + '#description' => t('Provide a comma separated list of arguments to pass to the view. You may use the following tokens: '. $tokens_help) , ); } } @@ -408,8 +414,10 @@ // arguments for the view $view_args = array(); if (isset($field['advanced_view_args'])) { - // TODO: Support Tokens using token.module ? - $view_args = array_map(trim, explode(',', $field['advanced_view_args'])); + if (module_exists('token')) { + $view_args = token_replace($field['advanced_view_args'], $type = 'global', $object = NULL, $leading = '[', $trailing = ']'); + } + $view_args = array_map(trim, explode(',', $view_args)); } if (isset($string)) {