private function FacetApiPrettyPathsCoderTaxonomyPathauto::getVocabularyPathAlias in Facet API Pretty Paths 7
Helper function that returns the path alias for a vocabulary.
2 calls to FacetApiPrettyPathsCoderTaxonomyPathauto::getVocabularyPathAlias()
- FacetApiPrettyPathsCoderTaxonomyPathauto::decodePathSegmentValue in plugins/
coders/ facetapi_pretty_paths_coder_taxonomy_pathauto.inc - Taxonomy pathauto special case: <facet alias>/<term-name alias>
- FacetApiPrettyPathsCoderTaxonomyPathauto::encodePathSegment in plugins/
coders/ facetapi_pretty_paths_coder_taxonomy_pathauto.inc - Taxonomy pathauto special case: <facet alias>/<term-name alias>
File
- plugins/
coders/ facetapi_pretty_paths_coder_taxonomy_pathauto.inc, line 71 - A taxonomy specific coder based on path aliases of terms.
Class
- FacetApiPrettyPathsCoderTaxonomyPathauto
- Taxonomy pathauto specific implementation of FacetApiPrettyPathsCoder.
Code
private function getVocabularyPathAlias($facet_info, $adapter) {
static $aliases = array();
if (!isset($aliases[$facet_info['name']])) {
$aliases[$facet_info['name']] = FALSE;
$facet_settings = $adapter
->getFacetSettingsGlobal($facet_info);
$voc = taxonomy_vocabulary_machine_name_load($facet_settings->settings['pretty_paths_taxonomy_pathauto_vocabulary']);
if ($voc && module_exists('pathauto')) {
// Needed, as of http://drupal.org/node/907578#comment-5564008
require_once drupal_get_path('module', 'pathauto') . '/pathauto.inc';
$aliases[$facet_info['name']] = pathauto_cleanstring($voc->name);
}
}
return $aliases[$facet_info['name']];
}