You are here

function _webform_table_select in Webform 7.4

Same name and namespace in other branches
  1. 6.3 components/select.inc \_webform_table_select()
  2. 7.3 components/select.inc \_webform_table_select()

Implements _webform_table_component().

File

components/select.inc, line 736
Webform module multiple select component.

Code

function _webform_table_select($component, $value) {

  // Convert submitted 'safe' values to un-edited, original form.
  $options = _webform_select_options($component, TRUE);
  $value = (array) $value;
  ksort($value, SORT_NUMERIC);
  $items = array();

  // Set the value as a single string.
  foreach ($value as $option_value) {
    if ($option_value !== '') {
      if (isset($options[$option_value])) {
        $items[] = webform_filter_xss($options[$option_value]);
      }
      else {
        $items[] = check_plain($option_value);
      }
    }
  }
  return implode('<br />', $items);
}