function uc_coupon_autocomplete_node in Ubercart Discount Coupons 5
Same name and namespace in other branches
- 6 uc_coupon.admin.inc \uc_coupon_autocomplete_node()
- 7.3 uc_coupon.admin.inc \uc_coupon_autocomplete_node()
- 7.2 uc_coupon.admin.inc \uc_coupon_autocomplete_node()
1 string reference to 'uc_coupon_autocomplete_node'
- uc_coupon_menu in ./
uc_coupon.module - Implementation of hook_menu().
File
- ./
uc_coupon.module, line 558 - Provides discount coupons for Ubercart.
Code
function uc_coupon_autocomplete_node($string) {
$matches = array();
$product_types = module_invoke_all('product_types');
$result = db_query_range("SELECT nid, title FROM {node} WHERE type IN ('" . implode("','", $product_types) . "') AND title LIKE '%%%s%'", $string, 0, 10);
while ($row = db_fetch_object($result)) {
$title = check_plain($row->title);
$matches[$title . ' [nid:' . $row->nid . ']'] = $title;
}
print drupal_to_js($matches);
exit;
}