Index: fivestar.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/fivestar/fivestar.module,v retrieving revision 1.2.2.84 diff -u -r1.2.2.84 fivestar.module --- fivestar.module 30 Mar 2008 02:14:17 -0000 1.2.2.84 +++ fivestar.module 15 Apr 2008 04:03:26 -0000 @@ -225,10 +225,11 @@ '#title' => t('Teaser display'), '#default_value' => variable_get('fivestar_position_teaser_'. $form['#node_type']->type, 'hidden'), '#options' => array( - 'above' => t('Rating widget above the teaser'), - 'below' => t('Rating widget below the teaser'), - 'above_static' => t('Static display above the teaser'), - 'below_static' => t('Static display below the teaser'), + 'above' => t('Clickable widget above teaser'), + 'below' => t('Clickable widget below teaser'), + 'above_static' => t('Static display above teaser'), + 'below_static' => t('Static display below teaser'), + 'link' => t('Teaser link to full node widget'), 'hidden' => t(''), ), ); @@ -238,10 +239,10 @@ '#title' => t('Full node display'), '#default_value' => variable_get('fivestar_position_'. $form['#node_type']->type, 'below'), '#options' => array( - 'above' => t('Above the node body'), - 'below' => t('Below the node body'), - 'above_static' => t('Static display above the node body'), - 'below_static' => t('Static display below the node body'), + 'above' => t('Clickable widget above node body'), + 'below' => t('Clickable widget below node body'), + 'above_static' => t('Static display above node body'), + 'below_static' => t('Static display below node body'), 'hidden' => t(''), ), ); @@ -837,6 +838,28 @@ } } + +/** + * Implementation of hook_link() + * + * Add a "rate" link to node teaser. + */ +function fivestar_link($type, $node = NULL, $teaser = FALSE) { + $links = array(); + if ($type == "node" && $teaser) { + if (variable_get('fivestar_position_teaser_'. $node->type, 'above') == "link") { + $links['rate'] = array( + 'title' => t('Rate'), + 'href' => 'node/'. $node->nid, + 'fragment' => 'fivestar-form-node-'. $node->nid, + 'attributes' => array('title' => t('Rate this @type', array('@type', node_get_types('name', $node->type)))), + ); + } + } + return $links; +} + + function fivestar_block($op = 'list', $delta = 0, $edit = array()) { global $user; switch ($op) {