You are here

function current_search_get_classes in Facet API 6.3

Same name and namespace in other branches
  1. 7.2 contrib/current_search/plugins/current_search/item.inc \current_search_get_classes()
  2. 7 contrib/current_search/plugins/current_search/item.inc \current_search_get_classes()

Parses the classes setting into an array of sanitized classes.

Parameters

$setting: The classes setting passed by the user.

array $data: An optional array of data to pass to token_replace().

Return value

array An array of sanitized classes.

2 calls to current_search_get_classes()
CurrentSearchItemActive::execute in contrib/current_search/plugins/current_search/item_active.inc
Implements CurrentSearchItem::execute().
CurrentSearchItemText::execute in contrib/current_search/plugins/current_search/item_text.inc
Implements CurrentSearchItem::execute().

File

contrib/current_search/plugins/current_search/item.inc, line 285
Current search plugin base class.

Code

function current_search_get_classes($setting, array $data = array()) {
  $classes = array();
  foreach (drupal_explode_tags($setting) as $class) {
    if ($data) {
      $class = token_replace($class, $data);
    }
    $classes[] = $class;
  }
  return implode(' ', $classes);
}