/[drupal]/contributions/modules/fivestar/includes/fivestar.field.inc
ViewVC logotype

Diff of /contributions/modules/fivestar/includes/fivestar.field.inc

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

revision 1.1, Mon May 11 04:25:09 2009 UTC revision 1.2, Wed Jul 1 01:43:59 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: fivestar_field.inc,v 1.4 2009/05/11 03:12:55 quicksketch Exp $  // $Id: fivestar.field.inc,v 1.1 2009/05/11 04:25:09 quicksketch Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 41  function fivestar_field_settings($op, $f Line 41  function fivestar_field_settings($op, $f
41          $dynamic_options['comment_target_nid'] = t('Node Comment Parent');          $dynamic_options['comment_target_nid'] = t('Node Comment Parent');
42        }        }
43        if (module_exists('nodereference')) {        if (module_exists('nodereference')) {
44          $fields = content_fields(NULL, $field['type_name']);          $fields = content_fields();
45          foreach ($fields as $content_field) {          foreach ($fields as $field_name => $content_field) {
46            if ($content_field['type'] == 'nodereference' && $content_field['type_name'] == $field['type_name']) {            // Make sure that this field exists for this type.
47              if ($content_field['type'] == 'nodereference' && $content_field = content_fields($field_name, $field['type_name'])) {
48              $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']));
49            }            }
50          }          }
# Line 118  function fivestar_field($op, &$node, $fi Line 119  function fivestar_field($op, &$node, $fi
119          } else {          } else {
120            $rating = $items[$delta]['rating'];            $rating = $items[$delta]['rating'];
121          }          }
122          $target = fivestar_field_target($node, $field, $item);          $items[$delta]['target'] = fivestar_field_target($node, $field, $item);
123    
124          if (is_numeric($target)) {          if (is_numeric($items[$delta]['target'])) {
125            _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);
126            votingapi_recalculate_results('node', $target);            votingapi_recalculate_results('node', $items[$delta]['target']);
127          }          }
128        }        }
129        break;        break;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2