You are here

function lingotek_grid_get_columns in Lingotek Translation 7.7

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

Gets the columns that will be shown from the session variable

Parameters

string $grid_name: Changes whether this will be for the normal grids or for config

Return value

array $columns Associative array keyed by column name with prefix and suffix removed Keys point to a bool which specifies if the column should be shown or not

2 calls to lingotek_grid_get_columns()
lingotek_bulk_grid_form in ./lingotek.bulk_grid.inc
lingotek_grid_customize_form in ./lingotek.bulk_grid.inc

File

./lingotek.bulk_grid.inc, line 1418

Code

function lingotek_grid_get_columns($grid_name = 'grid') {
  $filters = array();
  if (!isset($_SESSION['grid_custom'][$grid_name])) {

    // If the columns do not exist yet in the session variable we get an error, so reset them here.
    lingotek_grid_reset_columns();
  }
  foreach ($_SESSION['grid_custom'][$grid_name] as $key => $value) {
    $columns[str_replace('__custom', '', $key)] = $value;
  }
  return $columns;
}