1.20.x taxonomy.path.inc | taxonomy_path_info() |
Implements hook_path_info().
File
- modules/
taxonomy/ taxonomy.path.inc, line 10 - Path integration.
Code
function taxonomy_path_info() {
$info['taxonomy_term'] = array(
'entity type' => 'taxonomy_term',
'label' => t('Taxonomy term'),
'pattern description' => t('Default URL alias pattern (applies to all vocabularies with blank URL alias patterns below)'),
'pattern default' => '[term:vocabulary]/[term:name]',
'type delete callback' => 'taxonomy_path_type_delete_callback',
'batch update callback' => 'taxonomy_path_bulk_update_batch_process',
'batch file' => 'taxonomy.path.inc',
'batch file path' => backdrop_get_path('module', 'taxonomy'),
'source prefix' => 'taxonomy/term/',
);
$vocabularies = taxonomy_get_vocabularies();
$languages = array();
if (module_exists('language')) {
$languages = array(LANGUAGE_NONE => (object) array(
'name' => t('Language neutral'),
'langcode' => LANGUAGE_NONE,
)) + language_list();
}
if (count($vocabularies)) {
$info['taxonomy_term']['pattern items'] = array();
foreach ($vocabularies as $vocabulary_name => $vocabulary) {
if (count($languages) && !empty($vocabulary->language)) {
$info['taxonomy_term']['pattern items'][$vocabulary_name] = t('Default URL alias pattern for %vocab-name (applies to all %vocab-name categories with blank URL alias patterns below)', array('%vocab-name' => $vocabulary->name));
foreach ($languages as $langcode => $language) {
$info['taxonomy_term']['pattern items'][$vocabulary_name . '_' . $langcode] = t('URL alias pattern for all %vocab-name URLs in %language', array('%vocab-name' => $vocabulary->name, '%language' => $language->name));
}
}
else {
$info['taxonomy_term']['pattern items'][$vocabulary_name] = t('URL alias pattern for all %vocab-name URLs', array('%vocab-name' => $vocabulary->name));
}
}
}
return $info;
}