You are here

function google_cse_menu in Google Custom Search Engine 5

Same name and namespace in other branches
  1. 6 google_cse.module \google_cse_menu()
  2. 7.3 google_cse.module \google_cse_menu()

Implementation of hook_menu().

File

./google_cse.module, line 11
Display a Google Custom Search Engine on your site.

Code

function google_cse_menu($maycache) {
  $items = array();
  if ($maycache) {
    if (variable_get('google_cse_results_display', 'here') != 'google') {
      $items[] = array(
        'path' => 'search/google',
        'access' => user_access('search Google CSE'),
        'title' => t('Google'),
        'description' => t('Google Custom Search Engine'),
        'callback' => 'google_cse_results',
        'type' => MENU_LOCAL_TASK,
      );
    }
    $items[] = array(
      'path' => 'admin/settings/google_cse',
      'access' => user_access('administer site configuration'),
      'title' => t('Google CSE'),
      'description' => t('Configure the Google Custom Search Engine.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'google_cse_admin_settings',
      ),
      'type' => MENU_NORMAL_ITEM,
    );
  }
  return $items;
}