You are here

function entity_table_select in Entity Construction Kit (ECK) 7.3

Same name and namespace in other branches
  1. 7 eck.module \entity_table_select()
  2. 7.2 eck.module \entity_table_select()

Helper function for the entities_table.

This function creates a select table.

Parameters

array $form: A form arrary as returned by drupal_get_form.

array $state: The form state, this is also provided by the Form API.

string $entity_type: the type of the entities that will be in the table.

string $bundle: The bundle of the entity that will be in the table.

array $header: An array for the table header for more info look at theme_table.

array $rows: The rows of the table for more info on what this should look like look at theme_table.

1 string reference to 'entity_table_select'
eck_forms in ./eck.module
Implements hook_forms().

File

./eck.module, line 585

Code

function entity_table_select($form, &$state, $entity_type, $bundle, $header, $rows) {
  $form['entity_type'] = array(
    '#type' => 'value',
    '#value' => $entity_type,
  );
  $form['bundle'] = array(
    '#type' => 'value',
    '#value' => $bundle,
  );
  $form['entity_table'] = array(
    // '#theme' => 'table',
    '#type' => 'tableselect',
    '#header' => $header,
    '#options' => $rows,
  );
  return $form;
}