You are here

function asset_search_wizard_recent_searches in Asset 6

Same name and namespace in other branches
  1. 5.2 contrib/asset_search/asset_search.module \asset_search_wizard_recent_searches()
2 calls to asset_search_wizard_recent_searches()
asset_search_wizard_form in contrib/asset_search/asset_search.module
Asset Search Form
asset_search_wizard_form_submit in contrib/asset_search/asset_search.module
Asset search form submission handler

File

contrib/asset_search/asset_search.module, line 108

Code

function asset_search_wizard_recent_searches($type = NULL, $value = NULL) {
  $cid = 'asset_search:recent_searches';
  if ($cache = cache_get($cid)) {
    $results = unserialize($cache->data);
  }
  else {
    $results = array();
  }
  if ($type && $value) {
    $path = 'asset/wizard/method/search/' . $type . '/' . $value;
    $text = $type . ':' . $value;
    $results[] = tbl($text, $path);
    cache_set($cid, 'cache', serialize($results));
  }
  return $results;
}