You are here

function lingotek_filter_set_check in Lingotek Translation 7.7

2 calls to lingotek_filter_set_check()
lingotek_bulk_grid_form in ./lingotek.bulk_grid.inc
lingotek_grid_get_rows in ./lingotek.bulk_grid.inc
Dynamic query processing function for the grid Since the header defines which columns are shown, this query gets all possible values and refines the header using the columns selected in the UI The filters are also processed here

File

./lingotek.bulk_grid.inc, line 349

Code

function lingotek_filter_set_check($entity_type) {
  $filter_set = FALSE;
  if (isset($_SESSION['grid_filters'][$entity_type])) {
    foreach ($_SESSION['grid_filters'][$entity_type] as $key => $value) {
      if ($key === 'filtered_ids' || $key === 'filtered_config_lids') {

        //these keys are filter metadata
        continue;
      }
      if (is_array($value)) {
        $keys = array_keys($value);
        if (count($keys) == 1) {
          if ($keys[0] !== '' && $keys[0] !== 'all') {
            $filter_set = TRUE;
          }
        }
        elseif (count($keys) > 1) {
          $filter_set = TRUE;
        }
      }
      else {

        // $value === '0' accounts for the case of the automatic profile
        if (!empty($value) && $value !== 'all' || $value === '0') {
          $filter_set = TRUE;
        }
      }
    }
  }
  return $filter_set;
}