Hi all!
I'm trying to integrate VotingAPI with Workflow_ng's API, basically to provide a new action called a "vote". The "vote" would have two arguments, NID and Average vote. I am not a module programmer though, and am therefore having a lot of difficulty.
Here is what I have come up with so far:
workflow_ng API doc: http://drupal.org/node/156790
VotingAPI Doc: http://drupal.org/node/68877
/*
* hook_votingapi_results($results, $votes, $content_type, $content_id)
*/
function voting_workflow_ng_votingapi_results($results, $votes, $content_type, $content_id)
{
workflow_ng_invoke_event('vote', $node = $results[0]->content_id, $results = $results[1]->value);
}
/*
* Implementation of hook_event_info()
*/
function voting_workflow_ng_event_info() {
return array(
'vote' => array(
'#label' => t('User places a vote'),
'#module' => t('VotingAPI'),
'#arguments' => array(
'node' => array('#entity' => 'node', '#label' => t('Node')),
'results' => array('#entity' => 'node', '#label' => t('Results')),
),
'#redirect' => TRUE,
),
);
}
I'm sure i'm pretty off here - anyone help point in the right direction?
Comments
Comment #1
eaton commentedSupport for the 5.x branch of VotingAPI has ended with the release of Drupal 7 and the upcoming release of VotingAPI 7.x-2.4.