_locale_string_seek_query

Versions
4.6 – 5
_locale_string_seek_query()

Build object out of search criteria specified in request variables

▾ 2 functions call _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

Code

includes/locale.inc, line 1241

<?php
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.