You are here

function theme_search_api_glossary_facetapi_link_active_v2 in Search API AZ Glossary 7.3

Same name and namespace in other branches
  1. 7.2 search_api_glossary.theme.inc \theme_search_api_glossary_facetapi_link_active_v2()

Returns HTML for an active facet item.

Parameters

$variables: An associative array containing the keys 'text', 'path', and 'options'. See the l() function for information about these variables.

See also

l()

File

./search_api_glossary.theme.inc, line 64

Code

function theme_search_api_glossary_facetapi_link_active_v2($variables) {

  // Sanitizes the link text if necessary.
  $sanitize = empty($variables['options']['html']);
  $link_text = $sanitize ? check_plain($variables['text']) : $variables['text'];

  // Theme function variables fro accessible markup.
  // @see http://drupal.org/node/1316580
  $accessible_vars = array(
    'text' => $variables['text'],
    'active' => TRUE,
  );

  // Builds link, passes through t() which gives us the ability to change the
  // position of the widget on a per-language basis.
  $replacements = array(
    '!facetapi_deactivate_widget' => theme('facetapi_deactivate_widget', $variables),
    '!facetapi_accessible_markup' => theme('facetapi_accessible_markup', $accessible_vars),
  );
  $variables['text'] = t('!facetapi_deactivate_widget !facetapi_accessible_markup', $replacements);
  $variables['options']['html'] = TRUE;
  return theme_link($variables) . $link_text;
}