You are here

function facetapi_pretty_paths_coder_callback in Facet API Pretty Paths 6.3

Same name and namespace in other branches
  1. 7 facetapi_pretty_paths.module \facetapi_pretty_paths_coder_callback()

Helper function for calling coder callbacks.

3 calls to facetapi_pretty_paths_coder_callback()
FacetapiUrlProcessorPrettyPaths::decodePathSegmentAlias in plugins/facetapi/url_processor_pretty_paths.inc
FacetapiUrlProcessorPrettyPaths::decodePathSegmentValue in plugins/facetapi/url_processor_pretty_paths.inc
FacetapiUrlProcessorPrettyPaths::encodePathSegment in plugins/facetapi/url_processor_pretty_paths.inc

File

./facetapi_pretty_paths.module, line 174
The FacetAPI Pretty Paths module.

Code

function facetapi_pretty_paths_coder_callback($callback, $args) {
  $id = 'default';
  if (isset($args['facet']) && isset($args['facet']['facetapi pretty paths coder'])) {
    $id = $args['facet']['facetapi pretty paths coder'];
  }
  if ($class = ctools_plugin_load_class('facetapi_pretty_paths', 'coders', $id, 'handler')) {
    $args = func_get_args();

    // Remove $callback from the arguments.
    unset($args[0]);
    $instance = new $class();
    return call_user_func_array(array(
      $instance,
      $callback,
    ), $args);
  }
}