You are here

function advpoll_cancel_vote_submit in Advanced Poll 7

Same name and namespace in other branches
  1. 7.3 advpoll.module \advpoll_cancel_vote_submit()
  2. 7.2 advpoll.module \advpoll_cancel_vote_submit()
1 string reference to 'advpoll_cancel_vote_submit'
advpoll_cancel_vote_form in ./advpoll.module

File

./advpoll.module, line 706

Code

function advpoll_cancel_vote_submit($form, &$form_state) {
  global $user;
  if ($user) {
    $nid = $form['#nid'];
    $criteria = array();
    $criteria['entity_id'] = $nid;
    $criteria['entity_type'] = 'advpoll';
    $criteria['uid'] = $user->uid;
    votingapi_delete_votes(votingapi_select_votes($criteria));
    $node = node_load($nid);
    if (advpoll_user_eligibility($node)) {

      // print out voting form
      return drupal_get_form('advpoll_choice_form', $node);
    }
  }
}