You are here

protected function FacetApiPrettyPathsCoderDefault::prettyPath in Facet API Pretty Paths 6.3

Same name and namespace in other branches
  1. 7 plugins/coders/facetapi_pretty_paths_coder_default.inc \FacetApiPrettyPathsCoderDefault::prettyPath()

Convert a given text to a pretty path using pathauto, if available.

1 call to FacetApiPrettyPathsCoderDefault::prettyPath()
FacetApiPrettyPathsCoderTaxonomy::encodePathSegment in plugins/coders/facetapi_pretty_paths_coder_taxonomy.inc
Taxonomy special case: <alias>/<term-name>-<term-id>

File

plugins/coders/facetapi_pretty_paths_coder_default.inc, line 58
A default coder for pretty paths.

Class

FacetApiPrettyPathsCoderDefault
Default FacetApiPrettyPathsCoder.

Code

protected function prettyPath($text) {

  // @todo: Make this pluggable?
  if (module_exists('pathauto')) {

    // Needed, as of http://drupal.org/node/907578#comment-5564008
    require_once drupal_get_path('module', 'pathauto') . '/pathauto.inc';
    return pathauto_cleanstring($text);
  }
  return $text;
}