X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=mkdru.module;h=d057df2a3dbee3aaeb8367be124a191405a4575d;hb=db5b797778922d50919364399c90411dfdfb712a;hp=a68fc93f7490cf90b7c01b7974858c177ef44d49;hpb=b8111152723a2cda25a38e7b9dd6352fce9cd607;p=mkdru-moved-to-drupal.org.git diff --git a/mkdru.module b/mkdru.module index a68fc93..d057df2 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( @@ -27,20 +27,26 @@ function mkdru_ting_search_show($params) { 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'); + 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' => $params['keys'] + ) + ), 'setting'); return array("content" => $html); } /** -* 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 +68,7 @@ function mkdru_access($op, $node, $account) { } /** -* Implementation of hook_menu() +* Implements hook_menu() */ function mkdru_menu() { $items['admin/settings/mkdru'] = array( @@ -78,7 +84,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 +97,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 +134,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 +188,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 +203,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 +223,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 +238,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 +249,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 +257,7 @@ function mkdru_load($node) { } /** -* Implementation of hook_theme(). +* Implements hook_theme(). */ function mkdru_theme() { return array( @@ -292,7 +298,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 +317,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) {