function locale_translate_filter_values

Build array out of search criteria specified in request variables.

3 calls to locale_translate_filter_values()
locale_translate_edit_form in drupal/core/modules/locale/locale.pages.inc
Form constructor for the string editing form.
locale_translate_filter_form in drupal/core/modules/locale/locale.pages.inc
Return form for locale translation filters.
locale_translate_filter_load_strings in drupal/core/modules/locale/locale.pages.inc
Builds a string search query and returns an array of string objects.

File

drupal/core/modules/locale/locale.pages.inc, line 66
Interface translation summary, editing and deletion user interfaces.

Code

function locale_translate_filter_values() {
  $filter_values =& drupal_static(__FUNCTION__);
  if (!isset($filter_values)) {
    $filter_values = array();
    $filters = locale_translate_filters();
    foreach ($filters as $key => $filter) {
      $filter_values[$key] = $filter['default'];

      // Let the filter defaults be overwritten by parameters in the URL.
      if (isset($_GET[$key])) {

        // Only allow this value if it was among the options, or
        // if there were no fixed options to filter for.
        if (!isset($filter['options']) || isset($filter['options'][$_GET[$key]])) {
          $filter_values[$key] = $_GET[$key];
        }
      }
      elseif (isset($_SESSION['locale_translate_filter'][$key])) {

        // Only allow this value if it was among the options, or
        // if there were no fixed options to filter for.
        if (!isset($filter['options']) || isset($filter['options'][$_SESSION['locale_translate_filter'][$key]])) {
          $filter_values[$key] = $_SESSION['locale_translate_filter'][$key];
        }
      }
    }
  }
  return $filter_values;
}