You are here

function makemeeting_simplepoll_pollpanel_process in Make Meeting Scheduler 6

makemeeting_simplepoll_pollpanel_process()

Parameters

mixed $element:

mixed $form_state:

1 string reference to 'makemeeting_simplepoll_pollpanel_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 95
Make Meeting Simple Poll module

Code

function makemeeting_simplepoll_pollpanel_process($element, $form_state) {
  $vote_array = array();
  if (isset($element['#post']['vote'])) {
    if ($element['#attributes']['multiple_allowed'] == 1) {
      foreach ($element['#post']['vote'] as $vote_id) {
        $vote_array[$vote_id] = 1;
      }
    }
    else {
      $vote_array[$element['#post']['vote']] = 1;
    }
  }
  $element['#value'] = array(
    'vote' => $vote_array,
    'name' => $element['#post']['your_name'],
  );
  drupal_add_css(drupal_get_path('module', 'makemeeting') . '/pollpanel.css');
  return $element;
}