Index: opensearch.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/opensearch/opensearch.info,v retrieving revision 1.1 diff -u -p -r1.1 opensearch.info --- opensearch.info 27 Apr 2008 16:01:06 -0000 1.1 +++ opensearch.info 16 Jul 2008 17:03:41 -0000 @@ -1,4 +1,5 @@ ; $Id: opensearch.info,v 1.1 2008/04/27 16:01:06 hunmaat Exp $ name = OpenSearch Feed description = Allows Drupal search results to be returned in the OpenSearch RSS format -dependencies = search \ No newline at end of file +dependencies = search +package = Search Index: opensearch.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/opensearch/opensearch.module,v retrieving revision 1.10 diff -u -p -r1.10 opensearch.module --- opensearch.module 27 Apr 2008 20:15:23 -0000 1.10 +++ opensearch.module 16 Jul 2008 17:03:41 -0000 @@ -2,6 +2,11 @@ // $Id: opensearch.module,v 1.10 2008/04/27 20:15:23 hunmaat Exp $ /** + * @file + * opensearch + */ + +/** * Implementation of hook_menu(). */ function opensearch_menu($may_cache) { @@ -10,8 +15,9 @@ function opensearch_menu($may_cache) { if ($may_cache) { $items[] = array( 'path' => 'admin/settings/opensearch', - 'title' => t('opensearch'), - 'callback' => 'opensearch_admin_settings', + 'title' => t('Opensearch'), + 'callback' => 'drupal_get_form', + 'callback arguments' => array('opensearch_admin_settings'), 'access' => user_access('administer site configuration'), 'type' => MENU_NORMAL_ITEM, ); @@ -19,7 +25,7 @@ function opensearch_menu($may_cache) { foreach (module_list() as $name) { if (module_hook($name, 'search') && $title = module_invoke($name, 'search', 'name')) { $items[] = array( - 'path' => 'opensearch/' . $name, + 'path' => 'opensearch/'. $name, 'title' => $title, 'callback' => 'opensearch_view', 'access' => user_access('search content'), @@ -57,7 +63,7 @@ function opensearch_admin_settings() { $form['description']['opensearch_prefix'] = array( '#type' => 'markup', - '#value' => '
' . t('Your site offers the following OpenSearch description files: %links', array('%links' => theme('item_list', $links))) . '
', + '#value' => ''. t('Your site offers the following OpenSearch description files: %links', array('%links' => theme('item_list', $links))) .'
', ); $form['description']['opensearch_shortname'] = array( '#type' => 'textfield', @@ -124,7 +130,7 @@ function opensearch_admin_settings() { '#default_value' => $opensearch_adult_content, ); - return system_settings_form('opensearch_admin_settings', $form); + return system_settings_form($form); } @@ -132,7 +138,7 @@ function opensearch_form_alter($form_id, if ($form_id == 'search_form' && arg(2)) { // for pagination etc. $get = drupal_query_string_encode($_GET, array('q')); - $form['basic']['inline']['rss'] = array('#type' => 'markup', '#value' => theme('xml_icon', url('opensearch/' . arg(1). '/'. urlencode(search_get_keys()), trim($get)?$get:NULL))); + $form['basic']['inline']['rss'] = array('#type' => 'markup', '#value' => theme('xml_icon', url('opensearch/'. arg(1) .'/'. urlencode(search_get_keys()), trim($get)?$get:NULL))); } } @@ -153,7 +159,7 @@ function opensearch_view() { if (trim($keys)) { // Log the search keys: - watchdog('search', t('OpenSearch: %keys (@type).', array('%keys' => $keys, '@type' => module_invoke($type, 'search', 'name'))), WATCHDOG_NOTICE, l(t('results'), 'search/' . $type . '/' . $keys)); + watchdog('search', t('OpenSearch: %keys (@type).', array('%keys' => $keys, '@type' => module_invoke($type, 'search', 'name'))), WATCHDOG_NOTICE, l(t('results'), 'search/'. $type .'/'. $keys)); // Collect the search results: $results = module_invoke($type, 'search', 'search', $keys); @@ -241,8 +247,8 @@ function opensearch_description($type) { $opensearch_description = t($opensearch_description, array('@site' => $site_name, '@type' => $search_type)); $opensearch_longname = t($opensearch_longname, array('@site' => $site_name, '@type' => $search_type)); $url = check_url($base_url); - $url_search = str_replace(array('%7B', '%7D', '&'), array('{', '}', '&'), url('search/' . $type . '/{searchTerms}', 'page={startPage}', NULL, TRUE)); - $url_opensearch = str_replace(array('%7B', '%7D', '&'), array('{', '}', '&'), url('opensearch/' . $type . '/{searchTerms}', 'page={startPage}', NULL, TRUE)); + $url_search = str_replace(array('%7B', '%7D', '&'), array('{', '}', '&'), url('search/'. $type .'/{searchTerms}', 'page={startPage}', NULL, TRUE)); + $url_opensearch = str_replace(array('%7B', '%7D', '&'), array('{', '}', '&'), url('opensearch/'. $type .'/{searchTerms}', 'page={startPage}', NULL, TRUE)); $output = <<