X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=mkdru.module;h=a4845e2f03f00fccd1f373f34c4cf9ee5d07d7d5;hb=9af415332645247f224d98148691d6b6ece99f60;hp=a68fc93f7490cf90b7c01b7974858c177ef44d49;hpb=b8111152723a2cda25a38e7b9dd6352fce9cd607;p=mkdru-moved-to-drupal.org.git diff --git a/mkdru.module b/mkdru.module index a68fc93..a4845e2 100644 --- a/mkdru.module +++ b/mkdru.module @@ -5,7 +5,7 @@ // Module metainfo /** -* Implementation of hook_node_info() +* Implements hook_node_info() */ function mkdru_node_info() { return array( @@ -17,30 +17,38 @@ function mkdru_node_info() { ); } -function mkdru_ting_search_show($params) { +function mkdru_ting_search_tab($keys) { + error_log("TING SEARCH TAB invoked"); $path = drupal_get_path('module', 'mkdru'); // Include client library. drupal_add_js(variable_get('pz2_js_path', 'pazpar2/js') . '/pz2.js', 'module', 'footer'); drupal_add_js($path . '/jquery.ba-bbq.js', 'module', 'footer'); + drupal_add_js($path . '/recipe.js', 'module', 'footer'); drupal_add_js($path . '/mkdru.theme.js', 'module', 'footer'); drupal_add_js($path . '/mkdru.client.js', 'module', 'footer'); $html = theme('mkdru_results'); drupal_add_js(array('mkdru' => - array('use_sessions' => '1', 'query' => $params['keys'] - )), 'setting'); - return array("content" => $html); + 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("content" => $html, "title" => "Meta Search"); } /** -* Implementation of hook_perm() +* Implements hook_perm() */ function mkdru_perm() { return array('create metasearch interface', 'edit any metasearch interface', 'edit own metasearch interface'); } /** -* Implementation of hook_access() +* Implements hook_access() */ function mkdru_access($op, $node, $account) { @@ -62,7 +70,7 @@ function mkdru_access($op, $node, $account) { } /** -* Implementation of hook_menu() +* Implements hook_menu() */ function mkdru_menu() { $items['admin/settings/mkdru'] = array( @@ -78,7 +86,7 @@ function mkdru_menu() { } /** -* Implementation of hook_init() +* Implements hook_init() */ function mkdru_init() { // Applies our module specific CSS to all pages. This works best because @@ -91,7 +99,7 @@ function mkdru_init() { // Node config /** -* Implementation of hook_form() +* Implements hook_form() */ function mkdru_form(&$node, $form_state) { $type = node_get_types('type', $node); @@ -128,7 +136,7 @@ function mkdru_form(&$node, $form_state) { '#type' => 'fieldset', '#title' => t('Service Proxy specific settings'), '#collapsible' => TRUE, - '#collapsed' => TRUE + '#collapsed' => FALSE ); $form['sp_settings']['sp_user'] = array( '#type' => 'textfield', @@ -182,7 +190,7 @@ function mkdru_form(&$node, $form_state) { /** -* Implementation of hook_validate() +* Implements hook_validate() */ function mkdru_validate($node) { if (!is_numeric($node->source_max)) { @@ -197,14 +205,14 @@ function mkdru_validate($node) { } /** -* Implementation of hook_insert(). +* Implements hook_insert(). */ function mkdru_insert($node) { drupal_write_record('mkdru', $node); } /** -* Implementation of hook_update(). +* Implements hook_update(). */ function mkdru_update($node) { if ($node->revision) { @@ -217,7 +225,7 @@ function mkdru_update($node) { } /** - * Implementation of hook_nodeapi(). + * Implements hook_nodeapi(). * * When a node revision is deleted, we need to remove the corresponding record * from our table. The only way to handle revision deletion is by implementing @@ -232,7 +240,7 @@ function mkdru_nodeapi(&$node, $op, $teaser, $page) { } /** - * Implementation of hook_delete(). + * Implements hook_delete(). */ function mkdru_delete($node) { // Deleting by nid covers all revisions. @@ -243,7 +251,7 @@ function mkdru_delete($node) { // Node rendering /** -* Implementation of hook_load() +* Implements hook_load() */ function mkdru_load($node) { return array('mkdru' => db_fetch_object(db_query( @@ -251,7 +259,7 @@ function mkdru_load($node) { } /** -* Implementation of hook_theme(). +* Implements hook_theme(). */ function mkdru_theme() { return array( @@ -292,7 +300,7 @@ function theme_mkdru_js($node) { } /** -* Implementation of hook_view() +* Implements hook_view() */ function mkdru_view($node, $teaser = FALSE, $page = FALSE) { $node->content['mkdru_js'] = array( @@ -311,7 +319,7 @@ function mkdru_view($node, $teaser = FALSE, $page = FALSE) { } /** -* Implementation of hook_block() +* Implements hook_block() */ function mkdru_block($op='list', $delta='sources', $edit=array()) { switch ($op) {