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