You are here

function theme_facetapi_accessible_markup in Facet API 7

Same name and namespace in other branches
  1. 6.3 facetapi.theme.inc \theme_facetapi_accessible_markup()
  2. 7.2 facetapi.theme.inc \theme_facetapi_accessible_markup()

Returns HTML that adds accessible markup to facet links.

Parameters

$variables: An associative array containing:

  • text: The text of the facet link.
  • active: Whether the item is active or not.

See also

http://drupal.org/node/1316580

2 theme calls to theme_facetapi_accessible_markup()
theme_facetapi_link_active in ./facetapi.theme.inc
Returns HTML for an active facet item.
theme_facetapi_link_inactive in ./facetapi.theme.inc
Returns HTML for an inactive facet item.

File

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

Code

function theme_facetapi_accessible_markup($variables) {
  $vars = array(
    '@text' => $variables['text'],
  );
  $text = $variables['active'] ? t('Remove @text filter', $vars) : t('Apply @text filter', $vars);

  // Add spaces before and after the text, since other content may be displayed
  // inline with this and we don't want the words to run together. However, the
  // spaces must be inside the <span> so as not to disrupt the layout for
  // sighted users.
  return '<span class="element-invisible"> ' . $text . ' </span>';
}