You are here

function makemeeting_simplepoll_form_process in Make Meeting Scheduler 6

makemeeting_simplepoll_form_process()

Parameters

mixed $element:

mixed $form_state:

1 string reference to 'makemeeting_simplepoll_form_process'
makemeeting_simplepoll_elements in ./makemeeting_simplepoll.module
Implementation of hook_elements() - we have two custom poll element: the poll table and the admin interface of the poll table

File

./makemeeting_simplepoll.module, line 72
Make Meeting Simple Poll module

Code

function makemeeting_simplepoll_form_process($element, $form_state) {

  // collecting the answers for the question from the posted data
  $options = array();
  foreach ($element['#post'] as $field => $value) {
    preg_match("/(field)([0-9]*)/", $field, $matches);
    if (is_numeric($matches[2])) {
      $value = trim($value);
      if (!empty($value)) {
        $options[$matches[2]] = $value;
      }
    }
  }
  $element['#value'] = $options;
  return $element;
}