You are here

function lingotek_grid_filter_inline_submit in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.4 lingotek.bulk_grid.inc \lingotek_grid_filter_inline_submit()
  2. 7.5 lingotek.bulk_grid.inc \lingotek_grid_filter_inline_submit()
  3. 7.6 lingotek.bulk_grid.inc \lingotek_grid_filter_inline_submit()
1 string reference to 'lingotek_grid_filter_inline_submit'
lingotek_bulk_grid_form in ./lingotek.bulk_grid.inc

File

./lingotek.bulk_grid.inc, line 720

Code

function lingotek_grid_filter_inline_submit($form, $form_state) {
  $entity_type = $_SESSION['grid_entity_type'];
  $_SESSION['grid_filters'][$entity_type]['search_type'] = $form_state['values']['search_type'];
  if (!empty($form_state['values']['search'])) {
    $_SESSION['grid_filters'][$entity_type]['search'] = $form_state['values']['search'];
  }
  else {
    unset($_SESSION['grid_filters'][$entity_type]['search']);
    unset($_SESSION['grid_filters'][$entity_type]['search_type']);
  }
  unset($_SESSION['grid_filters'][$entity_type]['body']);
  unset($_SESSION['grid_filters'][$entity_type]['title']);
  if ($form_state['values']['search_type'] == 'title') {
    $_SESSION['grid_filters'][$entity_type]['title'] = $form_state['values']['search'];
  }
  elseif ($form_state['values']['search_type'] == 'body') {
    $_SESSION['grid_filters'][$entity_type]['body'] = $form_state['values']['search'];
  }
  if (isset($form_state['values']['limit_select'])) {
    $_SESSION['limit_select'] = $form_state['values']['limit_select'];
  }
}