You are here

function theme_facetapi_link_active in Facet API 6.3

Same name and namespace in other branches
  1. 6 facetapi.theme.inc \theme_facetapi_link_active()
  2. 7.2 facetapi.theme.inc \theme_facetapi_link_active()
  3. 7 facetapi.theme.inc \theme_facetapi_link_active()

Returns HTML for an inactive facet item.

Parameters

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

1 theme call to theme_facetapi_link_active()
CurrentSearchItemActive::execute in contrib/current_search/plugins/current_search/item_active.inc
Implements CurrentSearchItem::execute().

File

./facetapi.theme.inc, line 92
Theme functions for the Facet API module.

Code

function theme_facetapi_link_active($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'),
    '!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_facetapi_link($variables) . $link_text;
}