You are here

function advpoll_preprocess_advpoll_voting_binary_form in Advanced Poll 6.2

Same name and namespace in other branches
  1. 6.3 modes/binary.inc \advpoll_preprocess_advpoll_voting_binary_form()
  2. 6 modes/binary.inc \advpoll_preprocess_advpoll_voting_binary_form()

Process variables for advpoll-display-binary-form.tpl.php.

The variables array contains the following arguments:

  • $form

See also

advpoll-display-binary-form.tpl.php

File

modes/binary.inc, line 308
Handle binary (true/false) votes.

Code

function advpoll_preprocess_advpoll_voting_binary_form(&$variables) {
  $form =& $variables['form'];
  $variables['message'] = drupal_render($form['message']);

  // If write-ins are used on this form.
  if (isset($form['writein_choice'])) {
    $variables['writein_choice'] = drupal_render($form['writein_choice']);
  }
  $variables['form_id'] = $form['#id'];

  // List of available choices in the poll.
  $variables['choice_list'] = drupal_render($form['choice']);

  // Take off the annoying colon & endlines that Drupal adds to each title.
  $variables['choice_list'] = preg_replace('/[\\n\\r]*: <\\/label>[\\n\\r]*/i', '</label>', $variables['choice_list']);

  // All remaining form elements.
  $variables['form_submit'] = drupal_render($form);
}