You are here

function _webform_table_matrix in Webform Matrix Component 6

Same name and namespace in other branches
  1. 7.4 components/matrix.inc \_webform_table_matrix()
  2. 7 components/matrix.inc \_webform_table_matrix()
  3. 7.2 components/matrix.inc \_webform_table_matrix()
  4. 7.3 components/matrix.inc \_webform_table_matrix()

Implements _webform_table_component().

File

components/matrix.inc, line 714
Webform module matrix component.

Code

function _webform_table_matrix($component, $value) {
  if ($value[0]) {
    $sub_elements = $component['extra']['element'];
    $value_array = unserialize($value[0]);
    if (empty($value_array)) {
      return array();
    }
    $col = 1;
    $headers = array();
    $display_array = _webform_display_array($sub_elements, $value_array, $headers);
    $output = theme('table', $headers, $display_array);
    return $output;
  }
  else {
    return '';
  }
}