function theme_facetapi_link_active in Facet API 7
Same name and namespace in other branches
- 6.3 facetapi.theme.inc \theme_facetapi_link_active()
- 6 facetapi.theme.inc \theme_facetapi_link_active()
- 7.2 facetapi.theme.inc \theme_facetapi_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.
See also
l()
File
- ./
facetapi.theme.inc, line 105 - 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', $variables),
'!facetapi_accessible_markup' => theme('facetapi_accessible_markup', $accessible_vars),
);
$variables['text'] = t('!facetapi_deactivate_widget !facetapi_accessible_markup', $replacements);
$variables['options']['html'] = TRUE;
$variables['options']['attributes']['class'][] = 'active';
return l($variables['text'], $variables['path'], $variables['options']) . $link_text;
}