You are here

function advpoll_writein_promote_form in Advanced Poll 6

Same name and namespace in other branches
  1. 5 advpoll.module \advpoll_writein_promote_form()
  2. 6.3 advpoll.module \advpoll_writein_promote_form()
  3. 6.2 advpoll.module \advpoll_writein_promote_form()
1 string reference to 'advpoll_writein_promote_form'
advpoll_writeins_page in ./advpoll.pages.inc

File

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

Code

function advpoll_writein_promote_form(&$form_state, $node) {
  $form = array();
  $form['fieldset'] = array(
    '#type' => 'fieldset',
    '#collapsible' => FALSE,
    '#title' => t('Promote write-ins'),
  );
  $form['fieldset']['note'] = array(
    '#value' => '<p class="description">' . t('Write-ins can be converted to regular choices. This is useful if users cannot see past write-ins but you want to promote specific write-ins so that they can be seen by users who vote in the future.') . '</p>',
  );
  $writein_list = array();
  foreach ($node->choice as $index => $choice) {
    if ($choice['writein']) {
      $writein_list[$index] = $choice['label'];
    }
  }
  $form['fieldset']['promote'] = array(
    '#type' => 'checkboxes',
    '#options' => $writein_list,
  );
  $form['fieldset']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Promote'),
  );
  $form['nid'] = array(
    '#type' => 'value',
    '#value' => $node->nid,
  );
  return $form;
}