
|
[dokuwiki]
||
[Date Prev]
[09-2007 Date Index]
[Date Next]
||
[Thread Prev]
[09-2007 Thread Index]
[Thread Next]
[dokuwiki] Proposed SEARCH_RESULT Event
- From: "Todd Augsburger" <todd@xxxxxxxxxxxxxxxx>
- To: <dokuwiki@xxxxxxxxxxxxx>
- Date: Mon, 17 Sep 2007 14:51:51 -0400
If we're in the mood for adopting new events into the core code, I'll again
mention my request for a SEARCH_RESULT event. This would allow plugins to
process searching via a before/after action event, as I originally suggested
in http://www.freelists.org/archives/dokuwiki/02-2007/msg00232.html. Useful
for additional filtering, ordering, searching within docs, etc.
I personally do it as shown in the attached file.
Todd Augsburger
todd@xxxxxxxxxxxxxxxx
Roller Organs
www.rollerorgans.com
[Extended search
Todd Augsburger <todd@xxxxxxxxxxxxxxxx>**20070725000002
Sorts within levels, allow plugin to use search
] {
hunk ./inc/fulltext.php 26
-function ft_pageSearch($query,&$poswords){
+function ft_defaultpageSearch($query,&$poswords){
hunk ./inc/fulltext.php 107
- return $docs;
-}
-
+ return $docs;
+}
+
+function ft_pageSearch($query,&$poswords){
+ // give plugins an opportunity to process the search
+ $docs=array();
+ $params = array();
+ $params['query'] = &$query;
+ $params['poswords'] = &$poswords;
+ $params['docs'] = &$docs;
+ $evt = new Doku_Event('SEARCH_RESULT',$params);
+ if ($evt->advise_before()) {
+ $docs=ft_defaultpageSearch($query,$poswords);
+ } // end event SEARCH_RESULT default action
+ $evt->advise_after();
+ unset($evt);
+ return $docs;
+}
+
}
|

|