| 1 |
<?php // $Id: votesmart_field.module,v 1.2 2008/08/10 01:42:52 vauxia Exp $ |
<?php // $Id: votesmart_field.module,v 1.3 2008/08/17 15:36:33 vauxia Exp $ |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* Implementation of hook_elements(). |
* Implementation of hook_elements(). |
| 79 |
if ($map = $field['votesmart_map'][$node->type]) { |
if ($map = $field['votesmart_map'][$node->type]) { |
| 80 |
foreach ($items as $item) { |
foreach ($items as $item) { |
| 81 |
if (votesmart_field_content_is_empty($item, $field)) continue; |
if (votesmart_field_content_is_empty($item, $field)) continue; |
| 82 |
$data = votesmart_get_record($field['votesmart_table'], $item); |
$data = votesmart_get_record($item['table'], $item['id']); |
| 83 |
foreach ($map as $field_name => $token) { |
foreach ($map as $field_name => $token) { |
| 84 |
_votesmart_field_map_data($node, $field_name, $token, $data); |
_votesmart_field_map_data($node, $field_name, $token, $data); |
| 85 |
} |
} |
| 123 |
); |
); |
| 124 |
//TODO temporary |
//TODO temporary |
| 125 |
$element = array( |
$element = array( |
|
'#type' => 'textfield', |
|
|
'#input' => TRUE, |
|
| 126 |
'#columns' => array('id', 'table'), |
'#columns' => array('id', 'table'), |
| 127 |
|
'id' => array( |
| 128 |
|
'#type' => 'textfield', |
| 129 |
|
'#default_value' => $items[$delta]['id'], |
| 130 |
|
'#input' => TRUE, |
| 131 |
|
), |
| 132 |
|
'table' => array( |
| 133 |
|
'#type' => 'value', |
| 134 |
|
'#value' => $field['votesmart_table'], |
| 135 |
|
), |
| 136 |
); |
); |
| 137 |
return $element; |
return $element; |
| 138 |
} |
} |