You are here

function lingotek_grid_clear_filters in Lingotek Translation 7.7

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

Completely clears out any filters from the session variable Filters will automatically revert to their defaults

1 call to lingotek_grid_clear_filters()
lingotek_grid_clear_filters_page in ./lingotek.bulk_grid.inc
1 string reference to 'lingotek_grid_clear_filters'
lingotek_filters_popup_form in ./lingotek.bulk_grid.inc

File

./lingotek.bulk_grid.inc, line 1730

Code

function lingotek_grid_clear_filters($entity_type = NULL) {
  if ($entity_type === NULL || is_array($entity_type)) {
    if (empty($_SESSION['grid_entity_type'])) {
      throw new LingotekException('Attempted to clear filters on an empty entity type!');
    }
    $entity_type = $_SESSION['grid_entity_type'];
  }
  if (isset($_SESSION['grid_filters'][$entity_type])) {
    unset($_SESSION['grid_filters'][$entity_type]);
    session_write_close();
  }
}