You are here

function pmticket_token_values in Drupal PM (Project Management) 7.2

Same name and namespace in other branches
  1. 8 pmticket/pmticket.module \pmticket_token_values()
  2. 7.3 pmticket/pmticket.module \pmticket_token_values()
  3. 7 pmticket/pmticket.module \pmticket_token_values()

Implements hook_token_values().

File

pmticket/pmticket.module, line 102
Main module file for the PM Ticket module.

Code

function pmticket_token_values($type, $object = NULL) {
  $values = array();
  $node = $object;
  if (($type == 'node' || $type == 'all') && $node->type === 'pmticket') {
    $values['pmticket-organization-nid'] = $node->organization_nid;
    $values['pmticket-organization-title'] = $node->organization_title;
    $values['pmticket-project-nid'] = $node->project_nid;
    $values['pmticket-project-title'] = $node->project_title;
  }
  return $values;
}