diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-06-22 08:46:16 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-06-22 08:46:16 +0000 |
commit | 569ede574f2db14d7359b42e1ccbf5772a4554fb (patch) | |
tree | fadd967fb5610aacf078b562a29f5728f23a710d /modules/profile | |
parent | fe8b35f52778b63b96c969da27d2929beee8c1b9 (diff) | |
download | brdo-569ede574f2db14d7359b42e1ccbf5772a4554fb.tar.gz brdo-569ede574f2db14d7359b42e1ccbf5772a4554fb.tar.bz2 |
#115139: Add centralized json handler (and send text/javascript content-type header).
Diffstat (limited to 'modules/profile')
-rw-r--r-- | modules/profile/profile.module | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/profile/profile.module b/modules/profile/profile.module index c973986af..87238db73 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -742,16 +742,15 @@ function profile_form_profile($edit, $user, $category, $register = FALSE) { * Callback to allow autocomplete of profile text fields. */ function profile_autocomplete($field, $string) { + $matches = array(); if (db_result(db_query("SELECT COUNT(*) FROM {profile_fields} WHERE fid = %d AND autocomplete = 1", $field))) { - $matches = array(); $result = db_query_range("SELECT value FROM {profile_values} WHERE fid = %d AND LOWER(value) LIKE LOWER('%s%%') GROUP BY value ORDER BY value ASC", $field, $string, 0, 10); while ($data = db_fetch_object($result)) { $matches[$data->value] = check_plain($data->value); } - - print drupal_to_js($matches); } - exit(); + + drupal_json($matches); } /** |