function site_disclaimer_autocomplete in Site Disclaimer 6
Same name and namespace in other branches
- 7 site_disclaimer.admin.inc \site_disclaimer_autocomplete()
Helper function for autocompletion
1 string reference to 'site_disclaimer_autocomplete'
- site_disclaimer_menu in ./
site_disclaimer.module - Implementation of hook_menu().
File
- ./
site_disclaimer.admin.inc, line 355 - Administration settings for Site Disclaimer module.
Code
function site_disclaimer_autocomplete($string = '') {
$matches = array();
if ($string != '') {
$result = db_query_range(db_rewrite_sql("SELECT nr.title FROM {node_revisions} nr WHERE LOWER(nr.title) LIKE LOWER('%%%s%%')", 'nr'), $string, 0, 10);
while ($node = db_fetch_object($result)) {
$matches[$node->title] = $node->title;
}
}
drupal_json($matches);
}