diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-07-28 20:30:34 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-07-28 20:30:34 -0700 |
commit | 44bc74edb9ae77bfaeb70f708411026131ec12bb (patch) | |
tree | 809ffd0bbf3839b3a25e1e9f05ee50c5de33921f /modules/search | |
parent | 1e90e40d3a9fe2cb826b56686f23a33879418048 (diff) |
Change search callbacks to use the event system, so move them out of
xxx_search helpers and into xxx_event helpers.
Diffstat (limited to 'modules/search')
-rw-r--r-- | modules/search/helpers/search.php | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/modules/search/helpers/search.php b/modules/search/helpers/search.php index b08cf89d..c03de983 100644 --- a/modules/search/helpers/search.php +++ b/modules/search/helpers/search.php @@ -64,19 +64,15 @@ class search_Core { } static function update($item) { - $data = array(); + $data = new ArrayObject(); $record = ORM::factory("search_record")->where("item_id", $item->id)->find(); if (!$record->loaded) { $record->item_id = $item->id; } - foreach (module::active() as $module) { - $class_name = "{$module->name}_search"; - if (method_exists($class_name, "item_index_data")) { - $data[] = call_user_func(array($class_name, "item_index_data"), $record->item()); - } - } - $record->data = join(" ", $data); + module::event("item_index_data", $record->item(), $data); + Kohana::log("alert",print_r($data,1)); + $record->data = join(" ", (array)$data); $record->dirty = 0; $record->save(); } |