+ * Implements hook_search_info()
+ */
+function mkdru_search_info() {
+ return array(
+ 'title' => 'Meta search',
+ 'path' => 'meta',
+ 'conditions_callback' => 'mkdru_search_conditions_callback',
+ );
+}
+
+/**
+ * Implements hook_search_page()
+ */
+function mkdru_search_page($results) {
+ $output['prefix']['#markup'] = theme('mkdru_results');
+ $output['suffix']['#markup'] = '';
+ return $output;
+}
+
+/**
+ * Implements hook_ding_facetbrowser()
+ */
+function mkdru_ding_facetbrowser() {
+ $results = new stdClass();
+ $results->facets = array();
+ $results->show_empty = TRUE; # Show an empty facetbrowser block, even if search didn't return any results
+ return $results;
+}
+
+/**
+ * Search callback function that is invoked by search_view()
+ */
+function mkdru_search_conditions_callback($keys) {}
+
+/**
+ * Implement hook_search_execute()
+ */
+function mkdru_search_execute($keys = NULL, $conditions = NULL) {
+ $path = drupal_get_path('module', 'mkdru');
+ // Include client library.
+ drupal_add_js(variable_get('pz2_js_path', 'pazpar2/js') . '/pz2.js',
+ array('type' => 'file', 'scope' => 'footer'));
+ drupal_add_library('overlay', 'jquery-bbq');
+ drupal_add_js($path . '/recipe.js',
+ array('type' => 'file', 'scope' => 'footer'));
+ drupal_add_js($path . '/mkdru.theme.js',
+ array('type' => 'file', 'scope' => 'footer'));
+ drupal_add_js($path . '/mkdru.client.js',
+ array('type' => 'file', 'scope' => 'footer'));
+ drupal_add_js(array('mkdru' =>
+ array(
+ 'use_sessions' => variable_get('use_sessions', '1'),
+ 'pz2_path' => variable_get('pz2_path', '/pazpar2/search.pz2'),
+ 'sp_user' => variable_get('sp_user', ''),
+ 'sp_pass' => variable_get('sp_pass', ''),
+ 'query' => $keys,
+ )
+ ), 'setting');
+
+ return array();