You are here

function theme_current_search_link_active in Facet API 6.3

Same name and namespace in other branches
  1. 7.2 contrib/current_search/current_search.theme.inc \theme_current_search_link_active()
  2. 7 contrib/current_search/current_search.theme.inc \theme_current_search_link_active()

Returns HTML for a grouped active facet item.

Parameters

$variables: An associative array containing the keys 'text', 'path', 'options', and 'count'.

1 theme call to theme_current_search_link_active()
CurrentSearchGroup::execute in contrib/current_search/plugins/current_search/item_group.inc
Implements CurrentSearchItem::execute().

File

contrib/current_search/current_search.theme.inc, line 94
Theme functions for the Current Search Blocks module.

Code

function theme_current_search_link_active($variables) {

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

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

  // Adds the deactivation widget.
  $variables['text'] .= theme('current_search_deactivate_widget');

  // Resets link text, sets to options to HTML since we already sanitized the
  // link text and are providing additional markup for accessibility.
  $variables['text'] .= ' ' . $accessible_markup;
  $variables['options']['html'] = TRUE;
  return theme_facetapi_link($variables);
}