Zitat von Marco <fa...@csi.it>:

Hi,
 I have the IMP 5.0.5 hooks for search_sources/search_fields.
I don't want to search all field mapped in turba, so I tried to restrict
search to 'search' fields.

So I replaced

  $out[$source] = array_keys($GLOBALS['registry']
  ->call('contacts/fields', array($source)));

(line 80 of hooks.php.dist) with

  $out[$source] = $GLOBALS['cfgSources'][$source]['search'];

I also tried

 foreach ($GLOBALS['registry']->call('contacts/fields', array($source))
    as $field)
 if ($field['search']) $out[$source][] = $field['name'];

Both replacement work in php admin shell on horde, they give the right result.
But only the original line works. No search for autocomplete address has done
with one of these two replacements.

The search_fields preference expects a json-encoded array. Just pass $out through json_encode().

Jan.

--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/

--
IMP mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: imp-unsubscr...@lists.horde.org

Reply via email to