You are here

function lingotek_grid_define_columns in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lingotek.bulk_grid.inc \lingotek_grid_define_columns()
  2. 7.4 lingotek.bulk_grid.inc \lingotek_grid_define_columns()
  3. 7.6 lingotek.bulk_grid.inc \lingotek_grid_define_columns()

Defines which columns should be shown for source and target tables, and what the defaults should be.

Parameters

bool $source: Changes whether settings for source or target variables are output

Return value

array $columns Associative array with two important inner arrays: 1: 'columns' points to the allowed columns, 2: 'defaults' points to the base defaults to use when resetting the customization The 'columns' and 'defaults' arrays are output with the keys and the values being the same

2 calls to lingotek_grid_define_columns()
lingotek_grid_build_column_checkboxes in ./lingotek.bulk_grid.inc
Builds the checkbox elements for customizing The Grid's columns Uses predefined defaults specified in 'lingotek_grid_define_columns'
lingotek_grid_reset_columns in ./lingotek.bulk_grid.inc
Cleans up the grid_custom session array, restoring the predefined defaults.

File

./lingotek.bulk_grid.inc, line 799
Bulk Grid form

Code

function lingotek_grid_define_columns() {
  $columns = array(
    'columns' => array(
      'nid',
      'content_type',
      'title',
      'language',
      'translations',
      'configuration',
      'document_id',
      'workflow',
      'changed',
      'last_uploaded',
      'actions',
    ),
    'defaults' => array(
      'title',
      'language',
      'translations',
      'configuration',
      'content_type',
      'actions',
      'changed',
    ),
  );
  $columns['columns'] = array_combine($columns['columns'], $columns['columns']);
  $columns['defaults'] = array_combine($columns['defaults'], $columns['defaults']);
  return $columns;
}