You are here

function facetapi_parse_delta in Facet API 6.3

Same name and namespace in other branches
  1. 7.2 facetapi.block.inc \facetapi_parse_delta()
  2. 7 facetapi.block.inc \facetapi_parse_delta()

Parses a raw delta into parts.

Parameters

$raw_delta: A string containing the raw delta prior to being hashed.

Return value

An array containing the searcher, realm_name, and facet name in that order.

1 call to facetapi_parse_delta()
facetapi_check_block_visibility in ./facetapi.block.inc
Checks whether the block should be displayed.

File

./facetapi.block.inc, line 224
Block realm code and hook implementations.

Code

function facetapi_parse_delta($raw_delta) {
  $parsed = array();

  // Splits by ":", finds each part.
  $parts = explode(':', $raw_delta);
  $facet_name = array_pop($parts);
  $facet_name = rawurldecode($facet_name);
  $realm_name = array_pop($parts);
  $searcher = implode(':', $parts);

  // Returns array with parsed info.
  return array(
    $searcher,
    $realm_name,
    $facet_name,
  );
}