You are here

function theme_current_search_text in Facet API 7.2

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

Returns HTML for the inactive facet item's count.

Parameters

$variables: An associative array containing:

  • text: The text being displayed.
  • wrapper: A boolean flagging whether wrapper markup should be added.
  • element: The HTML element the text is wrapped in.
  • css: A boolean flagging whether a CSS class should be added to the wrapper element.
  • class: An array of CSS classes.
  • options: An associative array of options containing:
    • html: Whether or not "text" is rendered HTML, otherwise the string is passed through check_plain(). Defaults to FALSE.
2 theme calls to theme_current_search_text()
CurrentSearchBugFixTestCase::testCurrentSearchTextEncoding in contrib/current_search/tests/current_search.test
Tests bug fixed at http://drupal.org/node/1751514.
CurrentSearchItemText::execute in contrib/current_search/plugins/current_search/item_text.inc
Implements CurrentSearchItem::execute().

File

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

Code

function theme_current_search_text(array $variables) {

  // Initializes output, sanitizes text if necessary.
  $sanitize = empty($variables['options']['html']);
  $output = $sanitize ? check_plain($variables['text']) : $variables['text'];

  // Adds wrapper markup and CSS classes.
  if ($variables['wrapper'] && $variables['element']) {
    $attributes = array(
      'class' => $variables['class'],
    );
    $element = check_plain($variables['element']);
    $output = '<' . $element . drupal_attributes($attributes) . '>' . $output . '</' . $element . '>';
  }
  return $output;
}