| 1 |
<?php // $Id: votesmart_factory.inc,v 1.3 2008/08/17 15:36:33 vauxia Exp $ |
<?php // $Id: votesmart_factory.inc,v 1.4 2008/09/05 22:17:01 vauxia Exp $ |
| 2 |
|
|
| 3 |
function votesmart_factory() { |
function votesmart_factory() { |
| 4 |
require_once(drupal_get_path('module', 'votesmart') .'/votesmart.inc'); |
require_once(drupal_get_path('module', 'votesmart') .'/votesmart.inc'); |
| 101 |
|
|
| 102 |
$values = array( |
$values = array( |
| 103 |
'type' => 'candidate', |
'type' => 'candidate', |
|
'field_candidate_id' => $c['candidateId'], |
|
| 104 |
'title' => $c['firstName'] .' '. $c['lastName'], |
'title' => $c['firstName'] .' '. $c['lastName'], |
| 105 |
'op' => t('Save'), |
'op' => t('Save'), |
| 106 |
'name' => 'admin', |
'name' => 'admin', |
| 107 |
); |
); |
| 108 |
|
|
| 109 |
|
$values['field_candidate_id'][] = array('id' => $c['candidateId'], 'table' => 'candidate'); |
| 110 |
$values['field_election_year'][] = array('value' => $election['electionYear']); |
$values['field_election_year'][] = array('value' => $election['electionYear']); |
| 111 |
$values['field_party'][] = array('value' => $c['electionParties']); |
$values['field_party'][] = array('value' => $c['electionParties']); |
| 112 |
if ($state != 'NA') { |
if ($state != 'NA') { |