You are here

function advpoll_clear_votes_confirm_form in Advanced Poll 6

Same name and namespace in other branches
  1. 6.3 advpoll.module \advpoll_clear_votes_confirm_form()
  2. 6.2 advpoll.module \advpoll_clear_votes_confirm_form()
  3. 7.3 includes/advpoll.pages.inc \advpoll_clear_votes_confirm_form()
  4. 7 includes/advpoll.pages.inc \advpoll_clear_votes_confirm_form()
  5. 7.2 includes/advpoll.pages.inc \advpoll_clear_votes_confirm_form()

Display a clear votes confirmation form.

1 string reference to 'advpoll_clear_votes_confirm_form'
advpoll_clear_votes_page in ./advpoll.pages.inc
Custom page to handle confirmation of clearing all votes.

File

./advpoll.module, line 1153
Advanced Poll - a sophisticated polling module for voting, elections, and group decision-making.

Code

function advpoll_clear_votes_confirm_form(&$form_state, $nid) {
  $node = node_load($nid);
  $form = array();
  $form['#nid'] = $node->nid;
  $confirm_question = t('Are you sure you want to clear all votes for %title?', array(
    '%title' => $node->title,
  ));
  $form['question'] = array(
    '#value' => '<h2>' . $confirm_question . '</h2>',
  );
  $form = confirm_form($form, $confirm_question, 'node/' . $node->nid . '/votes', t('This will delete all votes that have been cast for the poll.'), t('Clear all votes'), t('Cancel'));

  // Override the default theming of confirmation forms.
  // TODO: need to theme this form better.
  unset($form['#theme']);
  return $form;
}