/[drupal]/contributions/modules/fivestar/fivestar_field.inc
ViewVC logotype

Diff of /contributions/modules/fivestar/fivestar_field.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.4.31, Sun May 10 21:07:40 2009 UTC revision 1.1.4.32, Wed Jul 1 01:42:34 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: fivestar_field.inc,v 1.1.4.30 2009/04/29 21:50:40 quicksketch Exp $  // $Id: fivestar_field.inc,v 1.1.4.31 2009/05/10 21:07:40 quicksketch Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 38  function fivestar_field_settings($op, $f Line 38  function fivestar_field_settings($op, $f
38          $dynamic_options['comment_target_nid'] = t('Node Comment Parent');          $dynamic_options['comment_target_nid'] = t('Node Comment Parent');
39        }        }
40        if (module_exists('nodereference')) {        if (module_exists('nodereference')) {
41          $fields = content_fields(NULL, $field['type_name']);          $fields = content_fields();
42          foreach ($fields as $content_field) {          foreach ($fields as $field_name => $content_field) {
43            if ($content_field['type'] == 'nodereference' && $content_field['type_name'] == $field['type_name']) {            // Make sure that this field exists for this type.
44              if ($content_field['type'] == 'nodereference' && $content_field = content_fields($field_name, $field['type_name'])) {
45              $dynamic_options[$content_field['field_name']] = t('Node reference: @field', array('@field' => $content_field['field_name']));              $dynamic_options[$content_field['field_name']] = t('Node reference: @field', array('@field' => $content_field['field_name']));
46            }            }
47          }          }
# Line 116  function fivestar_field($op, &$node, $fi Line 117  function fivestar_field($op, &$node, $fi
117          } else {          } else {
118            $rating = $items[$delta]['rating'];            $rating = $items[$delta]['rating'];
119          }          }
120          $target = fivestar_field_target($node, $field, $item);          $items[$delta]['target'] = fivestar_field_target($node, $field, $item);
121    
122          if (is_numeric($target)) {          if (is_numeric($items[$delta]['target'])) {
123            _fivestar_cast_vote('node', $target, $rating, $field['axis'], $node->uid, FALSE, TRUE);            _fivestar_cast_vote('node', $items[$delta]['target'], $rating, $field['axis'], $node->uid, FALSE, TRUE);
124            votingapi_recalculate_results('node', $target);            votingapi_recalculate_results('node', $items[$delta]['target']);
125          }          }
126        }        }
127        break;        break;

Legend:
Removed from v.1.1.4.31  
changed lines
  Added in v.1.1.4.32

  ViewVC Help
Powered by ViewVC 1.1.2