You are here

function advpoll_writein_promote_form_submit in Advanced Poll 6.3

Same name and namespace in other branches
  1. 5 advpoll.module \advpoll_writein_promote_form_submit()
  2. 6 advpoll.module \advpoll_writein_promote_form_submit()
  3. 6.2 advpoll.module \advpoll_writein_promote_form_submit()

Process advpoll_writein_promote form submissions.

File

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

Code

function advpoll_writein_promote_form_submit($form, &$form_state) {
  if (count($form_state['values']['promote'])) {
    db_query('UPDATE {advpoll_choices} SET writein = 0 WHERE nid = %d AND cid IN(%s)', $form_state['values']['nid'], implode(', ', $form_state['values']['promote']));
    drupal_set_message(format_plural(count($form_state['values']['promote']), 'Write-in promoted.', 'Write-ins promoted.'));
  }
  drupal_goto('node/' . $form_state['values']['nid']);
}