'Roblib Islandscholar Search Target configuration', 'description' => 'Configuration for the Roblib Islandscholar site search target', 'page callback' => 'drupal_get_form', 'page arguments' => array('roblib_search_islandscholar_config_form'), 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); $items['roblib_search/islandscholar/ajax/%'] = array( 'title' => 'islandscholar ajax', 'page callback' => 'roblib_search_islandscholar_ajax', 'page arguments' => array(3), 'type' => MENU_CALLBACK, 'access arguments' => array('search roblib islandscholar'), ); return $items; } function roblib_search_islandscholar_config_form($form, &$form_state) { $form['roblib_search_islandscholar_url'] = array( '#type' => 'textfield', '#title' => t('Islandscholar Solr url'), '#default_value' => variable_get('roblib_search_islandscholar_url', 'http://www.islandscholar.ca:8080/solr/'), '#description' => t('The base Islandscholar Solr URL, for example http://www.islandscholar.ca:8080/solr/'), '#required' => TRUE, ); $form['roblib_search_islandscholar_num_results'] = array( '#type' => 'textfield', '#title' => t('Number of results to return'), '#default_value' => variable_get('roblib_search_islandscholar_num_results', '5'), '#description' => t('The number of results to display in the Bento box'), '#required' => TRUE, ); $form['roblib_search_islandscholar_fq'] = array( '#type' => 'textarea', '#title' => t('Filter Query'), '#default_value' => variable_get('roblib_search_islandscholar_fq', 'PID:ir* AND (RELS_EXT_hasModel_uri_ms:info\:fedora/ir\:thesisCModel OR RELS_EXT_hasModel_uri_ms:info\:fedora/ir\:citationCModel)'), '#description' => t('A query used to restrict the results to namespace and content models'), '#required' => TRUE, ); $form['roblib_search_islandscholar_qf'] = array( '#type' => 'textarea', '#title' => t('Query Field'), '#default_value' => variable_get('roblib_search_islandscholar_qf', 'dc.title^2.5 dc.creator^5.0 dc.contributor^2.0 dc.description^2.0 dc.identifier^2.0 dc.type^2.0 catch_all_fields_mt^1.0'), '#description' => t('The fields to query and a weight for each field.'), '#required' => TRUE, ); return system_settings_form($form); } /** * Implements hook_permission(). */ function roblib_search_islandscholar_permission() { return array( 'search roblib islandscholar' => array( 'title' => t('Search the islandscholar target'), 'description' => t('Search all Roblib islandscholar target. This permission exposes the search blocks and allows you to see search results.'), ), 'administer roblib search_islandscholar' => array( 'title' => t('Administer Roblib Search Evergreen'), 'description' => t('Administer settings for the Roblib islandscholar search client.'), ), ); } /** * Implements hook_theme(). */ function roblib_search_islandscholar_theme() { // set path $path = drupal_get_path('module', 'roblib_search_islandscholar'); $file = 'theme.inc'; return array( // results page 'roblib_search_islandscholar' => array( 'path' => $path . '/theme', 'file' => $file, 'template' => 'roblib-search-islandscholar', 'variables' => array('results' => NULL), ) ); } function roblib_search_islandscholar_block_info() { $blocks['roblib_islandscholar_results'] = array( // info: The name of the block. 'info' => t('Roblib Islandscholar Solr Search Results block'), // Block caching options (per role, per user, etc.) 'cache' => DRUPAL_CACHE_PER_ROLE, // default ); return $blocks; } function roblib_search_islandscholar_preprocess_panels_pane(&$variables, $hook){ if($variables['pane']->subtype == 'roblib_search_islandscholar-roblib_islandscholar_results'){ $variables['title_prefix'] = '
provides an Islandscholar target for the Roblib search module
' ); } }