summaryrefslogtreecommitdiff
path: root/modules/search/tests/search_extra_type.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/search/tests/search_extra_type.module')
-rw-r--r--modules/search/tests/search_extra_type.module19
1 files changed, 16 insertions, 3 deletions
diff --git a/modules/search/tests/search_extra_type.module b/modules/search/tests/search_extra_type.module
index 0aaa9260a..1d22c46c8 100644
--- a/modules/search/tests/search_extra_type.module
+++ b/modules/search/tests/search_extra_type.module
@@ -13,22 +13,35 @@ function search_extra_type_search_info() {
return array(
'title' => 'Dummy search type',
'path' => 'dummy_path',
+ 'conditions_callback' => 'search_extra_type_conditions',
);
}
+function search_extra_type_conditions() {
+ $conditions = array();
+
+ if (!empty($_REQUEST['search_conditions'])) {
+ $conditions['search_conditions'] = $_REQUEST['search_conditions'];
+ }
+ return $conditions;
+}
+
/**
* Implements hook_search_execute().
*
* This is a dummy search, so when search "executes", we just return a dummy
- * result.
+ * result containing the keywords and a list of conditions.
*/
-function search_extra_type_search_execute() {
+function search_extra_type_search_execute($keys = NULL, $conditions = NULL) {
+ if (!$keys) {
+ $keys = '';
+ }
return array(
array(
'link' => url('node'),
'type' => 'Dummy result type',
'title' => 'Dummy title',
- 'snippet' => 'Dummy search snippet to display',
+ 'snippet' => "Dummy search snippet to display. Keywords: {$keys}\n\nConditions: " . print_r($conditions, TRUE),
),
);
}