You are here

function advpoll_ranking_choice_form in Advanced Poll 7.3

Same name and namespace in other branches
  1. 7 advpoll_ranking/advpoll_ranking.module \advpoll_ranking_choice_form()
  2. 7.2 advpoll_ranking/advpoll_ranking.module \advpoll_ranking_choice_form()

Form view for ranking forms used in Borda and Instant Run-off.

2 string references to 'advpoll_ranking_choice_form'
advpoll_ranking_cancel_vote_submit in advpoll_ranking/advpoll_ranking.module
Submit function for cancelling a vote.
advpoll_ranking_node_view in advpoll_ranking/advpoll_ranking.module
Implements hook_node_view().

File

advpoll_ranking/advpoll_ranking.module, line 347

Code

function advpoll_ranking_choice_form($form, &$form_state, $data, $node) {

  // Allow only the number of choices available for hidden select.
  $form['#id'] = 'advpoll-ranking-form-' . $node->nid;
  $form['choices'] = array(
    '#theme' => 'advpoll_ranking',
    '#data' => $data,
    '#node' => $node,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#ajax' => array(
      'callback' => 'advpoll_ranking_submit',
      'wrapper' => 'advpoll-ranking-form-' . $node->nid,
      'name' => 'submit1',
    ),
    '#value' => t('Vote'),
  );
  $form['write_in_weight'] = array(
    '#type' => 'hidden',
    '#default_value' => 'no-js',
  );
  return $form;
}