diff --git a/contrib/current_search/plugins/current_search/item_active.inc b/contrib/current_search/plugins/current_search/item_active.inc index 4ba6839..ee0d522 100644 --- a/contrib/current_search/plugins/current_search/item_active.inc +++ b/contrib/current_search/plugins/current_search/item_active.inc @@ -25,16 +25,28 @@ class CurrentSearchItemActive extends CurrentSearchItem { // Makes sure facet builds are initialized. $adapter->processFacets(); - // Adds the keywords if any were passed. - $keys = $adapter->getSearchKeys(); - if ($this->settings['keys'] && $keys) { - $items[] = theme('current_search_keys', array('keys' => $keys, 'adapter' => $adapter)); - } - // Initializes links attributes, adds rel="nofollow" if configured. $attributes = ($this->settings['nofollow']) ? array('rel' => 'nofollow') : array(); $attributes += array('class' => array()); + // Adds the keywords if any were passed. + $keys = $adapter->getSearchKeys(); + if ($this->settings['keys'] && $keys && $keys != '[all items]') { + $facets = !empty($_GET['f']) ? array('f' => $_GET['f']) : array(); + + $variables = array( + 'text' => theme('current_search_keys', array('keys' => $keys, 'adapter' => $adapter)), + 'path' => current_path(), + 'options' => array( + 'attributes' => $attributes, + 'html' => TRUE, + 'query' => $facets, + ), + ); + + $items[] = theme('facetapi_link_active', $variables); + } + // Gets the translated pattern with token replacements in tact. $pattern = $this->translate('pattern', $this->settings['pattern']);