You are here

function _google_appliance_get_lr in Google Search Appliance 7

Format the value of the 'lr' parameter appropriately.

Parameters

$options: Array of languages to filter, as defined by the config variable google_appliance_language_filter_options.

Return value

String to be passed to the GSA using the 'lr' parameter.

2 calls to _google_appliance_get_lr()
google_appliance_get_clusters in ./google_appliance.module
get related search via the Google Search Appliance clustering service
google_appliance_search_view in ./google_appliance.module
Top level search execution (menu callback)

File

./google_appliance.helpers.inc, line 208
helper functions for the Search Google Appliance module

Code

function _google_appliance_get_lr($options) {
  $langcodes = array();
  $options = array_filter($options);
  foreach ($options as $option) {
    switch ($option) {
      case '***CURRENT_LANGUAGE***':
        global $language;
        $langcode = $language->language;
        break;
      case '***DEFAULT_LANGUAGE***':
        $langcode = language_default('language');
        break;
      default:
        $langcode = $option;
    }
    $langcodes[$langcode] = "lang_{$langcode}";
  }
  return implode('|', $langcodes);
}