You are here

function lingotek_grid_reset_columns in Lingotek Translation 7.6

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

Cleans up the grid_custom or config_custom session array, restoring the predefined defaults.

1 call to lingotek_grid_reset_columns()
lingotek_grid_get_columns in ./lingotek.bulk_grid.inc
Gets the columns that will be shown from the session variable
1 string reference to 'lingotek_grid_reset_columns'
lingotek_grid_customize_form in ./lingotek.bulk_grid.inc

File

./lingotek.bulk_grid.inc, line 929

Code

function lingotek_grid_reset_columns() {
  $grid_name = $_SESSION['grid_entity_type'];
  if (isset($_SESSION[$grid_name . '_custom'])) {
    unset($_SESSION[$grid_name . '_custom']);
  }
  $source_columns = $grid_name == 'config' ? lingotek_config_define_columns() : lingotek_grid_define_columns($grid_name);
  foreach ($source_columns['columns'] as $column) {
    $_SESSION[$grid_name . '_custom'][$column . '__custom'] = in_array($column, $source_columns['defaults']);
  }
}