'Roblib search', 'description' => 'Configure global Roblib search settings.', 'access arguments' => array('administer site configuration'), 'type' => MENU_NORMAL_ITEM, ); $items['admin/roblib_search/configure'] = array( 'title' => 'Global Configuration', 'description' => 'Configure global Roblib search settings.', 'access arguments' => array('administer site configuration'), 'page callback' => 'drupal_get_form', 'page arguments' => array('roblib_search_config_form'), 'type' => MENU_NORMAL_ITEM, ); return $items; } /** * A form for managing the modules configuration. * * @param array $form * A Drupal form array * @param array $form_state * A Drupal formstate array * * @return array * A Drupal form */ function roblib_search_config_form($form, &$form_state) { $form['roblib_search_panel_page'] = array( '#type' => 'textfield', '#title' => t('Path to the roblib search panel page'), '#default_value' => variable_get('roblib_search_panel_page', '/roblib/panel'), '#description' => t('The Path to the Roblib Search Panel, for example /roblib/panel'), '#required' => TRUE, ); return system_settings_form($form); } /** * Implements hook_admin_paths(). */ function roblib_search_admin_paths() { $paths = array( 'admin/roblib/search' => TRUE, ); return $paths; } /** * Implements hook_permission(). */ function roblib_search_permission() { return array( 'search roblib' => array( 'title' => t('Search all configured targets'), 'description' => t('Search all Roblib configured targets. This permission exposes the search blocks and allows you to see search results.'), ), 'administer roblib search' => array( 'title' => t('Administer Roblib Search'), 'description' => t('Administer settings for the Roblib search client.'), ), ); } /** * Implements hook_block_info(). */ function roblib_search_block_info() { $blocks['roblib_search_form'] = array( 'info' => t('Roblib Global Search Form'), 'cache' => DRUPAL_CACHE_PER_ROLE, ); $blocks['roblib_search_other'] = array( 'info' => t('Roblib Search Other Sources'), 'cache' => DRUPAL_CACHE_PER_ROLE, ); return $blocks; } /** * Implements hook_theme(). */ function roblib_search_theme() { $path = drupal_get_path('module', 'roblib_search'); $file = 'theme.inc'; return array( 'roblib_search_other_sources' => array( 'path' => $path . '/theme', 'file' => $file, 'template' => 'roblib-search-other-sources', 'variables' => array('results' => NULL), ) ); } /** * Hook the panels pane preprocessor so we can wrap it in a div for themeing. * * @param array $variables * Drupal variables array * @param $hook */ function roblib_search_preprocess_panels_pane(&$variables, $hook){ switch ($variables['pane']->subtype) { case 'roblib_search-roblib_search_other': $variables['title_prefix'] = '
The Roblib Search is a module to allow searching across multiple targets. This module does not know how to retrieve results but fires hooks that other modules can implement to gather and display results.
' ); } }