You are here

function advpoll_writein_promote_form_submit in Advanced Poll 5

Same name and namespace in other branches
  1. 6.3 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()

File

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

Code

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