Skip to content
Snippets Groups Projects
Commit 468d7c08 authored by Dave Reid's avatar Dave Reid
Browse files

by Dave Reid: Removing pathauto.tokens.inc since it is no longer used.

parent d40e9ef2
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,5 @@ files[] = pathauto.module
files[] = pathauto.install
files[] = pathauto.test
files[] = pathauto.pathauto.inc
files[] = pathauto.tokens.inc
configure = admin/config/search/path/patterns
recommends[] = path_redirect
<?php
// $Id$
/**
* @file
* Builds placeholder replacement tokens for pathauto.
*
* @ingroup pathauto
*/
/**
* Implements hook_token_info().
*/
function pathauto_token_info() {
$tokens = array();
if (module_exists('taxonomy')) {
//$tokens['node']['term-lowest'] = array(
// 'name' => t('Lowest weighted term'),
// 'description' => t('The taxonomy term associated with the node sorted by vocabulary weight, taxonomy term weight, then taxonomy term name.'),
// 'type' => 'term',
//);
}
return array(
'tokens' => $tokens,
);
}
/**
* Implements hook_tokens().
*/
function pathauto_tokens($type, $tokens, array $data = array(), array $options = array()) {
$replacements = array();
$sanitize = !empty($options['sanitize']);
// Node tokens.
if ($type == 'node' && !empty($data['node'])) {
$node = $data['node'];
//foreach ($tokens as $name => $original) {
// switch ($name) {
// }
//}
// Chained token relationships.
//if ($term_lowest_tokens = token_find_with_prefix($tokens, 'term-lowest')) {
// $tid = db_query_range('SELECT t.tid FROM {taxonomy_index} ti INNER JOIN {taxonomy_term_data} t ON ti.tid = t.tid INNER JOIN {taxonomy_vocabulary} v ON t.vid = v.vid WHERE ti.nid = :nid ORDER BY v.weight, t.weight, t.name', 0, 1, array(':nid' => $node->nid))->fetchField();
// if ($term = taxonomy_term_load($tid)) {
// $replacements += token_generate('term', $term_lowest_tokens, array('term' => $term), $options);
// }
//}
}
return $replacements;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment