| 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 |
| 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 |
} |
} |
| 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; |