You are here

function activity_token_values in Activity 6

Same name and namespace in other branches
  1. 5.4 activity.module \activity_token_values()
  2. 5.3 activity.module \activity_token_values()
  3. 6.2 activity.module \activity_token_values()

Token module integration. Defines available default token values.

File

./activity.module, line 1006
activity.module

Code

function activity_token_values($type, $data = NULL, $options = array()) {
  if ($type == 'activity' && !empty($data)) {
    $author = activity_user_load($data['uid']);
    $tokens = array(
      'author' => theme('activity_username', $author, TRUE),
      'author-all' => theme('activity_username', $author),
      'author-name' => $author->name,
      'author-picture' => theme('activity_user_picture', $author),
      'operation' => $data['operation'],
      'time-small' => format_date($data['created'], 'small'),
      'time-medium' => format_date($data['created'], 'medium'),
      'time-large' => format_date($data['created'], 'large'),
      'time-ago' => format_interval(time() - $data['created']),
    );
    return $tokens;
  }
}