You are here

function lineage_string in Taxonomy Lineage 7

Same name and namespace in other branches
  1. 5 lineage.module \lineage_string()
  2. 6 lineage.module \lineage_string()

Ensure positive weights with enough digits so that all sort properly.

Parameters

$term: A taxonomy term

Return value

A term lineage string with weight.

3 calls to lineage_string()
lineage_update_term in ./lineage.module
lineage_update_term_r in ./lineage.module
_lineage_get_parent_lineage in ./lineage.module
Recursive helper to assemble lineage.

File

./lineage.module, line 266
lineage.module Module code for taxonomy term hierarchy lineage.

Code

function lineage_string($term) {
  $w = _lineage_weights($term->vid);
  return sprintf("%0" . $w['digits'] . "d", $term->weight + $w['offset']) . "-" . $term->name . "\n";
}