Contributions API

Calling all Drupal developers!

Help us get this on the first page of Digg. DIGG NOW!

Modules in 6

_token_get_id

Definition

_token_get_id($type = 'global', $object = NULL)
contributions/token/token.module, line 337

Code

<?php
function _token_get_id($type = 'global', $object = NULL) {
  if (!isset($object)) {
    return "default";
  }
  switch ($type) {
    case 'node':
      return $object->nid;
    case 'comment':
      return $object->cid;
    case 'user':
      return $object->uid;
    default:
      return crc32(serialize($object));
  }
}
?>