You are here

function google_appliance_hyphens_underscores in Google Search Appliance 6.2

Convert hyphens (in URL) to underscores (for the GSA) in client and collection arguments, depending on the config settings.

Hyphens can be used for naming front ends and collections, but the default client and collection supplied with the GSA use underscores, so this enables consistency with those names, while automatically using hypens for the URLs.

Clients and collections could use the same functions, but this way makes the hook_menu() paths easier to read.

4 calls to google_appliance_hyphens_underscores()
google_appliance_client_load in ./google_appliance.module
google_appliance_client_to_arg in ./google_appliance.module
google_appliance_collection_load in ./google_appliance.module
google_appliance_collection_to_arg in ./google_appliance.module

File

./google_appliance.module, line 249
Google Search Appliance (GSA) / Google Mini integration

Code

function google_appliance_hyphens_underscores($arg, $replace = array(
  '-' => '_',
)) {
  if (variable_get('google_appliance_collection_underscores_hyphens', FALSE)) {
    $arg = strtr($arg, $replace);
  }
  return $arg;
}