function voting_rules_votingapi_insert in Voting Rules 6
Same name and namespace in other branches
- 7 voting_rules.module \voting_rules_votingapi_insert()
Implementation of hook_votingapi_insert().
File
- ./
voting_rules.module, line 21 - Provides Rules intregration for the Votingapi module
Code
function voting_rules_votingapi_insert($votes) {
foreach ($votes as $vote) {
$user = user_load($vote['uid']);
$content = voting_rules_load_content($vote['content_type'], $vote['content_id']);
if ($content) {
rules_invoke_event('voting_rules_insert_' . $vote['content_type'], $vote, $content, $user);
rules_invoke_event('voting_rules_insert', $vote, $user);
}
}
}