function radioactivity_rules_token_values in Radioactivity 6
File
- modules/
radioactivity_rules/ radioactivity_rules.module, line 138
Code
function radioactivity_rules_token_values($type, $object = NULL, $options = array()) {
if ($type == 'node') {
$node = $object;
$energies = radioactivity_get_energy($node->nid, "node");
foreach ($energies as $dpid => $energy) {
$tokens['radioactivity-energy-' . $dpid] = $energy;
$tokens['radioactivity-energy-max-' . $dpid] = radioactivity_rules_get_decay_profile_node_max_energy($dpid, $node->nid);
}
$energies = radioactivity_get_energies_for_source($node->nid, 'node', 'node_create');
foreach ($energies as $dpid => $energy) {
$tokens['radioactivity-initial-energy-' . $dpid] = $energy;
}
return $tokens;
}
}