'Roblib Solr Search Target configuration', 'description' => 'Configuration for the Roblib Solr site search target', 'page callback' => 'drupal_get_form', 'page arguments' => array('roblib_search_solr_site_config_form'), 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); $items['roblib_search/solr_site/bestbet/%'] = array( 'title' => 'BestBet', 'page callback' => 'roblib_search_solr_site_bestbet', 'page arguments' => array(3), 'type' => MENU_CALLBACK, 'access arguments' => array('search roblib solr_site'), ); $items['roblib_search/solr_site/databases/%'] = array( 'title' => 'solr_site databases', 'page callback' => 'roblib_search_solr_site_databases', 'page arguments' => array(3), 'type' => MENU_CALLBACK, 'access arguments' => array('search roblib solr_site'), ); $items['roblib_search/solr_site/guides/%'] = array( 'title' => 'solr_site guides', 'page callback' => 'roblib_search_solr_site_guides', 'page arguments' => array(3), 'type' => MENU_CALLBACK, 'access arguments' => array('search roblib solr_site'), ); $items['roblib_search/solr_site/results/%'] = array( 'title' => 'solr_site guides', 'page callback' => 'roblib_search_solr_site_results', 'page arguments' => array(3), 'type' => MENU_CALLBACK, 'access arguments' => array('search roblib solr_site'), ); return $items; } /** * A form to manage the modules configuration. * * @param array $form * A Drupal form array * @param array $form_state * A Drupal formstate array * * @return array * A Drupal form array */ function roblib_search_solr_site_config_form($form, &$form_state) { $form['roblib_search_solr_site_url'] = array( '#type' => 'textfield', '#title' => t('Solr url'), '#default_value' => variable_get('roblib_search_solr_site_url', 'http://localhost:8983/solr'), '#description' => t('The base Solr URL, for example http://localhost:8983/solr'), '#required' => TRUE, ); $form['roblib_search_solr_site_num_results'] = array( '#type' => 'textfield', '#title' => t('Number of results to return'), '#default_value' => variable_get('roblib_search_solr_site_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_solr_site_permission() { return array( 'search roblib solr_site' => array( 'title' => t('Search the solr_site target'), 'description' => t('Search all Roblib solr_site target. This permission exposes the search blocks and allows you to see search results.'), ), 'administer roblib search_solr_site' => array( 'title' => t('Administer Roblib Search Evergreen'), 'description' => t('Administer settings for the Roblib solr_site search client.'), ), ); } /** * Implements hook_theme(). */ function roblib_search_solr_site_theme() { // set path $path = drupal_get_path('module', 'roblib_search_solr_site'); $file = 'theme.inc'; return array( // results page 'roblib_search_solr_site_bestbet' => array( 'path' => $path . '/theme', 'file' => $file, 'template' => 'roblib-search-solr-site-results', 'variables' => array('results' => NULL), ), 'roblib_search_solr_site_databases' => array( 'path' => $path . '/theme', 'file' => $file, 'template' => 'roblib-search-solr-site-results', 'variables' => array('results' => NULL), ), 'roblib_search_solr_site_guides' => array( 'path' => $path . '/theme', 'file' => $file, 'template' => 'roblib-search-solr-site-results', 'variables' => array('results' => NULL), ), 'roblib_search_solr_site_results' => array( 'path' => $path . '/theme', 'file' => $file, 'template' => 'roblib-search-solr-site-results', 'variables' => array('results' => NULL), ), ); } /** * Implements hook_block_info(). */ function roblib_search_solr_site_block_info() { $blocks['roblib_search_solr_site_bestbet'] = array( // info: The name of the block. 'info' => t('Roblib Solr Search Best bets'), // Block caching options (per role, per user, etc.) 'cache' => DRUPAL_CACHE_PER_ROLE, // default ); $blocks['roblib_search_solr_site_db'] = array( // info: The name of the block. 'info' => t('Roblib Solr Search Databases Block'), // Block caching options (per role, per user, etc.) 'cache' => DRUPAL_CACHE_PER_ROLE, // default ); $blocks['roblib_search_solr_site_guides'] = array( // info: The name of the block. 'info' => t('Roblib Solr Search Guides Block'), // Block caching options (per role, per user, etc.) 'cache' => DRUPAL_CACHE_PER_ROLE, // default ); $blocks['roblib_search_solr_site_results'] = array( // info: The name of the block. 'info' => t('Roblib Solr Search Results Block'), // Block caching options (per role, per user, etc.) 'cache' => DRUPAL_CACHE_PER_ROLE, // default ); return $blocks; } /** * Add a div around our block content so we can theme our panels. * * By adding our divs we can theme ours without affecting other drupal panels. * * @param array $variables * Drupal variables array * @param array $hook */ function roblib_search_solr_site_preprocess_panels_pane(&$variables, $hook) { switch ($variables['pane']->subtype) { case 'roblib_search_solr_site-roblib_search_solr_site_bestbet': $variables['title_prefix'] = '
provides a target for the Roblib search module
' ); } }