You are here

function theme_current_search_link_active in Facet API 7

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

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.

2 theme calls to theme_current_search_link_active()
CurrentSearchGroup::execute in contrib/current_search/plugins/current_search/item_group.inc
Implements CurrentSearchItem::execute().
CurrentSearchItemActive::execute in contrib/current_search/plugins/current_search/item_active.inc
Implements CurrentSearchItem::execute().

File

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

Code

function theme_current_search_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(
    '!current_search_deactivate_widget' => theme('current_search_deactivate_widget', $variables),
    '!current_search_accessible_markup' => theme('current_search_accessible_markup', $accessible_vars),
  );
  $variables['text'] = t('!current_search_deactivate_widget !current_search_accessible_markup', $replacements);
  $variables['options']['html'] = TRUE;
  $variables['options']['attributes']['class'][] = 'active';
  return l($variables['text'], $variables['path'], $variables['options']) . $link_text;
}