You are here

function _uc_catalog_pathauto_alias in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_catalog/uc_catalog.module \_uc_catalog_pathauto_alias()
  2. 7.3 uc_catalog/uc_catalog.pathauto.inc \_uc_catalog_pathauto_alias()

Creates aliases for taxonomy objects.

Parameters

$category: A taxonomy object.

2 calls to _uc_catalog_pathauto_alias()
uc_catalog_pathauto_bulkupdate in uc_catalog/uc_catalog.module
Implements hook_pathauto_bulkupdate().
uc_catalog_taxonomy in uc_catalog/uc_catalog.module
Implements hook_taxonomy().

File

uc_catalog/uc_catalog.module, line 534
Ubercart Catalog module.

Code

function _uc_catalog_pathauto_alias($category, $op) {
  module_load_include('inc', 'pathauto');
  $count = 0;
  if ($category->vid == variable_get('uc_catalog_vid', 0)) {
    $placeholders = pathauto_get_placeholders('taxonomy', $category);
    $src = uc_catalog_path($category);
    if ($alias = pathauto_create_alias('uc_catalog', $op, $placeholders, $src, $category->vid)) {
      $count++;
    }
  }
  return $count;
}