Variables used in template.php How should I know which variables and objects can be used directly in the template.php file?This is what a template.php file created by somebody else contains:

function garland_separate_terms($node_taxonomy) {
  if ($node_taxonomy) {
    foreach ($node_taxonomy as $term) { 
      $links[$term-&gt;vid]['taxonomy_term_'. $term-&gt;tid] // …
      // …
    }
    // …
  }
}


Why can he use the $term object directly?
Simple answer - the line foreach ($node_taxonomy AS $term) is where the $term variable is coming from. That's a basic PHPism that treats $node_taxonomy as an array, and puts the current item from that array into the $term variable as it iterates over the array.

As snufkin noted, $node_taxonomy is the only variable you're getting access to automatically.