You are here

function advpoll_checkbox_selected in Advanced Poll 7

Same name and namespace in other branches
  1. 7.3 includes/advpoll_voteapi.inc \advpoll_checkbox_selected()
  2. 7.2 includes/advpoll_voteapi.inc \advpoll_checkbox_selected()
1 call to advpoll_checkbox_selected()
advpoll_form_submit in ./advpoll.module
Submit handler for voting

File

includes/advpoll_voteapi.inc, line 334

Code

function advpoll_checkbox_selected($choices, $votes) {
  $selected = array();
  $count = count($choices);
  for ($i = 0; $i < $count; $i++) {
    $choice = strip_tags($choices[$i]['choice']);
    if (!is_numeric($votes[$choice]) && !empty($votes[$choice])) {
      $selected[] = $choices[$i]['choice_id'];
    }
  }
  return $selected;
}