? fivestar-tags.patch Index: fivestar.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/fivestar/fivestar.module,v retrieving revision 1.13.2.67 diff -u -p -r1.13.2.67 fivestar.module --- fivestar.module 1 Jul 2009 04:03:50 -0000 1.13.2.67 +++ fivestar.module 7 Jul 2009 03:07:52 -0000 @@ -1777,3 +1777,34 @@ function fivestar_views_widget_handler($ return theme('fivestar_static', $value, 5); } } + + +/** + * Implementation of hook_votingapi_metadata_alter(). + */ +function fivestar_votingapi_metadata_alter(&$data) { + static $tags; + if (!isset($tags)) { + $tags = array(); + + module_load_install('content'); + module_load_include('inc', 'content', 'includes/content.admin'); + module_load_include('inc', 'content', 'includes/content.crud'); + + // Grab the list of fields to update. + foreach (content_types_install() as $type_name => $fields) { + foreach ($fields as $field) { + if ($field['type'] == 'fivestar') { + if (!empty($field['axis'])) { + $data['tags'][$field['axis']] = array( + 'name' => drupal_ucfirst($field['axis']), + 'description' => t('Used by %field in the %type content type.', array('%type' => $type_name, '%field' => $field['field_name'])), + 'module' => 'fivestar', // This is optional; we can add it for our own purposes. + ); + } + } + } + } + } + return $tags; +} \ No newline at end of file