'Cufts Search Target configuration', 'description' => 'Configuration for the Roblib evergreen search target', 'page callback' => 'drupal_get_form', 'page arguments' => array('roblib_search_cufts_config_form'), 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); $items['roblib_search/cufts/ajax/%'] = array( 'title' => 'cufts ajax', 'page callback' => 'roblib_search_cufts_ajax', 'page arguments' => array(3), 'type' => MENU_CALLBACK, 'access arguments' => array('search roblib cufts'), ); return $items; } function roblib_search_cufts_config_form($form, &$form_state) { $form['roblib_search_cufts_url'] = array( '#type' => 'textfield', '#title' => t('Cufts url'), '#default_value' => variable_get('roblib_search_cufts_url', 'http://cufts2.lib.sfu.ca/CJDB/PCU/browse/show?'), '#description' => t('The base Cufts URL, for example http://cufts2.lib.sfu.ca/CJDB/PCU/browse/show?'), '#required' => TRUE, ); $form['roblib_search_cufts_search_suffix'] = array( '#type' => 'textfield', '#title' => t('Cufts search suffix'), '#default_value' => variable_get('roblib_search_cufts_search_suffix', 'browse_field=title&search_type=startswith&format=json&search_terms='), '#description' => t('The suffix will be appended to the base url for searches, for example browse_field=title&search_type=startswith&format=json&search_terms='), '#required' => TRUE, ); $form['roblib_search_cufts_num_results'] = array( '#type' => 'textfield', '#title' => t('Number of results to return'), '#default_value' => variable_get('roblib_search_cufts_num_results', '5'), '#description' => t('The number of results to display in the Bento box'), '#required' => TRUE, ); return system_settings_form($form); } /** * Implements hook_permission(). */ function roblib_search_cufts_permission() { return array( 'search roblib cufts' => array( 'title' => t('Search the cufts target'), 'description' => t('Search oblib cufts target. This permission exposes the search blocks and allows you to see search results.'), ), 'administer roblib search cufts' => array( 'title' => t('Administer Roblib Search Cufts'), 'description' => t('Administer settings for the Roblib cufts search client.'), ), ); } /** * Implements hook_theme(). */ function roblib_search_cufts_theme() { // set path $path = drupal_get_path('module', 'roblib_search_cufts'); $file = 'theme.inc'; return array( // results page 'roblib_search_cufts' => array( 'path' => $path . '/theme', 'file' => $file, 'template' => 'roblib-search-cufts', 'variables' => array('results'=>NULL) ) ); } function roblib_search_cufts_preprocess_panels_pane(&$variables, $hook){ if($variables['pane']->subtype == 'roblib_search_cufts-roblib_search_cufts_results'){ $variables['title_prefix'] = '
provides a target for the Roblib search module. This target uses javascript to render the results.
' ); } }