You are here

function _locale_string_seek_query in Drupal 4

Same name and namespace in other branches
  1. 5 includes/locale.inc \_locale_string_seek_query()

Build object out of search criteria specified in request variables

2 calls to _locale_string_seek_query()
_locale_string_seek in includes/locale.inc
Perform a string search and display results in a table
_locale_string_seek_form in includes/locale.inc
User interface for the string search screen

File

includes/locale.inc, line 1241
Admin-related functions for locale.module.

Code

function _locale_string_seek_query() {
  static $query = NULL;
  if (is_null($query)) {
    $fields = array(
      'string',
      'language',
      'searchin',
    );
    $query = new StdClass();
    if (is_array($_REQUEST['edit'])) {
      foreach ($_REQUEST['edit'] as $key => $value) {
        if (!empty($value) && in_array($key, $fields)) {
          $query->{$key} = $value;
        }
      }
    }
    else {
      foreach ($_REQUEST as $key => $value) {
        if (!empty($value) && in_array($key, $fields)) {
          $query->{$key} = strpos(',', $value) ? explode(',', $value) : $value;
        }
      }
    }
  }
  return $query;
}