search_api_glossary.theme.inc in Search API AZ Glossary 7
Same filename and directory in other branches
File
search_api_glossary.theme.incView source
<?php
/**
* Returns HTML for an inactive facet item.
*
* @param $variables
* An associative array containing the keys 'text', 'path', 'options', and
* 'count'. See the l() and theme_facetapi_count() functions for information
* about these variables.
*
* @ingroup themeable
*/
function theme_search_api_glossary_facetapi_link_inactive($variables) {
// Builds accessible markup.
// @see http://drupal.org/node/1316580
$accessible_vars = array(
'text' => $variables['text'],
'active' => FALSE,
);
$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'];
// 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;
// Adds count to link if one was passed.
if ($variables['count'] == 0) {
return $variables['text'];
}
return theme_link($variables);
}
/**
* Returns HTML for an active facet item.
*
* @param $variables
* An associative array containing the keys 'text', 'path', and 'options'. See
* the l() function for information about these variables.
*
* @see l()
*
* @ingroup themeable
*/
function theme_search_api_glossary_facetapi_link_active($variables) {
// Theme function variables fro 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'];
$variables['text'] .= $accessible_markup;
$variables['options']['html'] = TRUE;
return $variables['text'];
}
Functions
Name![]() |
Description |
---|---|
theme_search_api_glossary_facetapi_link_active | Returns HTML for an active facet item. |
theme_search_api_glossary_facetapi_link_inactive | Returns HTML for an inactive facet item. |