You are here

function form_process_tableform in Tableform 7

Process the elements to populate the table.

Parameters

$element: An associative array containing the properties and children of the tableform element.

Return value

The processed element.

1 string reference to 'form_process_tableform'
tableform_element_info in ./tableform.module
Implementation of hook_element_info();

File

./tableform.module, line 47

Code

function form_process_tableform($element) {

  // process header cells
  $header_field = isset($element['#tf_header']) ? '#tf_header' : '#header';
  foreach ($element[$header_field] as $key => $cell) {
    if (is_array($cell)) {
      $element[$key] = $cell;
    }
  }

  // process rows
  $rows_field = isset($element['#tf_rows']) ? '#tf_rows' : '#options';
  foreach ($element[$rows_field] as $row_key => $row) {
    foreach ($row as $key => $cell) {
      if (is_array($cell)) {
        $element[$key] = $cell;
      }
    }
  }
  return $element;
}